phonegap / phonegap-plugin-push

Register and receive push notifications
MIT License
1.94k stars 1.91k forks source link

Working on iOS 11.0 but not in iOS 10.3 #2009

Closed ouraios closed 6 years ago

ouraios commented 7 years ago

Expected Behaviour

Receiving push notification

Actual Behaviour

Not receiving push notifications

Reproduce Scenario (including but not limited to)

Use the plugin on iOS 10.3 device

Steps to Reproduce

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

iOS 10.3.3

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Working perfectly in multiple android version

Cordova CLI version and cordova platform version

android 6.3.0 ios 4.5.1 cordova 7.0.1

Plugin version

phonegap-plugin-push 2.0.0 "PushPlugin"

Sample Push Data Payload

{
"registration_ids": ["myDeviceIds"],
"priority": "high",
"notification": {
            "title": "Title msg",
            "body": "Body msg",
            "subtitle": "Subtitle msg"
},
"data": {"link": "mylnik",
            "badge": 1,
            "style": "inbox",
            "summaryText": "summary test",
            "ledColor": [0, 0, 255, 0],
            "vibrationPattern": [200, 200, 200, 200]
}
}

Sample Code that illustrates the problem

push = PushNotification.init({
            android: {
                forceShow: true
            },
            ios: {
                alert: "true",
                badge: "true",
                sound: "false",
                fcmSandbox: "true"
            },
        });

        push.on('registration', function (data) {
            console.log('Registration');
            console.log(data);
            // alert(data.registrationId);
            app.pushRegistrationId = data.registrationId;
        });

        push.on('notification', function (data) {
            console.log('Notification');
            console.log(data);
            // DEBUG
            alert('Received Push Notification');
        });

        push.on('error', function (e) {
            // DEBUG
            alert('Push Error');
            console.log('Error');
            console.log(e);
            // e.message
        });

Logs taken while reproducing problem

2017-10-13 13:10:37.335787+0200 [962:243364] [Firebase/Analytics][I-ACS036002] Firebase screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist
2017-10-13 13:10:37.419140+0200 [962:243311] Apache Cordova native platform version 4.5.0 is starting.
2017-10-13 13:10:37.420142+0200 [962:243311] Multi-tasking -> Device: YES, App: YES
2017-10-13 13:10:37.430461+0200 [962:243311] 

