You should probably enter the database table with some UDID (you can create your own by hashing the packet identifier and the MAC address of the device) And a second field that indicates whether the token is a “development” or a “production” token. The third field may be the actual token.
In delegate deletion in the didRegisterForRemoteNotificationsWithDeviceToken delegation method, you can add logic to determine if your application is in development or production mode and updates your database using the device token based on the UDID and the “mode” in which the application operates in.
Your code might look something like this:
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
To do this, you need to go to your project → Build Settings. In the Preprocessor Macros section, type CONFIGURATION_ and press Enter. This should create a preprocessor macro for each of your build configurations. In this case, my build configurations are AdHoc, Debug, Distribution, and Release.
It creates for me CONFIGURATION_AdHoc, CONFIGURATION_Debug, CONFIGURATION_Distribution and CONFIGURATION_Release.
source share