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

iOS Device not registering in device collection

I have setup the notification settings correctly using a iOS Push Certificate.

The iOS device is not registering.

Adnroid devices works just fine and regsitrers in the device collection when App is started.

What am I missing ?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

iOS Device not registering in device collection

Hello Joni,

We are sorry push notification is not working. We will try to help you troubleshoot this issue. Please try the steps below to troubleshoot Push Notification problem: https://docs.appery.io/docs/testandde...
Also please try to create a new empty app with this certificate to find out if the case is in the certificate or in something else.

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

iOS Device not registering in device collection

HI Evgnene, Thanks for your reply.

Made a service to send an curl command from inside editor and the registration works with this curl command. Also send the curl command from url also works and the device registration is done.

I have setup a new empty project and made all push notification settings for this new project including generating a new Apple certificate to make sure iOS setup was correct.

Device registration is not working from the iOS device.

Placed alerts in the Push initialize, Push registration success and Push registration fail events.

Also out the following code in deviceReady and Load Event

setTimeout(function() {
alert(localStorage.getItem('pushNotificationToken'));
}, 1);

None of the events above is being triggered from the iOS device ( these events works in Android devices).

The device I am testing is an iPhone 5s with iOS version 10.0.1.

I am also assuming that the pushNotificationToken is generated after the device is registered in the device collection.

Project has been shared to support through Share with support ON option.

Project name is PopupTest

What am I missing ?

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

iOS Device not registering in device collection

Hi Evgnene,

Can you take a look ?

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

iOS Device not registering in device collection

to continue your issue details from here: https://getsatisfaction.com/apperyio/...

This is looks like an issue with your Apple Push notification certificate - please check if you using the certificate for corresponding build environment: Development or Distribution (release version).

Also you should export binary file and test it on the device directly, without using any 3rd party distribution services.

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

iOS Device not registering in device collection

I have done a deep debugging on the problem.

