Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Notification when phone is closed/screen turned of #436

Open
Light407 opened this issue Nov 21, 2024 · 2 comments
Open

Android Notification when phone is closed/screen turned of #436

Light407 opened this issue Nov 21, 2024 · 2 comments

Comments

@Light407
Copy link

Light407 commented Nov 21, 2024

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

@google-oss-bot
Copy link

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.

@alexeygritsenko
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants