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

GPRD: coding it correctly #115

Closed AngeloLazzari closed 5 years ago

AngeloLazzari commented 5 years ago

Hi, as i read in this documentation here i coded as follow:

IN MY App.xaml.cs i put:

// IF THE USER DOESn'T ALREADY GIVE THE PERMISSIONS if (OneSignal.Current.RequiresUserPrivacyConsent() == true) //DELAY THE INITIALIZATION TILL THE USER CANNOT GIVE HIS PERMISSION OneSignal.Current.SetRequiresUserPrivacyConsent(true);

OneSignal.Current.StartInit("XXXXXXXXXXXXXX").EndInit();

do i need to code it into the Android project too or it is OK like that?

Managing the Permission on my own, do i have to put the to ask the user the permission?

Thank you very much Angelo

jkasten2 commented 5 years ago

@AngeloLazzari If App.xaml.cs is used by both iOS and Android then you don't need add anything specifically for Android.

You will need to provide a privacy policy for the user to read and then only call OneSignal.Current.UserDidProvidePrivacyConsent(true); after they have accepted it. You only need to call UserDidProvidePrivacyConsent once, the OneSignal SDK will remember their answer when the app is reopened.

AngeloLazzari commented 5 years ago

ok thank you! Angelo