iPhone 5 with iOS 9.3.5:

  1. Exported App as a xCode project.

  2. Attached iPhone 5 Device with iOS 9.3.5 to Xcode.

  3. Build and run from inside xCode.

  4. Got the following from Xcode debug output window:

    2016-11-06 14:12:14.101 OnFieldWorkApp[6827:6495836] Apache Cordova native platform version 3.9.1 is starting.
    2016-11-06 14:12:14.103 OnFieldWorkApp[6827:6495836] Multi-tasking - Device: YES, App: YES
    2016-11-06 14:12:14.111 OnFieldWorkApp[6827:6495836] Unlimited access to network resources
    2016-11-06 14:12:14.144 OnFieldWorkApp[6827:6495836] active
    2016-11-06 14:12:14.145 OnFieldWorkApp[6827:6495836] PushPlugin skip clear badge
    2016-11-06 14:12:14.466 OnFieldWorkApp[6827:6495836] [CDVTimer][file] 4.338026ms
    2016-11-06 14:12:32.988 OnFieldWorkApp[6827:6495836] [CDVTimer][splashscreen] 18521.890998ms
    2016-11-06 14:12:32.989 OnFieldWorkApp[6827:6495836] [CDVTimer][TotalPluginStartup] 18527.552009ms
    2016-11-06 14:12:35.461 OnFieldWorkApp[6827:6495836] Resetting plugins due to page load.
    2016-11-06 14:12:35.718 OnFieldWorkApp[6827:6495836] Finished load of: file:///var/containers/Bundle/Application/5C582FD4-699A-4142-B5ED-0523AA9D635B/OnFieldWorkApp.app/www/project/index.html
    2016-11-06 14:12:35.725 OnFieldWorkApp[6827:6495836] Resetting plugins due to page load.
    2016-11-06 14:12:36.889 OnFieldWorkApp[6827:6495836] Finished load of: file:///var/containers/Bundle/Application/5C582FD4-699A-4142-B5ED-0523AA9D635B/OnFieldWorkApp.app/www/project/app/loginScreen.html
    2016-11-06 14:12:37.253 OnFieldWorkApp[6827:6495958] Push Plugin register called
    2016-11-06 14:12:37.254 OnFieldWorkApp[6827:6495958] PushPlugin.register: setting badge to false
    2016-11-06 14:12:37.254 OnFieldWorkApp[6827:6495958] PushPlugin.register: clear badge is set to 0
    2016-11-06 14:12:37.279 OnFieldWorkApp[6827:6495836] Push Plugin register success:

    You can see that the last 4 lines the App register the PushPlugin ( PushPlugin 1.4.5), starts the Push and returns the token ID

    From the App screen message :

  5. Push Notification event is triggered.

  6. Push Registration Success event it triggered.

  7. Device is correctly registered to Database with the deviceID and token.

    iPhone 5 S with iOS 10.1.1:

    Attached iPhone 5 Device with iOS10.1.1 to Xcode.

  8. Build and run from inside xCode.

  9. Got the following from Xcode debug output window:

    2016-11-06 14:24:02.465211 OnFieldWorkApp[2075:664589] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/8CB38CD5-A150-4ECB-95E7-A292C686AB36/Library/Cookies/Cookies.binarycookies
    2016-11-06 14:24:02.593284 OnFieldWorkApp[2075:664589] Apache Cordova native platform version 3.9.1 is starting.
    2016-11-06 14:24:02.596171 OnFieldWorkApp[2075:664589] Multi-tasking - Device: YES, App: YES
    2016-11-06 14:24:02.621846 OnFieldWorkApp[2075:664589] Unlimited access to network resources
    2016-11-06 14:24:02.688046 OnFieldWorkApp[2075:664589] active
    2016-11-06 14:24:02.690253 OnFieldWorkApp[2075:664589] PushPlugin skip clear badge
    2016-11-06 14:24:03.082463 OnFieldWorkApp[2075:664589] [CDVTimer][file] 4.590988ms
    2016-11-06 14:24:04.182779 OnFieldWorkApp[2075:664589] [CDVTimer][splashscreen] 1100.075960ms
    2016-11-06 14:24:04.182964 OnFieldWorkApp[2075:664589] [CDVTimer][TotalPluginStartup] 1105.286002ms
    2016-11-06 14:24:07.123657 OnFieldWorkApp[2075:664589] Resetting plugins due to page load.
    2016-11-06 14:24:07.313974 OnFieldWorkApp[2075:664589] Finished load of: file:///var/containers/Bundle/Application/48B65810-501A-449F-A04F-B7377884B688/OnFieldWorkApp.app/www/project/index.html
    2016-11-06 14:24:07.324380 OnFieldWorkApp[2075:664589] Resetting plugins due to page load.
    2016-11-06 14:24:08.636276 OnFieldWorkApp[2075:664589] Finished load of: file:///var/containers/Bundle/Application/48B65810-501A-449F-A04F-B7377884B688/OnFieldWorkApp.app/www/project/app/loginScreen.html

    We can see that the Push Plugin is not been register in the device
    The Push Plugin does not register the device in the database and does not return any token ID.

    It is clear that the PushPlugin is not working in iOS 10.

    Found this link
    Register fail iOS 10

    https://github.com/phonegap/phonegap-...

    Please take a look.

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

iOS Device not registering in device collection

For those that are still with problems with iOS Push notifications

Please look at this topic:

https://getsatisfaction.com/apperyio/...

and watch and follow the steps in this video:

https://youtu.be/QqijXpNy9VA

The point here is that you MUST have to certificates. One for iOS Development and another for the Push Notifications. That was the mistake I was making...

Device now is been registered and iOS device ( even iOS device 10.1.1 ) is receiving the notification.

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

iOS Device not registering in device collection

It would be interesting to have a direct link for this video in the Highlight Section.

Galyna Abramovych
Site Admin
Posts: 84
Joined: Tue Mar 22, 2016 6:03 pm

iOS Device not registering in device collection

Hello Joni,

Thank you for your consideration. We will see into your suggestion and make an update.

Return to “Issues”