Software Archive
Read-only legacy content
17060 Discussions

Alerts and notifications

Michal_M_
Beginner
416 Views

Hello,

I make simple app in Intel XDK and I would need show alert and play sound when app is in background or device is locked.

I tried all possible ways, but no working.

Only this works:

navigator.notification.vibrate()
navigator.notofication.beep()

 

Can someone help me?

 

0 Kudos
3 Replies
John_H_Intel2
Employee
416 Views

You need to 'schedule' the background message with a 3rd party plugin. 

This is a plugin that I have used in the past that works well. 

https://github.com/katzer/cordova-plugin-local-notifications

0 Kudos
Michal_M_
Beginner
416 Views

Thank you for answer,

I download this cordova plugin, but not working.

I installed plugin by this tutorial --> https://software.intel.com/en-us/xdk/docs/adding-third-party-plugins-to-your-xdk-cordova-app 

I used Local Plugin Import.

Should I use some special directory to extract plugin?

Should I write something somewhere?

 

 

0 Kudos
Anusha_M_Intel1
Employee
416 Views

All you need is to include the extracted plugin within your project directory and point to its location when importing it. Call the plugin methods from your project. There is a kitchen sink sample you can refer to: https://github.com/katzer/cordova-plugin-local-notifications/wiki/11.-Samples

The sample illustrates scheduling a notification, scheduling repeat notifications etc. 

0 Kudos
Reply