4

I have built a Trigger.io application and have been using parse for my push notifications.

I am now migrating to pushwoosh for my push notification needs, however I realise that parse uses Installation id for pushing notifications but pushwoosh uses device token.

I was unable to retrieve the device token from parse as the available function only allows me to retrieve the installtion id.

forge.parse.installationInfo(function (info) {
    //info object only stores the installation id
    forge.logging.info("installation: "+JSON.stringify(info));
});

However for pushwoosh, I require the device id from the server end to push a message to a specific device

//Notify some devices or a device:
Pushwoosh.notify_devices(message, devices, other_options)

So my question is after I migrate my the data from parse over to pushwoosh, how do I retrieve all the device token for all my old users so that I can send notification messages to the users who were using parse for notifications as well?

Zhen
  • 12,361
  • 38
  • 122
  • 199

1 Answers1

2

For Android you can get the devicetoken using the code below. Trigger.io does not have a JavaScript wrapper for the same in their API. You can build it though for your purpose.

ParseInstallation.getCurrentInstallation().saveInBackground(new SaveCallback() {
    @Override
    public void done(ParseException e) {
        String deviceToken = (String) ParseInstallation.getCurrentInstallation().get("deviceToken");
    }
});
Shivam Mathur
  • 2,543
  • 19
  • 26