HH88
HH88

Reputation: 39

iPhone not receiving push notifications

It's been now 1 week that I am facing this problem. I'm trying to get the push notification service to work on my app in 3 different ways. Here are the steps I followed (I suppose registration for a developer account, creation of the app id and generation of the push certificate are done):

Retrieve the device token.

Insert the aps_developer_identity.cer into the PushMeBaby app under Resources.

Copy paste the device token with spaces (also tried without spaces) into self.deviceToken

Copy paste aps_developer_identity into self.certificate

When running the app, I get asked to allow the use of the private key, here is the output I have :

2012-02-01 15:10:44.464 PushMeBaby[21219:903] MakeServerConnection(): 0

2012-02-01 15:10:44.482 PushMeBaby[21219:903] SSLNewContext(): 0

2012-02-01 15:10:44.486 PushMeBaby[21219:903] SSLSetIOFuncs(): 0

2012-02-01 15:10:44.488 PushMeBaby[21219:903] SSLSetConnection(): 0

2012-02-01 15:10:44.490 PushMeBaby[21219:903] SSLSetPeerDomainName(): 0

2012-02-01 15:10:44.492 PushMeBaby[21219:903] SecKeychainOpen(): 0

2012-02-01 15:10:44.493 PushMeBaby[21219:903] SecCertificateCreateFromData(): 0

2012-02-01 15:10:44.504 PushMeBaby[21219:903] SecIdentityCreateWithCertificate(): 0

2012-02-01 15:10:44.505 PushMeBaby[21219:903] SSLSetCertificate(): 0

2012-02-01 15:11:12.420 PushMeBaby[21219:903] SSLHandshake(): 0

Then when I press "push" :

2012-02-01 15:11:26.767 PushMeBaby[21219:903] SSLWrite(): 0 78

and "push" again :

2012-02-01 15:11:38.668 PushMeBaby[21219:903] SSLWrite(): 0 78

The value of the variable "processed" doesn't change ! And of course I do not get any push notification on my iPhone.

Download the needed libraries form the website http://code.google.com/p/javapns/wiki/GeneralRequirements

Generate a .p12 file exporting the push certificate and the private key associated to it.

Copy paste the java code

import javapns.Push;

 public class PushTest {


  public static void main(String[] args) {

            Push.alert("Hello World!", "keystore.p12", "keystore_password", false, "My token");
  }

}

into a java class, replacing the device token with the right device token without spaces, adding the .p12 file and the right password.

Debugging the project allows me to see this message :

Transmitted: device token My device token

But no notification into my iPhone ! When changing the device token I have a "invalid device token" message

Followed the steps here

Got the messages :

Connected to APNS

Message successfully delivered

But didn't get any notification on my iPhone either !

Would you guys have any idea on what went wrong ? Could it be a problem with the provisioning profile ? But then would I be able to retrieve the device token ? I saw in some previous questions something related to the date setting so I added this in the php script and my iPhone is set to automatically set the date parameters. I think I tried also quitting the app, but nothing did. I did something unusual, which is using the app id for 2 different apps, I'm now just wild guessing since I don't know where to look. Any help would be much appreciated. Thanks

Upvotes: 0

Views: 2540

Answers (1)

HH88
HH88

Reputation: 39

It was actually an error from the IT team which generated the wrong SSL push certificate !

And the value of the variable "processed" mentioned in the question is related to the number of characters in the payload.

Upvotes: 2

Related Questions