0
votes

I am following the tutorial on setting up iOS push here:

Here - Ray Wenderlich

It works for development builds, ie an app in Debug mode using Developer certificate. I can send messages to a single device using the provided simplepush.php script.

I can't get this to work with adhoc builds - which are built using the distribution certificate.

What do I need to change in simplepush.php to make this work with adhoc builds?

I changed gateway.sandbox.push.apple.com:2195 to gateway.push.apple.com:2195 because I reckon the sandbox should be used for Development/debug builds, and adhoc and appstore builds should use gateway.push.apple.com:2195.

I get this response, but no messages are delivered to the device specified by the device token.

Connected to APNS Message successfully delivered

1

1 Answers

0
votes

Please be aware of the device token-ID,

which is different for the development && Production environment .

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

       UIAlertView *alert= [[UIAlertView alloc]initWithTitle: deviceToken message:Nil delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
        [alert show];
}