Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Push Messaging Not Working Again!

Is this sorted out yet?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Push Messaging Not Working Again!

We have reported this to our development team and the bug has been created in our buglog system.

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Push Messaging Not Working Again!

Thats what you said a month ago.
I am not asking if you logged it as a bug. I am asking how far are you about fixing it?

Jon Crump8733259
Posts: 0
Joined: Thu Oct 20, 2016 6:11 pm

Push Messaging Not Working Again!

I agree about the documentation being shocking!

Joni de Campos
Posts: 0
Joined: Fri Dec 11, 2015 12:21 pm

Push Messaging Not Working Again!

Hi Deon and Paul,

The problem I am having is that the iOS device is not been automatically registered in the device collection database.

It works on Android, but it does not works in iOS.

Checked and none of the Push registration success, Push registration fail or Push initialize events are being triggered ( Push notification is correctly configured in Appery).

Are you having device registration problems ?

Paul Medawar
Posts: 0
Joined: Thu Apr 03, 2014 10:55 am

Push Messaging Not Working Again!

Hi Joni,

I was having the same issues, tried lots of different things, but couldn't find the problem. As described above it was when I unchecked "push plugin 1.4.5" in App settingsCordova Plugins, and activating "push plugin 1.3.0", that everything started working. I'm now using 1.3.0 for all my apps.

Jon Crump8733259
Posts: 0
Joined: Thu Oct 20, 2016 6:11 pm

Push Messaging Not Working Again!

I'm having problems getting device registration to work via CURL and server code.
If anyone could share how they got it working? That would be great, thanks.

Joni de Campos
Posts: 0
Joined: Fri Dec 11, 2015 12:21 pm

Push Messaging Not Working Again!

Paul
This is not working for me.

John
I am trying a work around using server code, athough I am not sure how to get the token ID. For testing purpose, I am setting the token ID any value.

Step 1:

Write a registerDevice Server Code

registerDevice Server code:

//registerDevice

var url = "https://api.appery.io/rest/push/reg";

/*appID is your app code, you can get it when you do a Mobile Preview of you app. It is the code after https://appery.io/app/mobile-frame?sr... */

var appID = "XXXXXXXXXXXXXXXXXXXXXX";

// Get name from service request parameter.
var deviceID = request.get("deviceID");
var token = request.get("token");
var type = request.get("type");
var channels = request.get("channels");
var category = request.get("category");
var timeZone = request.get("timeZone");

var XHRResponse = XHR2.send("POST", url, {

"headers": {
"X-Appery-App-ID": appID,
"Content-Type": "application/json",
},
"body": {
"deviceID":deviceID,
"token":token,
"type":type,

Code: Select all

     "category":category, 
     "timeZone":timeZone 
 } 

});

Apperyio.response.success(XHRResponse.body, "application/json");

deviceID and token can be any value. You can leave channels empty.

Save and Run a test on it.

Refresh your device collection on your database to see if you get a new device registration.

Step 2:

Import the Server code to your app.

Map the localStorage.getItem('pushNotificationDeviceID') local storage variable to the deviceID parameter on the Before send Event of the service.

Image

Call the server code you imported in the device ready event on the first page of your app using the code bellow:

setTimeout(function() {
alert("pushNotificationDeviceID: " + localStorage.getItem('pushNotificationDeviceID'));
var deviceID = localStorage.getItem('pushNotificationDeviceID');

Code: Select all

registerDevice2Database.execute(); 

}, 1000);

//where registerDevice2Database is the name I gave to the deviceRegister Server imported service.

Refresh your device collection on your database of your app to see if you get a new device registered. ( It worked for me ...)

Now...the problem is to send to the device registration service the correct token, which I am assuming is being generated by Appery.

Step 3.

Try to send a message from Push Notification Tab.

Hmmm...not good ...message is sent from Push Notification tab, but device does not receive it.

I think is because we don't have the device token...

May be know Appery can help us to solve using this solution.

Your turn know Appery...

Joni de Campos
Posts: 0
Joined: Fri Dec 11, 2015 12:21 pm

Push Messaging Not Working Again!

One important information:

I am using Appery jQuery for this project
My test iPhone is a iPhone 5s with iOS 10.1.1 version

Test are done exporting the App to .ipa and deploying using https://www.diawi.com or http://testfairy.com.

So Tests are done on iOS device.

Joni de Campos
Posts: 0
Joined: Fri Dec 11, 2015 12:21 pm

Push Messaging Not Working Again!

About the token:
From Appery docs:

deviceId and token information
The deviceId and token parameters are automatically generated device-side. These values can’t be found anywhere except in the devices collection of the Appery.io database. Information about the device (including the deviceId and token parameters) where the app is installed, will be saved in the devices collection of the selected database as soon as the device is running the app.

Tested on iPhone 5 with iOS 9.3.5(13G36). Token information is being generated.

Tested on iPhone 5S with iOS 10.1.1(14B100) Token information is NOT being generated.

Using Cordova PushPlugin 1.4.5.

Return to “Issues”