Skip to Content
0
Jun 19, 2020 at 01:43 PM

SAP CP Mobile Service Neo: The APNS device token xxx is not valid for application com.example.App.

514 Views

Hello SAP CP Mobile Service Experts,

we're currently setting up a Native iOS App that should consume Push Notifications from the SAP ERP Backend using using the Push-to-Capability Scenario that is supported by SAP Gateway with the standard functionality Add Push for Use with SAP Mobile Platform.

In the Mobile Service cockpit (Neo) I can see that my user u4012757 registered successfully to the app com.example.App. I also see his APNS Token. The Bundle ID of our app is com.example.scheduling. The POST payload sent to https://{{server}}/restnotification/capability/ServiceOrder-zrequest is:

{
  "notification": {
    "data": "{\"NotificationId\":\"AFBWg+PzHtqsxHPM6ljg5A==\",\"Text\":\"New order 4711 Test for 18. June 2, 13:35:00 to 16:35:00\",\"NavigationTargetObject\":\"ServiceOrder\",\"NavigationTargetAction\":\"zrequest\",\"NavigationTargetParam\":[{\"Key\":\"orderno\",\"Value\":\"4711\"},{\"Key\":\"activity\",\"Value\":\"0030\"},{\"Key\":\"notification\",\"Value\":\"New order 4711 Test for 18. June 2, 13:35:00 to 16:35:00\"}],\"Actions\":[{\"ActionId\":\"AcceptOrderKey\",\"ActionText\":\"Accept\",\"BulkActionText\":\"Accept all\",\"Nature\":\"POSITIVE\"},{\"ActionId\":\"RejectOrderKey\",\"ActionText\":\"Reject\",\"BulkActionText\":\"Reject all\",\"Nature\":\"NEGATIVE\"}],\"NotificationTypeId\":\"AFBWg+PzHtqsw8qK3Dxg5A==\"}",
    "alert": "New order 4711 Test for 18. June 2, 13:35:00 to 16:35:00"
  },
  "users": [
    {
      "user": "U4012757",
      "badges": {
        "ServiceOrder-zrequest": 9
      },
      "formFactor": [
        "tablet",
        "phone"
      ]
    }
  ]
}

I get this response:

{
    "status": {
        "value": "OK",
        "code": 0
    },
    "notificationId": null,
    "results": [
        {
            "status": {
                "value": "OK",
                "code": 0
            },
            "registrationId": "36b18878a3be33e132fe1eacd189e7ff",
            "notificationId": "691f096a-d9f0-48ae-97f9-665961690b84"
        }
    ]
}

But I don't get the push notification on the device. Instead I see the following messages in the Logs:

Accepted APNS push request to application with a registration ID xxx.The APNS device token xxx is not valid for application com.example.App. The push registration is deleted and will not be used again. Please ensure that the mobile application notification configuration and mobile application are using the same APNS profile. The device must register for push again to receive notifications

What also happens is as described in the log the APNS token is removed from my users registration.

Looking forward for your help

Best regards
Gregor

cc: Michael Jess