I am attempting to use the PNS as documented. When I call the SendNotification method (oPushService:SendNotification(cMessage, iBadgeCount) ) the following error is thrown;
Does anyone know what this error means? It looks to me lie the API key is not being found. I grabbed this key from the MAB under the TAB push notifications.
Any ideas?
Hi Roger,
Yes. Push API needs to be taken from the Mobile App Builder located under 'Push Notifications' tab.
Push Notifications -> <Push Database> -> Open -> Settings -> Push API key
However, as per the error it seems there is problem with connecting to Push server.
Were you able to send push messages directly from the Mobile App Builder's Push Page?
Push Notifications -> <Push Database> -> Open -> Send push notification
- Choose type of device
- Provide badge and message and click on Send
Thanks and Regards,
Anil Kumar.
Anil,
I can send push messages from withing MAB just fine and they are received by my devices. I just verified I am using the correct api key but I still cannot send from within ABL.
I am attempting to use the PNS as documented. When I call the SendNotification method (oPushService:SendNotification(cMessage, iBadgeCount) ) the following error is thrown;
Does anyone know what this error means? It looks to me lie the API key is not being found. I grabbed this key from the MAB under the TAB push notifications.
Any ideas?
Flag this post as spam/abuse.
Hi Sanjeev,
It works great when using the correct URI.
Thanks.
Anil/Sanjeev,
I am looking in the MAB under databases. I can see the devices and there is a DeviceId. Where does this come from?I assume the mobile device but where? It does not appear to match the device.uuid. I assume this would be the deviceid used in the request when registering a device.
There is also a token as well that is in the request. I can also see a value for this in the MAB push database. Where does this come from?
Anil/Sanjeev,
I am looking in the MAB under databases. I can see the devices and there is a DeviceId. Where does this come from?I assume the mobile device but where? It does not appear to match the device.uuid. I assume this would be the deviceid used in the request when registering a device.
Flag this post as spam/abuse.
I am looking at documentation that discusses creating a registration service to register a device. The following are request parameters that need to be sent:
* type = "I" for iOS and "A" for Android
* X-Progress-App-Id - I assume this is the api key?
* token - do I have access to send this?
* deviceid - do i have access to send this?
Are core app is an on premise app.The mobile app will work against a customers server that is on premise. We would like to send push notification to the mobile app filtered by customer install. I thought I could use the token to do this but it looks like I cannot.
Roger,
Off the top of my head (my test project seems to have been migrated away :( )
X-Progress-App-Id is the guid of the project
deviceId you have to get from the device - there's an API for that you can call via a trigger.
You can add fields to the notification database of any type and use values in those as filters when calling the push notification service (the ABL classes have the capability to add generalised filtering). You would have to update the device info with those values. Probably from the device but you could send the device ID to the ABL server together with the user's login info and have the ABL do it.
The ABL push notification service (broadly-speaking) could be extended to add the device registration and management APIs, but that's not currently planned. Please add an Idea, if you're interested in that.
-- peter
Peter,
You look to be correct for the X-Progress-App-Id. If I compare that value from the notification database to that of the mobile app guid it matches.
DeviceId - what API is that. I have access to the device.uuid but that is not what is being sent. Is there documentation for this API?
Add fields to the database. That is cool so I can add whatever I want so I can filter by this.
As far as registration I was referring to more on the mobile app side so when the app initializes we would send deviceid, token, etc. and register the device in the notification database. I then would be able to sen push notifications and use any of those values to filter.
I have been toying with filter using the ABL classes. The sample from the docs works great.
ASSIGN oPayload = PushNotificationMessageBuilder
:Send(cMessage, iBadgeCount)
:IncludeDevice(cDeviceId[1])
:IncludeDevice(cDeviceId[2])
:IncludeDevice(cDeviceId[3])
:Payload.
This crashes the ABL;
ASSIGN oPayload = PushNotificationMessageBuilder
:Send(cMessage, iBadgeCount)
:AddStringFilter ("token", "7b2a2ee7a59ba5c2d452b204ff2d391e5f4936f204dc6d93ce5e998b009fa9e4", OpenEdge.Mobile.PushNotificationFilterOperandEnum:Equals )
:Payload
.
I have a call open with PTS.
> DeviceId - what API is that. I have access to the device.uuid but that is not what is being sent. Is there documentation
> for this API?
device.uuid sounds about right. I'll dig a little further to make sure that's what I thought.
> Add fields to the database. That is cool so I can add whatever I want so I can filter by this.
Ain't it :)
Well since that crash results from code I wrote, you may soon be hearing from me :) - although the AVM should never crash.
-- peter
Peter,
I do not think it is the device.uuid. That is not what is being added to the push database. I also read in phonegap docs that you cannot count on that being the same for iOS. Each time you uninstall/reinstall your app it can change. I tested that many months ago and can confirm that the uuid does change.
I sent sample code to PTS (Ken) that reproduces the crash.
Can someone clarify where the deviceID in the push notification database is coming from?
On my iPhone5 I have the following;
Phonegap reports device.UUID of 299BDA54-C30E-405D-85E5-E0AA0729AC1F (IT CHANGES EACH TIME COMPLETELY REMOVE APP AND RE-INSTALL)
iTunes reports UDID of 260e2204959df8158d0cc34067f53773eb7cbf92 (THIS SHOULD NEVER CHANGE but I do not think we have access to this value)
In push database I have a deviceID of D34011E8-DD00-428F-A9C6-B9C6200316CA (APPEARS TO STAY THE SAME EVEN AFTER ININSTALL/REINSTALL)
UUIDViewer reports UUID of FFFFFFFFBFEF6419E22A4FA690FDC54B8C577513
Also,
When you enable push notifications for your app it appears the mobile app is registering the device in the push notification database automatically. I would like to add addl fields to the PN DB as Peter mentioned and send the values during registration.
Hello Roger,
Just some quick feedback regarding UDID.
>> FFFFFFFFBFEF6419E22A4FA690FDC54B8C577513
The UDID is a 40-digit identifier.
The value that returned by UUIDViewer is not valid. It starts with FFFF.
(The API to get the UDID was deprecated for privacy reasons. Some apps were tracking users from app to app.)
You can get the UDID by using CTRL-C on Windows or Command-C on Mac on Serial Number field in iTunes.
See the following links for some screenshots: indude.com/find-iphone-udid-206
I hope this helps.
Thanks Edsel...I have seen similar articles about the UDID. Do you know what the mobile app sends to the push notification database when registering. There is a deviceID but it does not match any of the ids I have access to.
Hi Roger,
One of the engineers on the mobile project (Sergey) has the answer, I believe. See below:
-- peter
You can not see device id, in settings of your device, or in iTunes.
For retrieving Device ID, you should use cordova-push-notification plugin (https://github.com/mgcrea/cordova-push-notification).
If you want use it in application, you can see as we did in our template "Push Notification UserID Settings".
and page contains following code:
return encodeURIComponent(localStorage.pushNotificationDeviceID);
And this value passed as deviceID to collection Devices.
This is great...let me give it a try.
THANK YOU.
yeah, it looks like all I need is the encodeURIComponent(localStorage.pushNotificationDeviceID).
thanks.
yeah, it looks like all I need is the encodeURIComponent(localStorage.pushNotificationDeviceID).
thanks.
Flag this post as spam/abuse.
I may be incorrect but it appears when you create a new project this cordova-push-notification plug-in is already included in project. If I simply drop a button on a page and add the following javascript alert (localStorage.pushNotificationDeviceID); it will return undefined. My guess is because I did not enable PN under appsettings. If I then enable PN under AppSettings and rebuild project my javascript will return the deviceID.
So, as long as I enable Push Notification the localStorage.pushNotificationDeviceID will be populated.
Is this the same for the token?
Peter,
Just an FYI that template does NOT work for me. I am guessing it is for Rollbase backend. I modified the URL to the following and it works.
api.appdesigner.rollbase.com/.../reg{deviceID}
My guess is all the docs that refer to
api.mobile.rollbase.com need to be changed to api.appdesigner.rollbase.com when using OE. Either that or the template and all the docs are just wrong...not sure.
Peter,
Just an FYI that template does NOT work for me. I am guessing it is for Rollbase backend. I modified the URL to the following and it works.
api.appdesigner.rollbase.com/.../reg{deviceID}
My guess is all the docs that refer to
api.mobile.rollbase.com need to be changed to api.appdesigner.rollbase.com when using OE. Either that or the template and all the docs are just wrong...not sure.
Flag this post as spam/abuse.
Peter,
You mentioned that I can add fields to this push notification database. I have done that and created a new field called deploymentID. I then added a new request parameter called deploymentID and the field is updated in the DB. This is pretty cool!!
Thanks for the help.
The last piece to this puzzle is to allow my mobile app to control the registration process. It appears if you enable push notifications in the app that when you install the app or the first time you run the app the device is registered. Is there any way for me to NOT have this happen?
Peter,
You mentioned that I can add fields to this push notification database. I have done that and created a new field called deploymentID. I then added a new request parameter called deploymentID and the field is updated in the DB. This is pretty cool!!
Thanks for the help.
Flag this post as spam/abuse.
I will give that a try...thanks,
Peter,
That workaround works great...thanks again!!
Peter,
I am using the push plugin as you described in a prior post. This seems to work just fine. However, all of a sudden the PushInit will work but the registration fails. Is it possible the push notification servers could be down sporadically?
Is there anyway to determine in the push registration fail event why it is failing?
My app that was working fine last night will no longer register when it starts...no app changes. It just stopped working. I tried another device...same issue.
Hello Roger,
Just some quick feedback.
I wonder if the push notification server was or is unavailable due to some cloud machines being restarted based on a requirement by the infrastructure provider.
Could you contact Technical Support to check if the servers are available?
Thanks.
It appears that Amazon was doing some maintenance..response from PTS below. Should we be able to rely on the PNS being available for our customers?
"The push notification server is hosted on Amazon Web Services. This morning Amazon took down for maintenance several of the servers hosting our mobile services. This may have caused the issue you and I saw, but if it did we do not know the exact mechanism. Progress DevOps restarted the servers, and that cleared up the problem."
Hi Roger,
We will check into the server status and whether we knew about the downtime.
It appears that Amazon was doing some maintenance..response from PTS below. Should we be able to rely on the PNS being available for our customers?
"The push notification server is hosted on Amazon Web Services. This morning Amazon took down for maintenance several of the servers hosting our mobile services. This may have caused the issue you and I saw, but if it did we do not know the exact mechanism. Progress DevOps restarted the servers, and that cleared up the problem."
Flag this post as spam/abuse.
Amazon did notify people in advance & there was plenty of talk about it on various tech sites in advance (I don't have any EC2 or Pacific instances & I knew about it).
Here's Amazon's follow-up blog post which provides advice on how to avoid problems if/when reboots occur.
While Amazon did give us notice about the reboot, we were not given options on how and when the reboot will occur. Unfortunately, we had a design limitation that caused a downtime due to this uncontrolled reboot. We are modifying our deployment architecture to address the limitation right now to avoid future impact to the platform availability due to uncontrolled mass reboot of our systems.