If your app is running in Debug mode and is signed with the Development provisioning profile (Code Signing Identity is "iPhone Developer"), then your server must be using the Development certificate.
Apps that are distributed as Ad Hoc or on the App Store (when Code Signing Identify is "iPhone Distribution") must talk to a server that uses the Production certificate.
NOTE: When you are ready to release your app, repeat this process for the production certificate. The steps are the same.
Whether you have created a new App ID or modified an existing one, you will need to regenerate your provisioning profile and install it. If you have trouble using an existing profile, try removing the App ID and setting it back. For this tutorial, we'll create a new one.
This should open Xcode's Organizer in the Devices pane. Your new provisioning profile should appear in the Provisioning Profiles section of your Library. Make sure that the status for this profile is "Valid profile".
NOTE: Prior to submitting your app to the App Store, you will need to test push notifications in production.
To enable push you'll haveto enable this feature for your app on tapcliq.com by choosing appropriate environment (Development Or Production) and uploading corresponding certificate.
Let's start by configuring the Xcode project settings. Make sure that both the App ID and the provisioning profile are set.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... [applicationregisterForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; NSDictionary *notification = [launchOptionsobjectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; [AdvBarhandlePushNotification:notification]; ... }
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { NSLog(@"My token is: %@", deviceToken); [AdvBarsetPushDeviceToken:deviceTokenforAppId:@"Your App Id"]; }
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { [AdvBarhandlePushNotification:userInfo]; }
- (void)applicationDidBecomeActive:(UIApplication *)application { application.applicationIconBadgeNumber = 0; [[UIApplicationsharedApplication] cancelAllLocalNotifications]; }
NOTE: You can push your message to every user of your app or target specific segment of users by selecting appropriate segment under targeting.
Note: This application should be set up for push (Check out how to set up push for Android app in Android_README and for an iOS App in iOS_ConfigurePushNotification documents)