Git Product home page Git Product logo

Comments (5)

ExploreMqt avatar ExploreMqt commented on July 18, 2024

Can you elaborate or provide a snippet demonstrating your problem?

from apnagent.

pop42 avatar pop42 commented on July 18, 2024

This is from the documentation for apnagent

.alert (key, value)

@param{ String | Object }alertbody, string key or object of alert settings
@param{ Mixed }value(when first argument is a string)
@return{this} for chaining
Sets variables to be included in the alert dictionary for the aps portion of the payload. If you wish to set a singlular message, set the body key. You may also set any of the other values outlined in the APNS documentation and the codecs will optimize the payload format for delivery.

Allowed keys:

body
action-loc-key
loc-key
loc-args
launch-image

if you notice in the above list, title is not listed as one of the available keys.

but on this page from apple : https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html in table 5.2, you will see title is one of apple's accepted keys from alert.

I tested sending .alert({"body":"some body text", "title": "some title"}) and the body went... the title didn't.

I needed it for this project I am on, so I quickly had to change to another library (apn), but I would prefer to use apnagent if just because the documentation is so snazzy.

from apnagent.

ExploreMqt avatar ExploreMqt commented on July 18, 2024

I know I've been using it in my project, but I have to admit I may not have committed that to everyone. I'll let you know in the morning when I'm at a computer that has all my resources

from apnagent.

ExploreMqt avatar ExploreMqt commented on July 18, 2024

The complete set was committed last July ExploreMqt@00e71c3

from apnagent.

lm2343635 avatar lm2343635 commented on July 18, 2024

Not works when I use a title attribute in the alert json.

agent.createMessage()
    .device("f2bd91c92dc8de2d67ba064eddce483e5f843ed4143456c3cde46dd99fd3dbfa")
    .alert({
        "title": "Push Test",
        "body": "Hello"
    })
    .sound("default")
    .send(function (err) {
        if (err) {
            console.log("[cb] If you se me something went terribly wrong.");
        } else {
            console.log("Success");
        }
    });

from apnagent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.