jchambers / pushy

A Java library for sending APNs (iOS/macOS/Safari) push notifications
https://pushy-apns.org/
MIT License
1.8k stars 450 forks source link

Push notification payload format issue #573

Closed prakashpandey closed 6 years ago

prakashpandey commented 6 years ago

Apple supports two types of payload:

  1. Without body [Let's call it a simple payload format]
{
    "aps" : { "alert" : "Message received from Bob" },
    "acme2" : [ "bang",  "whiz" ]
}
  1. With body [Let's call it a complex payload format]
{
    "aps" : {
        "alert" : {
            "title" : "Game Request",
            "body" : "Bob wants to play poker",
            "action-loc-key" : "PLAY"
        },
        "badge" : 5
    },
    "acme1" : "bar",
    "acme2" : [ "bang",  "whiz" ]
}

When I am sending push using pushy, I am receiving push payload on my device in format 2 (i.e with the body).

My question is, How can I send push-notification to my device in according to format 1?

prakashpandey commented 6 years ago

Can you please answer this question? I have issue on production? @jchambers @eager @greenkiwi @itripn @jacobbarssbailey

jchambers commented 6 years ago

Hello!

This sounds more like a request for general support than it does like a bug report or a feature request. We generally ask people to move these kinds of questions to the Pushy mailing list because:

  1. The mailing list has a wider audience, and you're more likely to find somebody who has experience with your particular circumstances on the mailing list.
  2. Posting your question to the mailing list can help other people who are having the same problem.
  3. Because there isn't a bug to fix or a feature to add, we can't reasonably solve your problem by making any kind of engineering change.

In the meantime, I believe you'll find an answer to your question in the docs for ApnsPayloadBuilder#setPreferStringRepresentationForAlerts(boolean). In the future, I would encourage you to put more effort into reading the documentation.

Please do not open new issues for general support requests (please use the mailing list instead). Please do not repeat questions, and please do not tag individuals asking for support. Thank you for your consideration.

prakashpandey commented 6 years ago

Thank you very much for your help.