Firebase Cloud Messaging development and release profile

后端 未结 4 991
误落风尘
误落风尘 2020-12-29 11:29

I recendly swtiched over from Google Cloud Messaging to Firebase Cloud Messaging.

With GCM I had to choose the sandbox option. As described here : https://developers

4条回答
  •  [愿得一人]
    2020-12-29 12:20

    I solved the problem by adding the code below to the project.

    FIRInstanceIDAPNSTokenType.Sandbox will be used when you install the app though TestFlight,
    and FIRInstanceIDAPNSTokenType.Prod when your app goes live on the App Store.

    func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) 
    {
        FIRInstanceID.instanceID().setAPNSToken(deviceToken, type: FIRInstanceIDAPNSTokenType.Sandbox)
        FIRInstanceID.instanceID().setAPNSToken(deviceToken, type: FIRInstanceIDAPNSTokenType.Prod)
    }
    

提交回复
热议问题