samsol38 / javapns

Automatically exported from code.google.com/p/javapns
0 stars 0 forks source link

Add content-available to PushNotificationPayload #234

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

Our company has been using your library for several years already (thanks for 
that), but now we admitted that it lacks functionality of simply adding 
content-available option to apsDictionary inside PushNotificationPayload (to be 
able to send silent push notifications). 

This seems to be the method I need: 
public void addContentAvailable(int contantAvailable) throws JSONException {
    logger.debug("Adding ContentAvailable [" + contantAvailable + "]");
    this.apsDictionary.put("content-available", new Integer(1));
}
(taken from https://code.google.com/p/javapns/issues/detail?id=75 )

I saw you added this functionality specially for Newsstand, but what about 
other apps?

And yes, I found other similar issues:
https://code.google.com/p/javapns/issues/detail?id=199
https://code.google.com/p/javapns/issues/detail?id=206
...but Push.contentAvailable(...) isn't the proper option: it sends ONLY 
content-available property, while I need to send ALSO content-available 
property, along with alert, badge and sound. Besides that, this method sends 
notifications immediately, and I need to do some actions 

Hope for your understanding.

Regards, 
Sergey

Original issue reported on code.google.com by sergey.c...@themidnightcoders.com on 11 Mar 2015 at 3:46