Why push notifications is not working on testflight?

前端 未结 9 1843
情话喂你
情话喂你 2020-11-29 20:06

I have tested push notifications as a developer account and it worked, But when i tried to put it on TestFlight for the testers to test it, it didn\'t show a push notificati

相关标签:
9条回答
  • 2020-11-29 20:37

    If you use Firebase, you have to add in:

    • TestFlight:

      -(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
          [[FIRInstanceID instanceID] setAPNSToken:deviceToken type:FIRInstanceIDAPNSTokenTypeSandbox]; 
      }
      
    • Production:

      -(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
          [[FIRInstanceID instanceID] setAPNSToken:deviceToken type:FIRInstanceIDAPNSTokenTypeProd]; 
      }
      
    0 讨论(0)
  • 2020-11-29 20:38

    if you used GCM. In Development:-

    _registrationOptions = @{kGGLInstanceIDRegisterAPNSOption:deviceToken,
                                 kGGLInstanceIDAPNSServerTypeSandboxOption:@YES};
    

    In Distribution:-

    _registrationOptions = @{kGGLInstanceIDRegisterAPNSOption:deviceToken,
                                 kGGLInstanceIDAPNSServerTypeSandboxOption:@NO};
    
    0 讨论(0)
  • 2020-11-29 20:39

    For Firebase try this:

    #if DEBUG
        Messaging.messaging().setAPNSToken(apnsToken, type: .sandbox)
    #else
        Messaging.messaging().setAPNSToken(apnsToken, type: .prod)
    #endif
    
    0 讨论(0)
  • 2020-11-29 20:40
    1. You need to use production certificate for testflight build.
    2. Also need to remove sanbox (sandbox mode) from push notification url in push sending script.
    0 讨论(0)
  • 2020-11-29 20:44

    For TestFlight, use

    1. Production certificate
    2. "gateway.push.apple.com" at the server(back end job)
    0 讨论(0)
  • 2020-11-29 20:56

    Please ensure that you have set FirebaseAppDelegateProxyEnabled to YES in info.plist file.

    0 讨论(0)
提交回复
热议问题