81
Views
1
Comments
Wake up lock screen on notification receive.
Question

Hi Gurus,

I am using onesignal for sending notifications to the users on my app , its working fine and sending messages successfully.

I want to receive notifications on lock screen i.e. the message should pop-up or the screen should light up so the mobile user can react to the pop-up message, etc.

I found the belwo on a forum , where can I add it on my app to affect all users when the download the app.

https://forums.xamarin.com/discussion/160726/is-it-possible-to-wake-up-the-device-so-that-the-user-can-see-a-push-notification-on-the-lock-screen

createNotification(); //your implementation

        PowerManager pm = (PowerManager)this.GetSystemService(Context.PowerService);
        bool isScreenOn =  pm.IsInteractive ; // check if screen is on
        if (!isScreenOn)
        {
            PowerManager.WakeLock wl = pm.NewWakeLock(WakeLockFlags.ScreenDim  | WakeLockFlags.AcquireCausesWakeup, "myApp:notificationLock");
            wl.Acquire(3000); //set your time in milliseconds
        }
2018-10-29 08-31-03
João Marques
 
MVP

HI Waheed,


First, I would like to recommend creating a support case in the Forge component page, in this case in the One Signal component, so component team can be notified and get back to you quickly.


Regarding the issue itself, I have used OneSignal and the notification appears on the phone when the phone is locked. Actually that's what it is shown on the example on configuring OneSignal in OutSystems documentation.

So I would recommend to see if you have set it up according to the step by step documentation above.

Can it also be that you have your phone configuration to not be disturbed and show notifications of the app you are using OneSignal? Or it may be a specific phone brand or model that is not compatible (see here)?


Kind regards,

João Marques

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.