Open tzafrir opened 8 years ago
@tzafrir you could use the local notification plugin to do this or alternatively just provide your own UI.
@macdonst which local notification plugin you are referring?
@macdonst But the mentioned plugin have the same behavior described above by @tzafrir . See bellow:
"The essential purpose of local notifications is to enable an application to inform its users that it has something for them — for example, a message or an upcoming appointment — when the application isn’t running in the foreground."
This text was copied from your suggest plugin repository https://github.com/katzer/cordova-plugin-local-notifications on the first paragraph.
The essential purpose
Doesn't mean it won't work on other scenarios.
Notifications scheduled through that plugin will work regardless of your app's state at the time of the trigger event (check their doc on events to know what's the trigger event about). If you schedule it (remember, scheduling to {new Date()}
is still scheduling) it when the app is on foreground, it'll still trigger.
Just checking again now that IOS10 seems to allow foreground notifications. Would it be possible to show push notifications even when the application is running in the foreground ?
This would be great. as cordova-plugin-local-notifications
doesn't have foreground notifications that are expanded, ie. not only the icon at the top (as far I could find)
Any news about this?
Just a note that phonegap-plugin-local-notifications / cordova-plugin-local-notifications doesn't play nice with phonegap-plugin-push.
I would also like to see a feature built into phonegap-plugin-push to display local notifications, as presently I can't find any reliable way to achieve this due to the incompatibility. I also tried another local notification plugin which also didn't work with phonegap-plugin-push. :(
(Android platform, maybe relevant to other platforms too?)
Use case: In-app chat screen. I'd like to show notifications to the user when new messages come in, but not when the user is currently in the chat screen.
Similar behavior can be seen in Whatsapp, Google Hangouts, etc.
From what I gather, the "forcePush" setting is global and cannot be set per push, or consult with application state to decide if to show push or not.