OneSignal / OneSignal-Xamarin-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Xamarin app with OneSignal. https://onesignal.com
Other
105 stars 50 forks source link

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

Open MihaMarkic opened 1 year ago

MihaMarkic commented 1 year ago

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

robfrancis commented 1 year ago

@MihaMarkic

Did you find if this was true?

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

MihaMarkic commented 1 year ago

@robfrancis I think so. And instead of using

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

I'm using

OneSignal.Default.NotificationOpened += Globals.HandleNotificationOpened;