Software Archive
Read-only legacy content
17060 Discussões

Alerts and notifications

Michal_M_
Principiante
883 Visualizações

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 Respostas
John_H_Intel2
Funcionário
883 Visualizações

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

Michal_M_
Principiante
883 Visualizações

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?

 

 

Anusha_M_Intel1
Funcionário
883 Visualizações

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. 

Responder