Naveen Nautiyal
Naveen Nautiyal

Reputation: 161

iOS PushNotification Distribution for testing

I am developing an App with Push notifications enabled. I am using a Push Notification Enabled Distribution Profile to test the App in my device and it's working fine. But when I create an ad hoc build for my client with the same Distribution Profile it's not working as it is not able to receive any notifications.

I've cross checked the Device token of the Client's Device and it's fine. Do I have to use the Production Profile for Ad Hoc distribution?

Upvotes: 0

Views: 70

Answers (3)

SuReSh
SuReSh

Reputation: 1511

Yes.. You need a Production Profile for use with Ad-Hoc distribution; a Sandbox Profile will only work with debug builds as described and in your push notication php code change the request url

// this we use when our app in testing mode
$fp = stream_socket_client(
        'ssl://gateway.sandbox.push.apple.com:2195', $err,
    $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);

// use this when your app is in development mode..
$fp = stream_socket_client(
        'ssl://gateway.push.apple.com:2195', $err,
    $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);

Upvotes: 0

Durga Sriram
Durga Sriram

Reputation: 486

Follow this link step by step:-

https://parse.com/tutorials/push-notifications

And note that:-

While creating Production SSL certificate, do not change the name "aps_production.cer".

And before creating Development related certificates, first create certificates(SSL,provisioning,p12) for only production.

It really worked for me after trying different approaches.

Upvotes: 0

Glorfindel
Glorfindel

Reputation: 22631

Yes, you need a Production Profile for use with Ad-Hoc distribution; a Sandbox Profile will only work with debug builds as described here.

Upvotes: 1

Related Questions