I created an APP for both iOS and Android and I used APN to get deviceToken for iOS and GCM for Android. I decided to migrate to firebase to make token management easier. I noticed a issue just for iOS application and I was wondering if someone else encountered it too. When I migrated iOS app to firebase, token was not regenerated unless the app was reinstalled. I follow the firebase guide to do it but with no result. Someone else has this problem? Thanks in advance
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I solved my problem.
I switch off and switch on capabilities
I restarted XCode
I put FIRInstanceIDAPNSTokenType to prod and now all seems to work
func application( _ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data ) { FIRInstanceID.instanceID().token() FIRInstanceID.instanceID().setAPNSToken(deviceToken, type: FIRInstanceIDAPNSTokenType.prod) }