I want to make an app where one user can ask for help and all other using this app will get that notification. I am using Parse.com for this as server. i am totally new to this please help me.I got registered my device by key etc. now i can send push notification from parse.com to my device.
but don't know how to make this on my device to send this to other devices?
You can create subscribe devices to different unique channel names, then you can send notification containing required payload to the device using the channel to which other device is subscribed.
//subscribing to channel
ParsePush.subscribeInBackground("Channel_Name");
//getting installed devices
ParseQuery pushQuery = ParseInstallation.getQuery();
//query for getting devices with channel name
pushQuery.whereEqualTo("channels", "Channel_Name");
ParsePush push = new ParsePush();
push.setQuery(pushQuery);
push.setMessage("Your message payload");
push.sendInBackground();
You can subscribe multiple devices to same channel, but in this case when notification is send , it will be sent to all devices subscribed to a particular channel.
For more info: https://parse.com/docs/android/guide#push-notifications
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments