Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'unregistered registration token' in FCM after utilizing window.FirebasePlugin.getToken() on iOS 12 #821

Closed
willmero opened this issue Sep 4, 2018 · 2 comments

Comments

@willmero
Copy link

willmero commented Sep 4, 2018

Hello!

Currently I am testing our application on iOS 12, and utilizing phone number verification. Signing in on an iOS 11 device using phone number and gathering a token there from the getToken() function seems to work fine, but deploying the app on iOS 12 and signing in to the same account using phone auth (on a different device) is resulting in an 'unregistered registration token' error on FCM when I am attempting to send a push notification to the device.

Mind you, I have not signed out of the other device, but I would assume that when I call the getToken() function, it would provide me with a registered Token for this device that I can push notifications to without needing to sign out of the previous device.

Please let me know if I am going about this in the wrong way here or if anyone else is seeing this issue besides me!

My setup is:
XCode 10.0 Beta 6
iOS 12 Beta 11
Cordova 8.0.0
cordova-ios 4.5.5
cordova-plugin-firebase 1.0.5

Edit: After upgrading to cordova-plugin-firebase 1.1.3, it looks like the Firebase plugin isn't initializing at all, with the following console output:

2018-09-04 12:31:51.311681-0400 CabTreks[4353:1050632] Apache Cordova native platform version 4.5.5 is starting.
2018-09-04 12:31:51.311747-0400 CabTreks[4353:1050632] Multi-tasking -> Device: YES, App: YES
2018-09-04 12:31:51.316034-0400 CabTreks[4353:1050632] 
2018-09-04 12:31:51.331700-0400 CabTreks[4353:1050632] Using UIWebView
2018-09-04 12:31:51.333396-0400 CabTreks[4353:1050632] [CDVTimer][console] 0.046968ms
2018-09-04 12:31:51.333489-0400 CabTreks[4353:1050632] [CDVTimer][handleopenurl] 0.059962ms
2018-09-04 12:31:51.334485-0400 CabTreks[4353:1050632] [CDVTimer][intentandnavigationfilter] 0.975966ms
2018-09-04 12:31:51.334539-0400 CabTreks[4353:1050632] [CDVTimer][gesturehandler] 0.033021ms
2018-09-04 12:31:51.334678-0400 CabTreks[4353:1050632] [CDVTimer][camerapreview] 0.119925ms
2018-09-04 12:31:51.334831-0400 CabTreks[4353:1050632] [CDVTimer][keyboard] 0.123978ms
2018-09-04 12:31:51.338787-0400 CabTreks[4353:1050632] [CDVTimer][backgroundgeolocation] 3.934979ms
2018-09-04 12:31:51:337 CabTreks[4353:1050632] LocationManager iOS9 detected
2018-09-04 12:31:51.343765-0400 CabTreks[4353:1050632] [CDVTimer][splashscreen] 4.943967ms
2018-09-04 12:31:51.343897-0400 CabTreks[4353:1050632] Starting Firebase plugin
2018-09-04 12:31:51.343989-0400 CabTreks[4353:1050632] [CDVTimer][firebaseplugin] 0.180006ms
2018-09-04 12:31:51.344008-0400 CabTreks[4353:1050632] [CDVTimer][TotalPluginStartup] 10.707021ms
2018-09-04 12:31:51.347579-0400 CabTreks[4353:1050701] 4.13.0 - [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.
2018-09-04 12:31:51.353747-0400 CabTreks[4353:1050713] 4.13.0 - [Firebase/Analytics][I-ACS023007] Firebase Analytics v.40200000 started
2018-09-04 12:31:51.354140-0400 CabTreks[4353:1050713] 4.13.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2018-09-04 12:31:51.434865-0400 CabTreks[4353:1050727] 4.13.0 - [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at:
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.
2018-09-04 12:31:51.440548-0400 CabTreks[4353:1050721] 4.13.0 - [Firebase/Messaging][I-FCM002023] The object <AppDelegate: 0x280178d00> does not respond to -messaging:didReceiveRegistrationToken:, nor -messaging:didRefreshRegistrationToken:. Please implement -messaging:didReceiveRegistrationToken: to be provided with an FCM token.
2018-09-04 12:31:51.473003-0400 CabTreks[4353:1050721] Metal GPU Frame Capture Enabled
2018-09-04 12:31:51.476979-0400 CabTreks[4353:1050721] Metal API Validation Enabled
2018-09-04 12:31:51.575377-0400 CabTreks[4353:1050715] LocationManager didChangeAuthorizationStatus 0
2018-09-04 12:31:51:575 CabTreks[4353:1050632] LocationManager didChangeAuthorizationStatus 0
2018-09-04 12:31:51.658248-0400 CabTreks[4353:1050632] Resetting plugins due to page load.
2018-09-04 12:31:51.959415-0400 CabTreks[4353:1050632] Connected to FCM.
2018-09-04 12:31:51.964113-0400 CabTreks[4353:1050632] InstanceID token: [omitted for GitHub]
2018-09-04 12:31:52.066527-0400 CabTreks[4353:1050632] Finished load of: file:///var/containers/Bundle/Application/5133C091-5951-430A-A055-584B43158E16/CabTreks.app/www/index.html

Cheers

@willmero willmero changed the title [iOS] 'unregistered registration token' in FCM after utilizing window.FirebasePlugin.getToken() 'unregistered registration token' in FCM after utilizing window.FirebasePlugin.getToken() Sep 4, 2018
@willmero willmero changed the title 'unregistered registration token' in FCM after utilizing window.FirebasePlugin.getToken() 'unregistered registration token' in FCM after utilizing window.FirebasePlugin.getToken() on iOS 12 Sep 4, 2018
@willmero
Copy link
Author

willmero commented Sep 5, 2018

After upgrading to 1.1.3, I was able to use the window.FirebasePlugin.initFirebase() to get things working and call the getToken() function, but one key indicator that might be a red flag here, is that when authing my user initially, and asking for permission to send push notifications, I am seeing the following:

`2018-09-05 19:44:32.944340-0400 CabTreks[6021:1518593] 4.13.0 - [Firebase/Messaging][I-FCM002023] The object <FirebasePlugin: 0x2817bd860> does not respond to -messaging:didReceiveRegistrationToken:, nor -messaging:didRefreshRegistrationToken:. Please implement -messaging:didReceiveRegistrationToken: to be provided with an FCM token.

2018-09-05 19:44:33.061417-0400 CabTreks[6021:1518593] 4.13.0 - [Firebase/InstanceID][I-IID003014] Error while reading embedded mobileprovision Error Domain=NSCocoaErrorDomain Code=260 "The file “embedded.mobileprovision” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/var/containers/Bundle/Application/C70FA4FD-88C4-4B7C-B64D-888E95A7DFDE/CabTreks.app/embedded.mobileprovision, NSUnderlyingError=0x283a39710 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}`

@willmero
Copy link
Author

willmero commented Sep 6, 2018

UPDATE: Figured it out, and for the sake of others who don't want to waste countless hours on figuring this out...
Was able to determine that the problem was a result from the Cordova build process in copy-www-build-step.js inside the iOS platform folder on line 56. You just need to comment that one out and it works!

Original issue solution here:
phonegap/phonegap-plugin-push#2518

@willmero willmero closed this as completed Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants