TobiasBuchholz / Plugin.Firebase

Wrapper around the native Android and iOS Firebase Xamarin SDKs
MIT License
220 stars 49 forks source link

Android: The current Activity can not be detected #165

Closed gianox closed 1 year ago

gianox commented 1 year ago

"The current Activity can not be detected." happens as long as the POST_NOTIFICATIONS permission has not yet been accepted by the user. Crashes the app. If using the current workaround:

ActivityCompat.RequestPermissions(this, new[] { Android.Manifest.Permission.PostNotifications }, 0);

You still get a crash - but only on the first time starting, where the user has to accept the permission. If the user does not accept the permission, it will keep crashing the app.

image

TobiasBuchholz commented 1 year ago

I can't reproduce this behavior. Since I haven't heard from you in more than 30 days, I hope this issue is no longer affecting you. If it is, please reopen this issue and provide a sample project so that I can look into it further. Thank you!