简体   繁体   中英

OnsenUI: push notification

Is there any way to send a notification from the app, without using 'Push.send()' on the back-end? I have a simple app, with use a timer and when the time ends I need to notify the user if he is not using the app at that moment.

Thanks!

I think there is no way to send push notification from PhoneGap app itself.

Instead of Push Notification, you can adopt "Local Notification". In case Android, you need to use AlarmManager and NotificationManager to send notification locally.

http://developer.android.com/reference/android/app/AlarmManager.html

http://developer.android.com/reference/android/app/NotificationManager.html

However, in case PhoneGap app these native API can not be accessed from JavaScript. You need to embed PhoneGap plugin which enables JavaScript to access these native API.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM