NativeScript / push-plugin

Contains the source code for the Push Plugin.
Apache License 2.0
123 stars 48 forks source link

Show notification on system tray when app is in foregroud #128

Open emmanuel128 opened 7 years ago

emmanuel128 commented 7 years ago

Is there a way to put a notification on tray when onMessageReceived callback is invoked?

AntonDobrev commented 7 years ago

@emmanuel128 You can achieve this for Android with a modification to the native code following the Notification Builder API - https://developer.android.com/reference/android/app/Notification.Builder.html

Example - https://github.com/NativeScript/push-plugin/blob/master/native-src/android/app/src/main/java/com/telerik/pushplugin/NotificationBuilder.java#L72

However, depending on your requirements there may be another API which you can use.

emmanuel128 commented 7 years ago

I implemented using a local notification plugin, however I would like to show the notification like WhatsApp or text messages show it

emmanuel128 commented 7 years ago

19021970_1726215104059236_1472669433_n