Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ol> <li><p>Your Java code looks solid! However, don't forget to close the connection, through <code>PushNotificationManager.closeConnection()</code>. It's important to cleanup after yourself.</p> <p>As a side comment, I notice that you are adding the device 'iPhone' but querying for 'Lambo' afterwards. This is an indication of a bug.</p></li> <li><p>The device token shown in the code is incorrect. Device tokens, currently, as 32-bit long value, which gets hexed into 64 characters. I assume that the server is failing silently when pushing the notification to invalid token!</p></li> <li><p>The only way to get the device token is from the app itself. As provided by the <a href="http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW1" rel="nofollow noreferrer">Push Notification guide</a> suggests, the iPhone app needs to register for notification upon launch. In the <a href="http://developer.apple.com/IPhone/library/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIApplicationDelegate/application:didRegisterForRemoteNotificationsWithDeviceToken:" rel="nofollow noreferrer"><code>application:didRegisterForRemoteNotificationsWithDeviceToken:</code></a>, the iPhone needs to send the device token to your java provider server. (For debugging purposes, you can just <code>NSLog</code> the device token and use it; it never changes across runs).</p> <p>I would recommend that you create a server in your java provider server to receive device tokens. Set up a <code>ServerSocket</code> to receive connections from the iPhone and their device token (and any additional info you need) and insert the tokens in the database.</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload