Vinod
Vinod

Reputation: 675

How can get device token for iphone push notifcation under Ad Hoc

The push notification is working when I use development profile , But it is not working with distribution profile. I am using the code to get the device token as follows:

- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
    {
        NSLog(@"My token is: %@", deviceToken);
    }

I am getting the same device token in production mode as in development mode. I am testing the app as Ad Hoc.

How can I get device token in Ad Hoc or production mode. Because we can NSLog device token on console for debug mode.

Upvotes: 2

Views: 1593

Answers (3)

lenhhoxung
lenhhoxung

Reputation: 2766

How can production build can run on real device? Running an app built by production provisioning profile is prohibited.

Upvotes: 0

hchouhan02
hchouhan02

Reputation: 946

you are using the developer mode of APNS, use production mode of APNS i think you are using sandbox when creating the .pem files so remove sandbox and then try again to send pust notification.

Upvotes: 0

xda1001
xda1001

Reputation: 2459

You can send the deviceToken to your server. If you don't have a server, you can write the deviceToken to a file in document directory and use tools like iFunBox to see it.

Upvotes: 2

Related Questions