Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9109825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:08:01+00:00 2026-06-17T03:08:01+00:00

I am following this tutorial to set up a push notifications >> http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12 Yet

  • 0

I am following this tutorial to set up a push notifications >> http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12

Yet push notifications do not come to my phone. The phone registers succesfully. The provider connects to apns succesfully and sends the message to the registered deviceToken. Yet no notification arives.

Tried to follow the tutorial for a second time from the begining and still the same result.

At third time I tested my ck.pem files like this

openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert ck.pem -debug

And got this return.

Verify return code: 20 (unable to get local issuer certificate)

Searched for a while on how to resolve this, yet nothing helped. I don’t know if this is why phone fails to recieve messages but it could be the case. Anybody knows how can i solve this? Or maybe other things to check ? I’v done the tutorial step by step for the third time, and don’t know what to look for. APNS doesn’t return any error-status after sending message.

Provider posting code in php>>

<?php

$deviceToken = 'c8964c75e5d404f029e2d599d094a2114d219bdb95750ae6501d6f0ce6a3c3b4';

$passphrase = 'DEADFFFF';

$message = 'Check';

////////////////////////////////////////////////////////////////////////////////

$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck.pem');
stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);

// Open a connection to the APNS server
$fp = stream_socket_client(
    'ssl://gateway.sandbox.push.apple.com:2195', $err,
    $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);

if (!$fp)
    exit("Failed to connect: $err $errstr" . PHP_EOL);

echo 'Connected to APNS' . PHP_EOL;

// Create the payload body
$body['aps'] = array(
    'alert' => $message,
    'sound' => 'default'
    );

// Encode the payload as JSON
$payload = json_encode($body);

// Build the binary notification
$msg = chr(0) . pack('n', 32) . pack('H*', $deviceToken) . pack('n', strlen($payload)) . $payload;

// Send it to the server
$result = fwrite($fp, $msg, strlen($msg));

if (!$result)
    echo 'Message not delivered' . PHP_EOL;
else
    echo 'Message successfully delivered' . PHP_EOL;

fclose($fp);

Application is in debug mode, server certificate is also for development
Running the code gives Message successfully delivered.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T03:08:02+00:00Added an answer on June 17, 2026 at 3:08 am

    Everything was fine! The development phone was jailbroken and it did not receive push notifications. On non jailbroken phone everything worked fine, so stay away from jailbroken phones in development! I’v spend a day figuring this out…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set up MongoDB following this tutorial http://www.littlelostmanuals.com/2011/09/spring-mongodb-type-safe-queries.html Everything works as expected but
I was following this tutorial: http://www.vogella.com/articles/AndroidLocationAPI/article.html --> Paragraph 6.0 Problem: My emulator runs perfectly
I'm following this tutorial for twitter4j: http://www.javacodegeeks.com/2011/10/java-twitter-client-with-twitter4j.html and I've gotten almost everything right. All
I'm following this tutorial http://www.vogella.com/articles/AndroidIntent/article.html for having some data transfered to parent activity by
I've been following this tutorial on how to create an OData service. http://www.hanselman.com/blog/CreatingAnODataAPIForStackOverflowIncludingXMLAndJSONIn30Minutes.aspx And
I'm following this tutorial http://mayurbirari.wordpress.com/2011/02/07/how-to-access-mkmapkit-in-iphone/ to set annotations on a map in my IOS
I'm following this tutorial http://blogs.msdn.com/b/astoriateam/archive/2010/07/21/odata-and-authentication-part-6-custom-basic-authentication.aspx . I need to add to the web.config :
I was following this tutorial of Sencha Touch: http://www.vimeo.com/15672696 Perfect tutorial, worked flawless. But
Ok I'm following this tutorial for a basic PHP webservice server/client setup: http://www.java-samples.com/showtutorial.php?tutorialid=1186 Now
i'm following this tutorial : http://www.developer.nokia.com/Community/Wiki/Employees_app_with_XML_parsing_and_messaging_in_WP7 I have this application that shows events in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.