Not possible to send Push messages with HTTP Post triggers on Private Cloud - Forum - Mobile - Progress Community

Not possible to send Push messages with HTTP Post triggers on Private Cloud

 Forum

Not possible to send Push messages with HTTP Post triggers on Private Cloud

  • 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. 

  • Your payload should be sent immediately (the "status":"sent") should do it. If not, are there any messages in the push notification dashboard?
     
    If you schedule the message, make sure you set the useDeviceTimeZone to "false" so that it gets sent to all devices at the given time.
     
    -- peter
     
    From: bal [mailto:bounce-bal@community.progress.com]
    Sent: Sunday, 30 November, 2014 08:30
    To: TU.Mobile@community.progress.com
    Subject: RE: [Technical Users - Mobile] Not possible to send Push messages with HTTP Post triggers on Private Cloud
     
    Reply by bal

    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. 

    Stop receiving emails on this subject.

    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....

  • Hi bal,
     
    By any chance are you sending the push messages by keeping the mobile app in open state (in the device)? If yes, please follow below instructions such that the messages are sent properly to specific device from Push server.
     
    Please add following event for the mobile app and send push notifications to the mobile app (in the mobile page where push messages are to be displayed)

    alert(data.aps.alert)          

    This will show appropriate push event/message as an alert message when the specific push message is sent keeping the mobile app in open state (in device).
     
    If the app was closed in the device, then specific message should be delivered properly to the device.
     
    Hope this helps.
     
    Thanks and Regards,
    Anil Kumar.
     
    From: bal [mailto:bounce-bal@community.progress.com]
    Sent: Tuesday, December 02, 2014 5:12 PM
    To: TU.Mobile@community.progress.com
    Subject: RE: [Technical Users - Mobile] Not possible to send Push messages with HTTP Post triggers on Private Cloud
     
    Reply by bal

    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....

    Stop receiving emails on this subject.

    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