- Home /
Question by
nguyenvuidanang · Apr 25, 2018 at 02:28 AM ·
notificationservices
How to hide notification from onesignal
I'm building an application that uses firebase and onesignal with client written in unity3d, the problem is that I want to receive notification but do not want it to display notifications when the app is not running. I watched the tutorial But still do not know how to prevent the display
I have code like this, but when closing the application, the phone still vibrates and the message still appears
public void Init()
{
// Enable line below to debug issues with setuping OneSignal. (logLevel, visualLogLevel)
OneSignal.SetLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE);
OneSignal.StartInit("752aef3b-5a0a-44be-8e94-f31d648cb866")
.HandleNotificationReceived(HandleNotificationReceived)
.HandleNotificationOpened(HandleNotificationOpened)
.EndInit();
OneSignal.inFocusDisplayType = OneSignal.OSInFocusDisplayOption.None;
DontDestroyOnLoad(this);
}
untitled.png
(31.5 kB)
Comment
Your answer
Follow this Question
Related Questions
Getting NotificationServices.ScheduleLocalNotification to work in Unity 0 Answers
Not able to receive notifications in all devices 0 Answers
Notification did not come after transferring time on the phone 0 Answers
Local Notifications 1 Answer
How do I process a push notification received while app is closed or in backgrounding iOS? 0 Answers