How to turn on notifications? - android

I created an android app and set up a push notification which works perfectly in all android devices below marshmallow. I understand that, initially the permission is disabled. I needed some features like camera, I achieved this by prompting required permission. Is there any way like this to on notification. If not how to go to notification permission giving activity programmatically
Thanks in advance

I had a similar problem but with O. Turns out that notifications from O on must be assigned to a Channel.
https://developer.android.com/training/notify-user/channels.html

Related

Device Specific Issue in Receiving Push Notification when App is killed/closed

Lenevo Mobile not receiving push notification when App is Closed/killed. I have analysed this issue for long time. Tried solutions like removing app from Optimize app List. etc. Please Help me out.
Lenovo/vivo and some other manufacturers have auto-start feature that disables most apps(except of whitelisted apps like facebook) to start in background, try giving your app permission to auto-start manually in settings

Show notification only on phone (not on Android Wear)

Is there any way to prevent a notification be shown on Android Wear device? I know it's possible by using setOngoing(true) but I don't want my notification to be ongoing.
you should call setLocalOnly(true) on the NotificationCompat.Builder.
From the documentation
Set whether or not this notification should not bridge to other
devices.
you can read more here

Cordova - Android, push notifications to lock screen?

i'm working on an app that sends push notifications to users... nothing special about that.
Special is, that my client wishes that the push notifications will be sent to the lock screen, and not only to the status bar.
I know it's a feature of Lollipop 5.0, but I have a friend with an old 4.2 Android and he receives the push notifications from the app to the lock screen somehow.
I heard it could have something to do with the androidManifest.xml file with notifications permissions and Android's window manager, but I haven't found nothing on it.
I'll appreciate any assistance or words of advice regarding it, maybe there's a way for Cordova to enable it, or maybe I don't understand Android developing well enough...
Much thanks for any help!
I have a friend with an old 4.2 Android and he receives the push notifications from the app to the lock screen somehow
Either he has a custom ROM installed that offers lockscreen notifications, or the device manufacturer itself implemented some equivalent of lockscreen notifications. There is no means for you, as an app developer, to put notifications on the lockscreen prior to Android 5.0.
You can implement a lockscreen app widget (in Java, probably not via Cordova) and display information that way, and that will work on 4.2 through 4.4.

How to know if show notification is enabled or disabled, if yes how to access it on Android 4.4+ devices?

Is there a way to find if the "Show notification" for app is enabled or disabled?
I have a requirement where I need to check and enable or disable notifications.
When you see the details of the any app, example in the link
http://www.trickyways.com/wp-content/uploads/2014/05/show-notifications-disabled.png
there is an option to disable notifications. Is there any function or method in Android with which I can extract this
I have seen articles that it can't be done for 4.0, wondering if there is any update for 4.4 and above
The solution is for API Level >= 18.
You can include NotificationListenerService in your project which allows you to listen to all the Notifications that are posted on the phone.
So whenever your application posts a new notification NotificationListenerService will get a callback. So, if you are posting a notification and NotificationListenerService is not getting a callback, it means user has blocked the notifications for your application.
Note that user needs to explicitly grant your application Notification Access Permission in order for your application to access the notifications.

Creating Wearable notifications without the builder?

Is it possible to create wearable notifications without using the notification builder?
I already create a notification via new Notification on newer devices and would like to keep that code and still add the Wearable notification to my existing one. Is this possible, or is everything connected to the builder helper class for now?
It seems that there is no WearableNotifications.Builder class anymore in the newest SDK.
But you need to do nothing to simply let your Notification show on Android Wear Devices.
If you want to have a slightly better look for your Notifications you can use WearableExtender to add Android Wear specific actions, pages and layout options.
The WearableNotifications.Builder class is only needed if you want to add 'wearable extensions' to your notification. The normal notifications shown by your app are displayed also on the wearable connected to your device without any further integration work.

Categories

Resources