Recent searches


No recent searches

iOS Chat v2 Push Notifications



Posted Jan 25, 2022

Hi,

I'm not able to get Push Notifications working on iOS with the Chat V2 SDK. I've followed the instructions here and here however there are still some things that aren't clear.

The `Chat.initialize()` method wants an "appId" but none of the documentation specifies exactly wha value should be provided here. I have tried using the "App ID" supplied by Zendesk from Chat > Settings > Account > API & SDKs - this is the same place I've uploaded the PEM file to. I've also tried the "App ID" from Admin > Channels > Mobile SDK which seems to be the same as Agent > Admin > Channels > Mobile SDK. Finally I have also tried using the app's Bundle Identifier (aka App ID, e.g. com.mycompany.myapp). This is a value that would be needed by Zendesk to trigger the push notification (apns-topic header). and there doesn't seem to be any other way to supply it. None of these values seem to work, neither with a Debug build (APNs Sandbox checked) nor with a Release build (APNS Sandbox unchecked).

I have verified the PEM file is valid and I am able to send & receive push notifications to my device using the same certificate & device token via cURL.

I have used a breakpoint to verify that I am calling `Chat.registerPushToken(deviceToken)` using the value returned by `application(:didRegisterForRemoteNotificationsWithDeviceToken:) app delegate method. I have verified that this occurs after initialising the Chat SDK (`Chat.initialize()`).

To test this, I am starting a chat session from the app/SDK, sending a message, then accepting the chat request from the Agent Dashboard. After sending a message or two back and forth, I close out of the chat, close the app (not force quit), and send another message from the chat. No notification is received. If I return to the app and open the Chat view controller again the session is retained and all messages appear.

What other steps could I have missed or am I doing incorrectly? Any help would be greatly appreciated. Thanks!


0

3

3 comments

image avatar

Christopher Kennedy

Zendesk Developer Advocacy

Hi Jonathon,
 
The app ID to use for initialization can be retrieved from the Chat dashboard.  Are you still encountering an issue when doing so?
 
Best,

0


Yes this App ID works now, it didn't previously but perhaps I'd done something else incorrectly when I tested it. Thank you! 

0


image avatar

Christopher Kennedy

Zendesk Developer Advocacy

No problem :)

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post