79567166

Date: 2025-04-10 16:35:57
Score: 7.5 🚩
Natty:
Report link

I'm struggling with the exact same thing right now, the permission dialog only pops in the second launch. I moved my createNotificationChannel method to the top of my onCreate method in MainActivity (before asking for permissions) and it stills working only if I reopen the app. How did you solve it?

private void createNotificationChannel() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
       NotificationChannel channel = new NotificationChannel("id", "OTT", NotificationManager.IMPORTANCE_HIGH);
       channel.setDescription("Sending OTT");
       NotificationManager notificationManager = getSystemService(NotificationManager.class);
       notificationManager.createNotificationChannel(channel);
    }
}
Reasons:
  • Blacklisted phrase (1): How did you solve it
  • RegEx Blacklisted phrase (3): did you solve it
  • RegEx Blacklisted phrase (1.5): solve it?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Salvador Rodríguez Paredes