I\'ve been working on this for a while now. I know there\'s a ton of articles out there, and have learned a lot about it all.
I have created my development and produ
My problem is the same when I developed on Java But I solved it because of production = true is for production and production = false for development.
payload (payload, keystore, password, production, devices)
Hope this help.
So after hours and hours of headaches, I ended up rebuilding the SSL .pem file and it worked!!
Here's what I did:
These are the same instructions I had originally followed for development and production, but maybe/apparently messed something up. Then I tested on my ad-hoc version and it worked!!!
Also, its worth noting that when using the wrong .pem key, I was not receiving any error feedback from APNS. I use the simplepush.php file found in the link above as a base to send the PN.
Device token for Development and Production are not same.
When you are testing for Production use UIAlertView to see your token for Production. Do something like the following:
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
NSString *deviceID = [[deviceToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]];
deviceID = [deviceID stringByReplacingOccurrencesOfString:@" " withString:@""];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Device Token", nil) message:deviceID delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil];
[alert show];
}
Use this token to push notification for production.
Hope this helps.