cancel
Showing results for 
Search instead for 
Did you mean: 

Kapsel Push notifications on iOS devices

Former Member
0 Kudos

Hi All,

We are stuck trying to send out Push notifications to iOS devices, we followed the excellent blow by Daniel Van Leeuwen and the one by Daniel Silva , but unfortunately we are not able to see any notifications on iPhones/iPads.

We are using the Apple sandbox server, the certificate and provisioning profiles are OK for our bundle ID, and network communication seems to be OK as per the following Apple page: https://support.apple.com/en-us/HT203609

The devices are successfully registered with SMP and with APNS, we get a token confirmation but unfortunately the SMP log reads:

#WARN#APNSNotificationProcessor:extractPayload# Not a json object...#null#11798#null#3#null |

it connects successfully to the Apple sandbox servers:

getApnsService# APNS server address - gateway.sandbox.push.apple.com#null#11798#null#7#null |

getApnsService# APNS server port - 2195#null#11798#null#8#null |

getApnsService# APNS feedback address - feedback.sandbox.push.apple.com#null#11798#null#9#null |getApnsService# APNS feedback port - 2196#null#11798#null#10#null |

getApnsService# APNS feedback port - 2196#null#11798#null#10#null |

and then:

#ERROR# APNSNotificationStatusListener:connectionClosed##Connection closed: 8#null#11801#null#0#null |

Is the problem related to the JSON payload we are trying to use (NB: the same payload works 100% with Android and GCM)

This is the example payload:

{

    "alert": "New Push notification",

    "data": "Test message"

}

Thanks in advance for any help you might be able to provide.

Max

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Max have you had any luck on this? I've looked for examples of valid APNS json and they all seem to require an aps dictionary similar to this. When I try that I get a 400 error from the SAP service:

{

    "aps" : { "alert" : "Message received from Bob" },

    "acme2" : [ "bang",  "whiz" ]

}

Former Member
0 Kudos

Hi Dave!

Sorry for taking so long to reply, just tried with your payload and got the same HTTP400 with "The request sent by the client was syntactically incorrect". Still looking for a valid payload for iOS.

BTW the following one works OK for Android:

{

"alert": "New Document available",

"data": "Notification to all devices registered to application",

"sound": "default"

}

Grateful if you could share any other ideas.

Thanks!

Max

Former Member
0 Kudos

Hi Max,

I've had no luck getting this to work. Unfortunately the project I am working on now does not have an SMP or HPCms license (I've been using the trial license) so I can't open an OSS message with SAP on this issue. If you have a support plan in place with SAP it might be a good idea to open a message with them.

Regards,

Dave

vfweiss
Participant
0 Kudos

The json for Android is correct for iOS as well.

Just tested it explicitly with that json (normally I have one with a badge added for our scenario and what different text)


{

"alert": "New Document available",

"data": "Notification to all devices registered to application",

"sound": "default"

}

I upped my logging to INFO and enabled trace for PUSH and it still says that thing about the json (full log including sort of succes message):


2015 12 31 08:50:44#+0100#INFO#com.sap.mobile.platform.server.notifications.apns.handler.APNSNotificationProcessor##anonymous#push-async-293####null#null#null#info#Push#null#null#683946b9-db48-4d4d-9356-14d0db42579d#null#1451544644768#null#com.sap.mobile.platform.server.notifications.apns.handler.APNSNotificationProcessor:process####### APNSProcessor processing notification...#null#116354#Notification#1451548244766000#null |

2015 12 31 08:50:44#+0100#WARN#com.sap.mobile.platform.server.notifications.apns.handler.APNSNotificationProcessor##anonymous#push-async-293####null#null#null#warn#Push#null#null#683946b9-db48-4d4d-9356-14d0db42579d#null#1451544644768#null#com.sap.mobile.platform.server.notifications.apns.handler.APNSNotificationProcessor:extractPayload# Not a json object...#null#116354#Notification#1451548244766001#null |

2015 12 31 08:50:44#+0100#INFO#com.sap.mobile.platform.server.notifications.apns.handler.APNSNotificationProcessor##anonymous#push-async-293####null#null#null#info#Push#null#null#683946b9-db48-4d4d-9356-14d0db42579d#null#1451544644769#null#com.sap.mobile.platform.server.notifications.apns.handler.APNSNotificationProcessor:process# Device token - 30eebead30e54147213a5a5e3a4073064232d9b23279c475a351570e3c1ecfca#null#116354#Notification#1451548244766002#null |

2015 12 31 08:50:46#+0100#INFO#com.sap.mobile.platform.server.notifications.apns.handler.APNSNotificationStatusListener##anonymous#push-async-293####null#null#null#info#Push#null#null#683946b9-db48-4d4d-9356-14d0db42579d#null#1451544646158#null#com.sap.mobile.platform.server.notifications.apns.handler.APNSNotificationStatusListener:messageSent#Notification to 30eebead30e54147213a5a5e3a4073064232d9b23279c475a351570e3c1ecfca sent!#null#116354#Notification#1451548244766003#null |

2015 12 31 08:50:46#+0100#INFO#com.sap.mobile.platform.server.notifications.apns.handler.APNSNotificationProcessor##anonymous#push-async-293####null#null#null#info#Push#null#null#683946b9-db48-4d4d-9356-14d0db42579d#null#1451544646159#null#com.sap.mobile.platform.server.notifications.apns.handler.APNSNotificationProcessor:process####### Push from Notnoop complete...#null#116354#Notification#1451548244766004#null |

Even though I received the notification on my device successful.

Response in the rest client:


{

  "status": null,

  "results": [

    {

      "status": {

        "value": "OK",

        "code": 0

      },

      "registrationId": "58a935ea-da3b-4d03-b730-a3fb159a5f8a"

    }

  ]

}

So should be working with that payload

Former Member
0 Kudos

Thanks Guys,


Both your answers above pushed me in the right direction, and we can confirm that the push notifications on iOS are now working!! Especially the reply from Vincent was helpful, as we were reading exactly the same log in the SMP trace, so the payload had to be the right one.

The problem was on the network side, as the Apple push servers were not able to send information back to our SMP server, while viceversa was OK, so long story short, always remember to open ports with Apple in both directions, outgoing and incoming.

Thanks again, time now to go back to SMP for some more notifications

Answers (0)