10

Iphone - Multiple applications, different application identifier, same token

 3 years ago
source link: https://www.codesd.com/item/iphone-multiple-applications-different-application-identifier-same-token.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Iphone - Multiple applications, different application identifier, same token

advertisements

From what I understand, if there are multiple apps with different App ID installed on a device, the tokens for push notification generated for each apps should be unique one to another.

In my case, I have several apps compiled with different provisioning profiles and each of them is based on different App IDs (though some of them has same Bundle Seed ID, some don't).

For each app I generated development push notification SSL and export the SSL to generate PEM. Next I download the provisioning profile and applied it to XCode.

When I tried to run it on my device, what I get from :

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

on ALL apps are a single same device Token. I wonder why is that?

And when I tried to push a notification via my server, there was no error message received. But the notification never delivered to installed devices.

Please give me suggestions on the problem. Thanks in advance.


The device token is not unique for each application, no matter if it is the production or development environment. You might be wondering, if the device token is the same for all apps then how is it possible that push notifications are routed to the right devices and the right applications? The answer is the app's unique bundle id. Each and every application on the App Store has a unique identifier, e.g.: com.mycompanyname.dummyapp. When an application registers itself for push notifications both the app bundle id and the device token are registered on Apple's servers.

Willy, one last thing that you might want to check, the very first step when configuring Push notifications is the creation of a CertificateSigningRequest.certSigningRequest file from the Keychain manager. If you have 2 apps you have to do this step twice so you end up with 2 different files that will be used in Apple's portal to create the SSL.cer file. Your problem might be that you used the same .certSigningRequest to create the different SSL.cer files instead of using a different one.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK