I implemented push notification in my app and it is working when i install build from xcode but not working when i install app via a link generated by diawi.com why this is happening?
Push apns certificates are different for Development & production
if you install from xcode - It uses development certificate
if install from diawi.com - It uses production certificate
on parse,com i think you have uploaded .p12 file generated from development certificate.
you have to upload .p12 file of production certificate & then check.
As @sadiqxs notice there are two types of certs, and in a comment you can find excelent simplePush code (http://d1xzuxjlafny7l.cloudfront.net/downloads/SimplePush.zip).
BUT one often forgotten thing!
Your deviceToken
changed (!!!) while you compile to production (ad-hoc) and deploy from Xcode. What i suggest you to do is:
NSLog
the token in method: -(void)application:didRegisterForRemoteNotificationsWithDeviceToken:
sample:
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {
NSString *dt = [[deviceToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]];
dt = [dt stringByReplacingOccurrencesOfString:@" " withString:@""];
NSLog(@"%@",dt");
}
6a) If yes, problem solved
6b) If no, and you receive the push for dev env for sure you have an issue with certificates and regenerate them
While you using SimplePush script remember to change url to production (gateway.push.apple.com) from sandbox one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With