objective c - iOS didRegisterForRemoteNotifications returns different tokens when run from test flight -
i'm developing iphone application uses apple's push notifications. i've followed steps listed here: https://parse.com/tutorials/ios-push-notifications , device receives notifications when run app connecting device through xcode. but, when upload app test flight, app fails receive notifications. upon further investigation, found token returned
nsstring * token = [nsstring stringwithformat:@"%@", devicetoken];
is different when app run through xcode, , different when it's run test flight. why that? , how can fix it? i'm using apns send push notifications.
you need check certificates. when register bundle id, options generate 2 provisioning profiles , corresponding 2 push notification certs, dev , production. when run app in dev mode xcode i.e. when xcode target running configured pick development provisioning profile specified, server needs use dev/sandbox certs returns token apple's sandbox servers (this happening in case). when sign app prod certs i.e use prod provisioning profile while generating ipa, server needs use prod push certs. in case, uploaded app signed prod certs , server still using dev certs. check that. luck.