Skip to content

pushing to thousands of installations #9

Closed
@fasa23

Description

@fasa23

Im currently sending push notifications to my app from my parse-server on DigitalOcean.

I have almost 20K installations and when I send a push to all of them, it takes almost 20 min to be received on the iphone.
In my case this is awfull because I notify soccer matches and users want to know as soon as their team scores a goal.
Ive seen on the parse-server documentation that push notifications "Does not support super high throughput since it does not employ a job queue system" and im assuming the server is sending push notifications one by one and thats why my console logs every second:

"Notification transmitted to:" + device.token.
But it takes to much time to receive the notification on the iPhone, I think my token is one of the last on that loop.

I would like to know if i can modify any file to avoid the loop and send the push notification faster, Ive found a file under parse-server/node_modules/apn/examples/sending-to-multiple-devices.js where I found this function

// If you plan on sending identical paylods to many devices you can do something like this.
function pushNotificationToMany() {
    console.log("Sending the same notification each of the devices with one call to pushNotification.");
    var note = new apn.notification();
    note.setAlertText("Hello, from node-apn!");
    note.badge = 1;

    service.pushNotification(note, tokens);
}

So. Is there a way i can call to this function from cloud code? because when I use Parse.Push.send() from cloud code I assume my server is using this other function (service.on) inside sending-to-multiple-devices.js and thats why i get that log on my console each second

service.on("transmitted", function(notification, device) {
    console.log("Notification transmitted to:" + device.token.toString("hex"));
});

Im currently using no adapters to push my notifications, Ive seen OneSignal is a great option but the problem is that users who dont update the app will still be hitting parse installations records (so their subscriptions to soccer teams might be modified and I wouldnt be capable of noticing it) I would be really happy if theres an alternative in wich I dont have to implement any Push Adapter

Sorry for my english

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions