coosamatt / javapns

javapns
0 stars 0 forks source link

Notification send without receive nothing #31

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello, i'm writing from Rome and my english is poor but i try to explain my 
problem:

S.O Windows XP SP3
    Jdk 1.6.0_20
    javapns-jdk16-162.jar

I simply copy and paste your example from web and replace the token with mine.
I've enabled all log and as you can see i can send a message through ssl but on 
my device nothin appears.

Thanks in advance for your help.

Original issue reported on code.google.com by lasek1...@gmail.com on 5 Oct 2010 at 8:55

Attachments:

GoogleCodeExporter commented 8 years ago
According to your log:

10:12:35,968 DEBUG PushNotificationManager:? - Notification sent

How is your iPhone app configured?
Does the iPhone display the message when your app is not running?
 - if so, then be sure to register your app with the apns service on the phone (sorry I don't know the details)

If the iPhone doesn't get the notice, please verify that your app has enabled 
apns services via the apple dev portal.

Original comment by idbill.p...@gmail.com on 5 Oct 2010 at 3:21

GoogleCodeExporter commented 8 years ago
Thanks for your replay and my apologies  for what i'had sent to you because the 
problem was that my iphone was connected to another wifi lan that not have 
enabled port 5223.

But another question if is possible, how do you reconnect if the connection 
goes down when sending a payload ? can i put all my code in a while(true) end 
retry with "initializeConnection" as long as is ok ?

Thanks for all your attention

Original comment by lasek1...@gmail.com on 11 Oct 2010 at 8:50

GoogleCodeExporter commented 8 years ago
Thanks for your replay and my apologies  for what i'had sent to you because the 
problem was that my iphone was connected to another wifi lan that not have 
enabled port 5223.

But another question if is possible, how do you reconnect if the connection 
goes down when sending a payload ? can i put all my code in a while(true) end 
retry with "initializeConnection" as long as is ok ?

Thanks for all your attention

Original comment by lasek1...@gmail.com on 11 Oct 2010 at 8:50

GoogleCodeExporter commented 8 years ago
Interesting. I was under the assumption that apns always used the cell 
connection. Any information you provide about the port 5223 block would be 
interesting to me. (In my environment, our firewall blocks 5223, but I can 
still receive push notifications, but we have good cell service.)

As per other peoples experience, you should not maintain a connection with the 
apn service over a long period of time.  

The docs indicate 'You should also retain connections with APNs across multiple 
notifications' and 'you should batch multiple notifications in a single 
transmission over the interface'. To me this indicates they want users to batch 
notifications and send them all at once (like on a cron), and not as the 
notifications are created... But this does not specifically say that servers 
should maintain a connection over a period of time.

So in answer to the question, if you get connected... then you should send the 
notifications. If a payload fails, the javapns lib should throw an exception 
which you can catch, so the while seems redundant.

References:
http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Concept
ual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html

Original comment by idbill.p...@gmail.com on 11 Oct 2010 at 5:04

GoogleCodeExporter commented 8 years ago

Original comment by idbill.p...@gmail.com on 16 Oct 2010 at 9:34