We integrated the Urban SDK with these recommendations .
We tried to check the push notification using the ad hoc profile, where we set the values โโbelow in AirshipConfig.plist
inProduction=YESproductionAppKey=OUR PRODUCTION KEYproductionAppSecret= OUR PRODUCTION SECRET
Please check the code below that we implemented in the AppDelegate project file.
-(void) applicationDidFinishLaunching: (UIApplication *)application { . . . . UAConfig *config = [UAConfig defaultConfig]; config.automaticSetupEnabled=NO; [UAirship takeOff:config]; if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)]) { NSLog(@"------------REGISTER DEVICE------------: >= 8"); [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]]; } else { NSLog(@"------------REGISTER DEVICE------------: <8 "); [[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)]; } . . . . } #pragma mark Remote Notification methods -(void) application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken // Device Registration { [[UAirship push] appRegisteredForRemoteNotificationsWithDeviceToken:devToken]; } - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings { [[UAirship push] appRegisteredUserNotificationSettings]; } -(void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { NSLog(@"%@", error); } - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { NSLog(@"NOTIFICATION------------ didReceiveRemoteNotification ------------ %@", userInfo); [[UAirship push] appReceivedRemoteNotification:userInfo applicationState:application.applicationState]; }
When we try to send a notification to a registered device token, the server displays the device token as an INACTIVE device token.
Please show me what I have to do for this.
source share