最近搜索
没有最近搜索

Gabriel
已加入2021年5月28日
·
最后活动2021年10月16日
关注
0
关注者
0
活动总数
3
投票
0
订阅
1
活动概览
标记
文章
帖子
社区评论
文章评论
活动概览
的最新活动 Gabriel
Gabriel 进行了评论,
社区评论 Developer - Zendesk SDKs
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 :)
查看评论 · 已于 2021年3月26日 发布 · Gabriel
0
关注者
0
投票
0
评论
Gabriel 进行了评论,
社区评论 Developer - Zendesk SDKs
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();
}
查看评论 · 已于 2021年3月26日 发布 · Gabriel
0
关注者
0
投票
0
评论