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
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];
}
if you used GCM. In Development:-
_registrationOptions = @{kGGLInstanceIDRegisterAPNSOption:deviceToken,
kGGLInstanceIDAPNSServerTypeSandboxOption:@YES};
In Distribution:-
_registrationOptions = @{kGGLInstanceIDRegisterAPNSOption:deviceToken,
kGGLInstanceIDAPNSServerTypeSandboxOption:@NO};
For Firebase try this:
#if DEBUG
Messaging.messaging().setAPNSToken(apnsToken, type: .sandbox)
#else
Messaging.messaging().setAPNSToken(apnsToken, type: .prod)
#endif
For TestFlight, use
Please ensure that you have set FirebaseAppDelegateProxyEnabled
to YES
in info.plist file.