I am running Push Notification on two test apps. The first test app I got working over a 2 day period. The 2nd test app I tried to implement Push Notification tonight and have been banging my head over it. I am able to swap the certificates and the 1st app receives notifications, but when I use the .pem for the 2nd app, nothing happens.
I have gone through the entire process twice tonight, trying to get the Push to work for this 2nd app. My only conclusion, given that I can swap the .pems and it will work for the 1st app, is that something is wrong with the 2nd .pem or maybe there is a waiting period before the push starts working, and I just didn't realize it during my first setup?
Edit: The problem was that I was using
-(BOOL)application: didFinishLaunchingWithOptions:
in my delegate and not using
-(void)applicationDidFinishLaunching:
I was doing...
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Register for Push Notifications
UIRemoteNotificationType notifyTypes = (UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeBadge);
}
When I should have been doing
-(void)applicationDidFinishLaunching:(UIApplication *)application {
//NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];
// Register for Push Notifications
UIRemoteNotificationType notifyTypes = (UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeBadge);
}