OneSignal-Xamarin-SDK icon indicating copy to clipboard operation
OneSignal-Xamarin-SDK copied to clipboard

[question]: Updating from 3.x to 4.x RegisterForPushNotifications() method

Open MihaMarkic opened this issue 1 year ago • 2 comments

How can we help?

I'm updating to 4.x and wondering whether PromptForPushNotificationsWithUserResponse() is equivalent for old RegisterForPushNotifications(). Upgrade docs doesn't mention it.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

MihaMarkic avatar Nov 04 '22 11:11 MihaMarkic

@MihaMarkic

Did you find if this was true?

OneSignal.Current.RegisterForPushNotifications() is now var result = await OneSignal.Default.PromptForPushNotificationsWithUserResponse();

robfrancis avatar Apr 05 '23 06:04 robfrancis

@robfrancis I think so. And instead of using

OneSignal.Current.StartInit(...).HandleNotificationOpened(Globals.HandleNotificationOpened)

I'm using

OneSignal.Default.NotificationOpened += Globals.HandleNotificationOpened;

MihaMarkic avatar Apr 05 '23 06:04 MihaMarkic