We have a private cloud and want to send push messages. Now we have configured https://api.mobile.rollbase.com/rest/push/msg as the Target URL.
We get the error:
{"code":"PNMN004","description":"Push API Key: AIzaSyC-I3i813MdpDN1Hb9CEd6lWklOw not found"}
This key is correct, and we are able to send it manually from the MAB dashboard. Why couldnt we do this with the Rollbase triggers on private cloud?
Hi Bal,
To send push notification from private cloud you have to use api.appdesigner.rollbase.com/.../msg as the Target instead api.mobile.rollbase.com/.../msg.
Please let me know if you need further clarification on the same.
Regards
Ajay Sharma
Got it thanks!
Another question:
Im using the following request in the trigger:
<script>
{“filter”:{“type”:{“$in”:['I','A']}},
“payload”:{“message”:“Hetllo world”},
“status”:“sent”}
</script>
Im on a different timezone compared to the api.appdesigner.rollbase.com server. I want to send the push notifications immediately. How can i do that? I have also tried with the timezone parameters, but it looks like that the messages are scheduled and the system is not sending the push notifications.
Another question:
Im using the following request in the trigger:
<script>
{“filter”:{“type”:{“$in”:['I','A']}},
“payload”:{“message”:“Hetllo world”},
“status”:“sent”}
</script>
Im on a different timezone compared to the api.appdesigner.rollbase.com server. I want to send the push notifications immediately. How can i do that? I have also tried with the timezone parameters, but it looks like that the messages are scheduled and the system is not sending the push notifications.
Flag this post as spam/abuse.
As Peter mention you need to have "status":"sent" and also you need to have "schedule":{"scheduledTime":0,"timeZone":0} mentioned it's required parameter. So when we mention "status":"sent" these parameters will be ignored and the Push Notification will be sent immediately.
Regards
Ajay
Hi,
This is the message which I've sent:
<code>
{'filter':{'type':{'$in':['A,I']},"deviceID":'358588054208766;76a15e0589a75c1a'},'payload':{"badge":'1','message':'test'},"schedule":{"scheduledTime":0,"timeZone":0,"useDeviceTimeZone":"false"},'status':'sent'}
</code>
And the response is:
<code>
[{"_id":"547ce96ee4b035ef1c28d937","count":0,"dbId":"5476157ee4b0648e1ebfbd9d","errorMessages":{},"filter":"{ \"type\" : { \"$in\" : [ \"A,I\"]} , \"deviceID\" : \"358588054208766;76a15e0589a75c1a\"}","payload":{"badge":1,"message":"test"},"schedule":{"scheduledTime":"1970-01-01 00:00:00.000","scheduledTimeInTZ":"1970-01-01 00:00:00.000","timeZone":0,"useDeviceTimeZone":false},"status":"wait"}]
</code>
I've also changed the timezone etc, but I get the: "status":"wait" as response...I can see this record scheduled on the dashboard on date 1970-01-01 00:00
Any other idea's?
Hi,
If you looking at the response it might be as "status":"wait". But if you see the status at Push Notification "Scheduled Push Notification" page the status is "Sent" & the date will be 1970-01-01 so you can ignore the date. So the push notification should get delivered to device without any issue if the status on this page is "Sent".
Please check on the device where you have the app installed. If it not working let us know.
Regards
Ajay
Hi Ajay,
I have cheched the status, but also on the scheduled push notification screen i can see the status "wait". The messages have not been delivered yet....
Flag this post as spam/abuse.
Hi Anil,
Thanks for your reply. But the messages are still getting the "wait" status. Is the message above ok, which I've sent?
Is there also a need to register the device? Normally before, i haven't done that and was able to receive push notifications from the dashboard. But now when i try it again, the push from the dashboard is not send. and get the following status:
Description: NotRegistered
Devices count: 1
.
Hi Bal,
Yes you need to register the device into push database then only it will deliver the message. Normally this registration is automatic process. I would suggest you to check if your device is registered in Push Notification database. if not then please uninstall & install the app on device again & run the app so the device get registered.
Then you try to send the Push Notification I hope it should work without any issue.
Regards
Ajay
Hi Ajay,
Thanks, i think the problem is there. I had some old records in the database, and now i have deleted them all. I have uninstalled the app and install it again, but the records are not created automatically. Am i missing something?
Hi Bal,
Few thing I would like to suggest to try:
1. Verify the Push Notification API Key which you using while making the REST Call should match to the APIKey mentioned at "MobileApp=>Push Notification=>Settings" Page on Dashboard.
2. There should be a record in Push Notification Database for that registered device. So to confirm that this record belongs to the same device where you expecting the Push Notification to get delivered. I would suggest you to delete the record & re-install the app & start the app on device & check there is new record created in database for that device.
3. I would suggest not to use "deviceID": filter in Push Notification Rest Call by this way you are sending the Push Notification to all registered devices in the database. So I would request you to try with following :
{'filter':{'type':{'$in':['A,I']}},'payload':{"badge":'1','message':'test'},"schedule":{"scheduledTime":0,"timeZone":0,"useDeviceTimeZone":"false"},'status':'sent'}
4. Also as Anil Suggested earlier please keep your app in closed state.
This way you should get see the record created on Dashboard in "Scheduled Push Notification" page.
I would also like to request you to share Push API Key so we can try sending the Push Notification form our side to check if you can receive that way.
Regards
Ajay
Hi Bal,
I think I got the issue what is the issue. Its a minor mistake you did while typing the "type" filter as ['A,I'] this should be ['A','I']. each type should be enclosed in single quotes. :)
So please use the filter sting as below :
{'filter':{"type":{"$in":['I','A']}},
"payload": {"badge": 1, "message": "1"},
"status": "sent",
"schedule": {"scheduledTime": 0, "timeZone": 0}
}
Now I think this should work without any issue.
Regards
Ajay
Hi Ajay,
Thanks for all options. But the main issue is that after deleting the record and reinstalling the app again, the database-device id remains empty. Any idea? The problem is here, i think...
My API key is: bfb212c9-5a4c-43e9-8471-6fd44e56f28c
By the way: We need to send segmented push messages (to a few device-id's). You've suggested not to use this, why? Its a customer requirement, we need to build it in this way, hope that it will work...
At the moment im testing the push messages with the dashboard. The post trigger will be step 2 :)
Hi Bal,
I suggested not to use device id just for time until we are able to send basic Push Notification. And about device id coming as empty is an issue because if device id is empty then the push will not be get delivered to device.
Can you please let us know which device you are using (Android, iOS).
Regards
Ajay
>By the way: We need to send segmented push messages (to a few device-id's). You've suggested not to use this, why? Its a customer requirement, we need to >build it in this way, hope that it will work...
You can add your own filter fields to the device database in the dashboard. You would need to populate those values via the UpdateDevice API call. See the doc at http://docs.mobile.rollbase.com/documentation/backendservices/push/ for this and also for the Filtering section (which is how you'd send messages to only certain devices).
Hth,
-- peter
Hi Ajay,
Thanks for all options. But the main issue is that after deleting the record and reinstalling the app again, the database-device id remains empty. Any idea? The problem is here, i think...
My API key is: bfb212c9-5a4c-43e9-8471-6fd44e56f28c
By the way: We need to send segmented push messages (to a few device-id's). You've suggested not to use this, why? Its a customer requirement, we need to build it in this way, hope that it will work...
Flag this post as spam/abuse.
Still having the issue. localStorage.getItem('pushNotificationDeviceID') remains empty. Very very weird...still investigating...
Got it, it was due the bug which will be solved in 3.1...The cordova_plugins.js was corrupt...Now testing the trigger..
Yes it works!!
@Ajay: it was idd a typo :)