Enabling iOS push notifications for the Chat SDK | Community
Skip to main content

Enabling iOS push notifications for the Chat SDK

  • March 26, 2021
  • 11 replies
  • 0 views

This is a continuing discussion about the article Enabling iOS push notifications for the Chat SDK in the developer documentation.

11 replies

  • March 26, 2021

Our app used Token-based way to use APNs, do you support this way?


Greg29
  • March 26, 2021

Hi Song, at this time, we do not support token-based APNs. You would need to use the methods described in this article.

Greg Katechis | Developer Support and Enablement Engineer


  • March 26, 2021

Ok, now I can verify that the code was wrong, the code should be this:

- (void)userNotificationCenter:(UNUserNotificationCenter *)center

didReceiveNotificationResponse:(UNNotificationResponse *)response

         withCompletionHandler:(void (^)(void))completionHandler

{

  NSDictionary* userInfo = response.notification.request.content.userInfo;

  UIApplication* application = UIApplication.sharedApplication;

  [ZDKChat didReceiveRemoteNotification:userInfo in:application];

  completionHandler();

}

  • March 26, 2021

Hi, can anybody confirm that this code is right?

- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)())completionHandler{
[ZDKChat didReceiveRemoteNotification:userInfo in:application];
completionHandler();
}

I'm not an iOS developer (I'm making React Native app), and XCode is saying that userInfo and application are not defined, which makes sense for me, so I'm using this code:

- (void) application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo {
  [ZDKChat didReceiveRemoteNotification:userInfo in:application];
}

Am I right? the code still not working for me, but at least I'll be one step farther to make it work :)


  • March 26, 2021

Nice work, @Gabriel! This is super helpful.


  • March 29, 2021

> Hi Song, at this time, we do not support token-based APNs. You would need to use the methods described in this article.

The deadline to upgrade to the APNs provider API has been extended to March 31, 2021. APNs will no longer support the legacy binary protocol after this date.

So, push notifications become broken after 31 of March?


  • September 13, 2021

I am having an issue on iOS where i get the zd.chat.end message, but i do not get the zd.chat.msg. what would be the case in this would happen? Chat logs report as dissconnected.


Eric27
  • September 15, 2021

Hey Serban,

Is this issue for in-app notifications or device level push notifications?

Have a wonderful day!

Eric Nelson | Manager - Developer Advocacy


Eric27
  • June 13, 2022
Hey Smith,

Can you provide us more information? Info about the sdk version, code snippets of how you're handling push notifications and logs would help us to debug the issue more effectively.

Thanks!

Cow
  • September 21, 2022

I am having an issue on iOS where i get the zd.Chat.Quit message, but i do not get the zd.Chat.Msg. What will be the case in this will manifest? Chat logs record as dissconnected.


Greg29
  • September 21, 2022

Hi there! If you're looking for assistance with our mobile SDKs, could you explain a bit more about your situation following the instructions here?