Vor Kurzem aufgerufene Suchen


Keine vor kurzem aufgerufene Suchen

Gabriel's Avatar

Gabriel

Beigetreten 28. Mai 2021

·

Letzte Aktivität 16. Okt. 2021

Folge ich

0

Follower

0

Gesamtaktivitäten

3

Stimmen

0

Abonnement

1

AKTIVITÄTSÜBERSICHT

Neueste Aktivität von Gabriel

Gabriel hat einen Kommentar hinterlassen

Community-Kommentar 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 :)

Kommentar anzeigen · Gepostet 26. März 2021 · Gabriel

0

Follower

0

Stimmen

0

Kommentare


Gabriel hat einen Kommentar hinterlassen

Community-Kommentar 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();

}

Kommentar anzeigen · Gepostet 26. März 2021 · Gabriel

0

Follower

0

Stimmen

0

Kommentare