Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable all notification settings by default in my android app

Is there any way I can enable all notification settings by default when my app gets installed ?

Users are receiving notifications but sound is disabled by default and we need to manually enable it on the device. Not all users can do this manually. It would be great to know if there is any way we can check all these things when our app gets installed like WhatsApp or Telegram (they have everything checked by default)

enter image description here

like image 439
Captain MAD Avatar asked Feb 02 '19 05:02

Captain MAD


People also ask

Are notifications enabled by default on Android?

Android Push Notifications For Android, the notifications by default appear on the lock screen, and when the phone is unlocked, are visible as small icons on the notification bar at the top of the screen.

What is a default setting notification?

The All default settings turns on or off the default notification sound for text messages within the app. As you scroll down there are other types of notifications in Google Messages that you can control individually.

What is in app notification settings?

In-app notifications are messages that app creators can send to users within their app. They're commonly used to direct users toward points of interest to boost usage, retention, and lifetime value (LTV).


1 Answers

Try using with this below permission in AndroidManifest file

<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY"/>

and set notification priority for both below and above Oreo versions IMPORTANCE_HIGH for Oreo and above, and PRIORITY_HIGH or PRIORITY_MAX for below Oreo versions

Reference link for priority note

Priority for version below Oreo

mBuilder.setSmallIcon(R.drawable.app_logo)
            .setAutoCancel(true)
            .setContentIntent(resultPendingIntent)
            .setContentTitle(title)
            .setStyle(bigPictureStyle)
            .setSound(soundUri)
            .setPriority(NotificationCompat.PRIORITY_HIGH) // prirority here for version below Oreo
            .setWhen(System.currentTimeMillis())
            .setLargeIcon(BitmapFactory.decodeResource(mCtx.getResources(), R.drawable.app_logo))
            .setContentText(message)
            .build();

Priority for Oreo and above

Refer this link

like image 190
Naveen Kumar M Avatar answered Nov 05 '22 03:11

Naveen Kumar M