Code Monkey home page Code Monkey logo

Comments (4)

argon avatar argon commented on June 12, 2024

Have you got some sample code to demonstrate this? I have never noticed it being an issue.

from node-apn.

sreuter avatar sreuter commented on June 12, 2024

My bad, I accidently overwrote notification.device in a loop ^^ Fixed that..

But that leads me to another question ;-) Is there a way to add multiple devices to a notification object or do i have to create a notification object for every device I send want to send this message?

from node-apn.

argon avatar argon commented on June 12, 2024

Semantically speaking each notification exists independently for each device so a separate object would be created for each message sent to each device. I can see why it would be useful to have that duplication code within the library and will look into it in future. Of course, pull requests are also welcome ;-)

from node-apn.

argon avatar argon commented on June 12, 2024

In v1.2.0 notifications will have a .clone(device) method to clone a notification to send to multiple devices.

var notification = new Notification();
notification.alert = "Hello";
for(keys in devices) {
    apnsConnection.sendNotification(notification.clone(devices[key]));
}

from node-apn.

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.