quickblox makes the same token for development and production

雨燕双飞 提交于 2020-01-02 23:13:17

问题


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?


回答1:


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:



来源:https://stackoverflow.com/questions/25234465/quickblox-makes-the-same-token-for-development-and-production

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!