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);
}
}