Damien Romito
Damien Romito

Reputation: 10065

Apple push notification with Apple entreprise app don't get the device token

I set up everything (creates certificates) and figured out to get the device token in development environment.

When I call:

[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];

I get the device token here:

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{ ...

But with apple entreprise, when I export the app and download it on an iPhone, the application:didRegisterForRemoteNotificationsWithDeviceToken is never called!

I've created :

I have the same for the development , and as I said, when I launch the app from xcode, I get the device token. Why not in the exported app?!

Upvotes: 0

Views: 355

Answers (1)

Ajumal
Ajumal

Reputation: 1048

I had face the similar issue before, Mine was an issue with provision file issue, Xcode wrongly pick XC Ad Hoc provisioning or some times Wildcard app provision while generating build see the image belowenter image description here.

With Wildcard app provision push notification will not work. From Xcode 6 has this problem and there is no option to select the right provision from here. But i found another solution for this. Right click the archive from Organizer and select show in finder ->

Right click the archive file and select show package content ->

choose product -> Applications .

Here you can see a file with your app name. copy it to a folder somewhere name the folder Payload , then compress it, so you have Payload.zip.

Then rename it to Payload.ipa. hope it will help you.

Upvotes: 1

Related Questions