Started backup to iCloud! Please be careful.
Your application might be rejected by Apple if you store too much data.
For more information please read "iOS Data Storage Guidelines" at:
https://developer.apple.com/icloud/documentation/data-storage/
To disable web storage backup to iCloud, set the BackupWebStorage preference to "local" in the Cordova config.xml file
2017-10-13 13:10:37.521349+0200 [962:243311] Using UIWebView
2017-10-13 13:10:37.524122+0200 [962:243311] [CDVTimer][console] 0.140011ms
2017-10-13 13:10:37.524440+0200 [962:243311] [CDVTimer][handleopenurl] 0.167012ms
2017-10-13 13:10:37.526094+0200 [962:243311] Unlimited access to network resources
2017-10-13 13:10:37.526653+0200 [962:243311] Unlimited access to network resources
2017-10-13 13:10:37.526787+0200 [962:243311] [CDVTimer][intentandnavigationfilter] 2.276003ms
2017-10-13 13:10:37.526997+0200 [962:243311] [CDVTimer][gesturehandler] 0.163972ms
2017-10-13 13:10:37.547593+0200 [962:243311] [CDVTimer][splashscreen] 20.540953ms
2017-10-13 13:10:37.550767+0200 [962:243311] [CDVTimer][statusbar] 2.955973ms
2017-10-13 13:10:37.550849+0200 [962:243311] [CDVTimer][TotalPluginStartup] 27.574003ms
2017-10-13 13:10:37.557069+0200 [962:243311] createNotificationChecker
2017-10-13 13:10:37.557134+0200 [962:243311] not coldstart
2017-10-13 13:10:37.559374+0200 [962:243311] active
2017-10-13 13:10:37.559615+0200 [962:243311] PushPlugin skip clear badge
2017-10-13 13:10:37.610506+0200 [962:243367] libMobileGestalt MobileGestaltSupport.m:153: pid 962 () does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled
2017-10-13 13:10:37.610583+0200 [962:243367] libMobileGestalt MobileGestalt.c:550: no access to InverseDeviceID (see <rdar://problem/11744455>)
2017-10-13 13:10:37.646425+0200 [962:243367] [Firebase/Analytics][I-ACS024000] Debug mode is on
2017-10-13 13:10:37.646908+0200 [962:243367] [Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: MainViewController, 3887992299216288085
2017-10-13 13:10:37.994105+0200 [962:243311] Resetting plugins due to page load.
2017-10-13 13:10:38.151810+0200 [962:243311] Finished load of: file:///var/containers/Bundle/Application/4DDA9B1B-8FE4-45C1-A013-3BE986F70B17/.app/www/index.html
2017-10-13 13:10:38.334306+0200 [962:243364] [Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: UIAlertController, 3887992299216288086
2017-10-13 13:10:38.342064+0200 [962:243364] [Firebase/Analytics][I-ACS031006] View controller already tracked. Class, ID: UIAlertController, 3887992299216288086
2017-10-13 13:10:38.747567+0200 [962:243363] [Firebase/Analytics][I-ACS031006] View controller already tracked. Class, ID: UIAlertController, 3887992299216288086
2017-10-13 13:10:42.962729+0200 [962:243363] [Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: UIApplicationRotationFollowingController, 3887992299216288087
2017-10-13 13:10:42.974863+0200 [962:243369] [Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: MainViewController, 3887992299216288085
2017-10-13 13:10:43.002239+0200 [962:243311] THREAD WARNING: ['PushNotification'] took '17.348145' ms. Plugin should use a background thread.
2017-10-13 13:10:43.054240+0200 [962:243365] [Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: UIAlertController, 3887992299216288088
2017-10-13 13:10:43.465961+0200 [962:243365] [Firebase/Analytics][I-ACS031006] View controller already tracked. Class, ID: UIAlertController, 3887992299216288088
2017-10-13 13:10:46.434632+0200 [962:243371] [Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: UIApplicationRotationFollowingController, 3887992299216288089
2017-10-13 13:10:46.435951+0200 [962:243371] [Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: MainViewController, 3887992299216288085
2017-10-13 13:10:46.437346+0200 [962:243369] Push Plugin register called
2017-10-13 13:10:46.437507+0200 [962:243369] PushPlugin.register: setting badge to false
2017-10-13 13:10:46.437558+0200 [962:243369] PushPlugin.register: clear badge is set to 0
2017-10-13 13:10:46.437607+0200 [962:243369] PushPlugin.register: better button setup
2017-10-13 13:10:46.439634+0200 [962:243369] FCM Sender ID 613225384053
2017-10-13 13:10:46.439730+0200 [962:243369] Using FCM Notification
2017-10-13 13:10:46.444284+0200 [962:243369] Using FCM Sandbox
2017-10-13 13:10:46.465189+0200 [962:243371] [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
2017-10-13 13:10:46.467280+0200 [962:243371] [Firebase/Core][I-COR000001] Configuring the default app.
2017-10-13 13:10:46.468022+0200 [962:243371] [Firebase/InstanceID][I-IID013010] InstanceID library version 2.0.3
2017-10-13 13:10:46.469214+0200 [962:243369] [Firebase/Analytics][I-ACS005000] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at http://goo.gl/9vSsPb
2017-10-13 13:10:46.475294+0200 [962:243369] [Firebase/Analytics][I-ACS023007] Firebase Analytics v.40003000 started
2017-10-13 13:10:46.476735+0200 [962:243369] [Firebase/Analytics][I-ACS023008] To disable debug logging set the following application argument: -noFIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2017-10-13 13:10:46.477105+0200 [962:243369] [Firebase/Analytics][I-ACS023009] Debug logging enabled
2017-10-13 13:10:46.499475+0200 [962:243371] [Firebase/Messaging][I-FCM002000] FIRMessaging library version 2.0.3
2017-10-13 13:10:46.505447+0200 [962:243369] [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. Add "FirebaseAppDelegateProxyEnabled" to your Info.plist and set it to NO
2017-10-13 13:10:46.514541+0200 [962:243311] FCM Registration Token: dg-eUR9bq8c:APA91bGwxrYgEJeLVxDGJT2sktry7BwyodsrPZP2-cVjDf7puWGKriC2u6SE5Im1XtjdNDAZkPMLYGflYOLVA9WJPS_tbJH0vrvWwMbhlUQXTvfnjtXXelo54rSu90ATgg1FRzUYXJZ0
2017-10-13 13:10:46.519477+0200 [962:243363] [Firebase/Analytics][I-ACS902004] Network status has changed. Code, status: 2, Connected
2017-10-13 13:10:46.525367+0200 [962:243363] [Firebase/InstanceID][I-IID003012] Provisioning profile has specifically provisioned devices, most likely a Dev profile.
2017-10-13 13:10:46.525808+0200 [962:243363] [Firebase/InstanceID][I-IID003013] APNS Environment in profile: development
2017-10-13 13:10:46.531092+0200 [962:243311] Push Plugin register success: <308048c9 3a8e2531 6e126106 f77550ed 6c2a6dd9 d8c83631 dd12825d 726024c9>
2017-10-13 13:10:46.538745+0200 [962:243371] [Firebase/Analytics][I-ACS003007] Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist
2017-10-13 13:10:46.544167+0200 [962:243311] Registration
2017-10-13 13:10:46.544400+0200 [962:243311] {"registrationId":"dg-eUR9bq8c:APA91bGwxrYgEJeLVxDGJT2sktry7BwyodsrPZP2-cVjDf7puWGKriC2u6SE5Im1XtjdNDAZkPMLYGflYOLVA9WJPS_tbJH0vrvWwMbhlUQXTvfnjtXXelo54rSu90ATgg1FRzUYXJZ0","registrationType":"FCM"}
2017-10-13 13:10:46.546701+0200 [962:243363] [Firebase/Analytics][I-ACS029014] Successfully parsed a configuration. Version: 1506671453272454
2017-10-13 13:10:46.547848+0200 [962:243363] [Firebase/Analytics][I-ACS023016] Firebase Analytics is ready to receive events
2017-10-13 13:10:46.564714+0200 [962:243369] [Firebase/Analytics][I-ACS032003] iAd framework is not linked. Search Ad Attribution Reporter is disabled.
2017-10-13 13:10:46.566249+0200 [962:243369] [Firebase/Analytics][I-ACS023024] No data to upload. Upload task will not be scheduled
2017-10-13 13:10:46.567436+0200 [962:243369] [Firebase/Analytics][I-ACS033003] Scheduling user engagement timer
2017-10-13 13:10:46.568434+0200 [962:243369] [Firebase/Analytics][I-ACS002002] Engagement timer scheduled to fire in approx. (s): 3600
2017-10-13 13:10:46.568477+0200 [962:243369] [Firebase/Analytics][I-ACS023012] Firebase Analytics enabled
2017-10-13 13:10:51.574187+0200 [962:243367] [Firebase/Analytics][I-ACS012018] Saving bundle. size (bytes): 463
2017-10-13 13:10:51.577216+0200 [962:243367] [Firebase/Analytics][I-ACS023116] Bundle added to the upload queue. BundleID, timestamp (ms): 30, 1507893050432
2017-10-13 13:10:51.601173+0200 [962:243367] [Firebase/Analytics][I-ACS023038] Uploading events. Elapsed time since last successful upload (s): 4.325904846191406
2017-10-13 13:10:51.603724+0200 [962:243367] [Firebase/Analytics][I-ACS023039] Measurement data sent to network. Timestamp (ms), data: 1507893051600, <FIRAPBMeasurementBatch: 0x170016600>
2017-10-13 13:10:51.635992+0200 [962:243364] [Firebase/Analytics][I-ACS900000] Uploading data. Host: https://app-measurement.com/a
2017-10-13 13:10:51.787544+0200 [962:243367] [Firebase/Analytics][I-ACS901006] Received SSL challenge for host. Host: https://app-measurement.com/a
2017-10-13 13:10:51.929327+0200 [962:243363] [Firebase/Analytics][I-ACS023044] Successful upload. Got network response. Code, size: 204, -1
2017-10-13 13:10:51.940190+0200 [962:243371] [Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): -0.5065240859985352
2017-10-13 13:10:51.940562+0200 [962:243371] [Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): -0.5065240859985352
2017-10-13 13:10:51.973346+0200 [962:243371] [Firebase/Analytics][I-ACS023024] No data to upload. Upload task will not be scheduled
2017-10-13 13:10:51.975163+0200 [962:243371] [Firebase/Analytics][I-ACS002003] Measurement timer canceled
macdonst commented 7 years ago

@ouraios not sure what to tell you here. There is no reason why it shouldn't work on iOS 10.

macdonst commented 6 years ago

Closing, inactivity. Please comment/re-open if you have more details.

eslopes commented 6 years ago

same problem here. Spent a couple of weeks with no success on 10.3.3, but it worked like a charm in 11.x

any ideas?

lock[bot] commented 6 years ago

This thread has been automatically locked.