Skip to content

Commit

Permalink
readme.md: Update Android permission documentation
Browse files Browse the repository at this point in the history
Call OnRequestPermissionsResult() of Xamarin.Essentials
instead of ZXing.Net.Mobile where it has been deprecated.

Closes Redth#915.
  • Loading branch information
radioactiveman committed Oct 18, 2020
1 parent dbc6fc0 commit 1587eed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ Xamarin.Essentials.Platform.Init(Application);
ZXing.Net.Mobile.Forms.Android.Platform.Init();
```

ZXing.Net.Mobile for Xamarin.Forms also handles the new Android permission request model for you, but you will need to add the following override implementation to your main `Activity` as well:
ZXing.Net.Mobile for Xamarin.Forms also handles the new Android permission request model for you via Xamarin.Essentials, but you will need to add the following override implementation to your main `Activity` as well:

```csharp
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults)
{
global::ZXing.Net.Mobile.Android.PermissionsHandler.OnRequestPermissionsResult (requestCode, permissions, grantResults);
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
}
```

Expand Down

0 comments on commit 1587eed

Please sign in to comment.