Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local-notifications is not working on android when the screen is locked even The background mode is used #1275

Closed
TechSnake opened this issue Apr 21, 2017 · 6 comments

Comments

@TechSnake
Copy link

Everthing is almost fine except it s not working on locked black screen .When the screen is waken up it gives notification

Thank you in Advance

@rwillett
Copy link
Collaborator

Not enough information. Fill out #1188.

@TechSnake
Copy link
Author

My Environment
*The lasted version of Plugin
*Platform Android
*OS :Windows 10
*Lenova A6020a41 Android version 5.1
*Cordova version 6.5
*Installed platforms: android 6.1.2
*Plugin config :

Schelude ()
{
let time2=new Date();
              time2.setHours(11);
              time2.setMinutes(5);
              time2.setSeconds(0);

           this.localNotifications.schedule({
            id:1,
            title: "test",
            text: "Tester?",
            at: time2,
            sound: "file://assets/sound/speed_camera.mp3",
            every: "hour",
        },
}

Expected Behavior:

Normaly it should pop out when it s scheduled.

Actual Behavior:

It doesnt not pop out when the screen is locked .

Any information you need please let me know thank you in Advance

@rwillett
Copy link
Collaborator

Not enough information.

Putting latest version doesn't mean anything.

You have no callback in your schedule function.

You need to put the object in an array.

Pull out the sound.

Pull out every:

Schedule the notification for about 60 secs from now.

Test to see if it actually works with the app in place.

test to see if it works with the app in the background

Test to see if it works with the App behind a locked screen.

@TechSnake
Copy link
Author

Ok
This is the version of Plugin:"@ionic-native/local-notifications": "^3.5.0",

This is an example from wiki of local notification Plugin

cordova.plugins.notification.local.schedule({ id: 1, text: "Single Notification", sound: isAndroid ? 'file://sound.mp3' : 'file://beep.caf', data: { secret:key } });

There is no an array for a single schelude and no callback function.

I ll try what you suggest and give a feedback

Thanks for patient and attention

@rwillett
Copy link
Collaborator

rwillett commented Apr 22, 2017

Ah!

Then you are using a modified version of this plugin from Ionic. Thats why its important to fill the template in so its clear whats going on.

No idea what Ionic have done to this plugin. Suggest you raise this on their forum.

Or dump it and use this plugin.

@TechSnake
Copy link
Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants