Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When the app connects to service, the APNS messages subscription is performed. When So when the app is closed, the notifications are still receiveddevice will receive events notifications.

POST 

http://example.com:[port][/somecontext]/secure/subscription/

Sample of response:

XML

Content-Type  :  application/xml

<subscription>
    <username>johndoe<username>
    <deviceid>somedeviceid</deviceid>
</subscription>

JSON

Reply with “201 Created” code means that subscribing is performed successfully.

Code 400 means that specified parameters are invalid (deviceId is not to be empty, it's length should be from 5 to 150 symbols and contain only digits and letter of English alphabet).

The POST body should contain information about created subscribing. Only JSON format is received. It's required to specify the Content-Type title properly.

 

Sample of response:

JSON

Content-Type  Content-Type :  application/json

{
    "username" : "johndoe",
    "deviceid" : "somedeviceid"
}

 

Subscription cancellation

...

  • The user subscribed to events from other device;
  • Device token or registration id is changed;
  • Another user subscribed to events from this device;  
  • Subscription is cancelled manually.

DELETE 

http://example.com:[port][/somecontext]/secure/subscription/[deviceId]

Reply with “204 No Content” code means that subscribing is performed successfully.

APN message format

{

"aps" : {

...