Hi,
I am work on a gas application with back end less
I have created admin panel at web server for update a price using backend less Java script API.
The Price of gases updated .
Now I want to create Push notification for android and ios devices
because we have gas mobile app which shows current gas prices.
Whenever I update a price of gas the Push notification will generate for all aldroid and ios device.
I try the topic "Publishing a message as a push notification and
targeting specific group of devices" from back end less.
When I execute the JS code it didn’t create any push notification .
I also try to write response of push notification but it shows [object Object ] and page is continuously requesting .
That means there is a no response.
My Push notification code is as given below:
var APPLICATION_ID = "<My application ID>",
SECRET_KEY = "<MY secret key>",
VERSION = "v1"; //default application version;
Backendless.initApp(APPLICATION_ID, SECRET_KEY, VERSION);
function pushNote()
{
var channel = "Krish App",
message = "Price Updated Successfully",
pubOps = null,
deliveryOps = new DeliveryOptions({
pushPolicy: "PUSHONLY",
pushBroadcast: "ANDROID"
});
var response = Backendless.Messaging.publish( channel, message, pubOps,
deliveryOps );
document.write(response);
}
So , anybody can help me to solve this problem