Android Notification when phone is closed/screen turned of
We're having the problem that the notifications always gets delivered for both iOS and Android but on Android there is no sound/display/vibration when the notification is received. Oddly enough it is working on a very old Android phone we are testing with but with newer phones the notification just gets "silently" delivered i.e. shows up in the Android navbar but the user doesn't see/hear it unless opening the screen.
Could somebody somebody who has Android notifications working (with sound/vibration/screen popup) share payload/snippet of what is being sent to make this work? We're using .NET Framework 4.8
I found a few problems with this issue:
- I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
- This issue does not seem to follow the issue template. Make sure you provide all the required information.
Hi, just a guess - don't forget to grant notification permission for newer androids. Checking code in Java:
public static boolean CheckIfHaveNotificationPermission()
{
// This is only necessary for API level >= 33 (TIRAMISU)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
{
if (ContextCompat.checkSelfPermission(MyApplication.getContext(), Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED)
return false;
}
return true;
}