Search code examples
iosquickblox

quickblox makes the same token for development and production


I added quickblox to my app,

And put up the development and production APNS certificates

when i open the app, in development mode, with the development flag off

[QBSettings setIsProductionEnvironmentForPushNotifications:NO]

i get a push notification token, sending messages to this token makes the arrive

, however, when I want to switch to production mode i put

[QBSettings setIsProductionEnvironmentForPushNotifications:YES]

and then in the method application:didRegisterForRemoteNotificationWithDeviceToken:

gives the EXACT same development token.

How do I generate a production token instead? How to force a new token to be created?


Solution

  • Actually you don't need to manage push zones manually

    just add next lines as you can find in documentation http://quickblox.com/developers/SimpleSample-messages_users-ios

    #ifndef DEBUG 
       [QBSettings useProductionEnvironmentForPushNotifications:YES]; 
    #endif
    

    What does they mean?

    it means that with debug builds you will use dev environment.

    With AdHoc or AppStore builds you will use prod environment.

    So, you can create the AdHoc ipa file, sign it with AdHoc provision profile and it should work

    Above 3 lines depend on next Xcode settings: enter image description here