Closed thomiel closed 4 years ago
+1 here. want to get rid of those in-app notifications. could not find the reference. shall downgrading bring up them back?
Found. You can implement that like:
OneSignal.Current.StartInit("YOUR_ONESIGNAL_APP_ID") .Settings(new Dictionary<string, bool>() { { Com.OneSignal.Abstractions.IOSSettings.kOSSettingsKeyAutoPrompt, false }, { Com.OneSignal.Abstractions.IOSSettings.kOSSettingsKeyInAppLaunchURL, false } }) .InFocusDisplaying(OSInFocusDisplayOption.Notification) .EndInit();
Cheers! I leave this open as a reminder to update the guide on the OneSignal website.
Howdy, Yes we will update the documentation with the correct method.
Should be like this
private void PrepareOneSignal()
{
//Remove this method to stop OneSignal Debugging
OneSignal.Current.SetLogLevel(Com.OneSignal.Abstractions.LOG_LEVEL.VERBOSE, Com.OneSignal.Abstractions.LOG_LEVEL.NONE);
OneSignal.Current.StartInit("YOUR_ONESIGNAL_APP_ID")
.Settings(new Dictionary<string, bool>() {
{ IOSSettings.kOSSettingsKeyAutoPrompt, false },
{ IOSSettings.kOSSettingsKeyInAppLaunchURL, false } })
.InFocusDisplaying(OSInFocusDisplayOption.Notification)
.EndInit();
// The promptForPushNotificationsWithUserResponse function will show the iOS push notification prompt. We recommend removing the following code and instead using an In-App Message to prompt for notification permission (See step 7)
OneSignal.Current.RegisterForPushNotifications();
}
The docs have been updated. Cheers
The docs have been updated. Cheers
They have? Because here https://documentation.onesignal.com/docs/xamarin-sdk-setup it is still wrong.
Thanks for pointing that out. We have the code in several places so we appreciate you pointing that out. Enjoy!
Description:
There is no definition of inFocusDisplayType as shown in the Xamarin.Forms sample code on https://documentation.onesignal.com/docs/xamarin-sdk-setup (section 2.1A). Where did it move. How can I access the functionality in the current version?
Environment
Using version 3.8.2 in Visuals Studio 2019 on Windows.
Steps to Reproduce Issue:
Anything else:
The sample code seems to be badly outdated. I had to correct severeal lines of code. For example, I had to change OneSignal.LOG_LEVEL.VERBOSE to Com.OneSignal.Abstractions.LOG_LEVEL.VERBOSE.
Would it be possible to update the docs? I would help Xamarin developers to quickly adapt OneSignal in their Xamarin projects, as advertised on the homepage.
This is my code: