-
Notifications
You must be signed in to change notification settings - Fork 29
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
About Permissions #39
Comments
Hi, I think this can be enhanced. Here is the requested permissions list: https://github.com/AndreiMisiukevich/OpenTok-Xamarin.Forms/blob/master/Lib/Xamarin.Forms.OpenTok.Android/Service/PlatformOpenTokService.cs#L23 But you can work around it now for your app if extend this class, override request permission method and put desired ones.
|
Hi, thank you for the help.
|
Did you register it |
Yes. Did exactly like this:
|
Please show me your CustomPlatformOpenTokService class |
Sure. Basically copied PlatformOpenTokService and just changed the permissions.
|
Wow) I meant just [Preserve(AllMembers = true)]
class CustomPlatformOpenTokService: PlatformOpenTokService {
private readonly string[] _requestPermissions = {
Manifest.Permission.RecordAudio,
Manifest.Permission.Internet,
Manifest.Permission.AccessNetworkState
};
public override bool CheckPermissions()
{
var activity = CrossCurrentActivity.Current.Activity;
var shouldGrantPermissions = _requestPermissions.Any(permission => ContextCompat.CheckSelfPermission(activity, permission) != (int)Permission.Granted);
if (shouldGrantPermissions)
{
ActivityCompat.RequestPermissions(activity, _requestPermissions, 0);
}
return !shouldGrantPermissions;
}
} Well if it doesn't help I need to take a look |
You can't inherit from |
Oh, you are right... Need to update it |
I'd be happy to make those adjustments, but I need to make sure it works.
Do you have an idea about this problem? Where can it be fixed? |
Yes, sure. And I will fix it today |
CrossOpenTok.Current.Permissions = OpenTokPermission.RecordAudio; |
Hi Andrei, Android iOS This is the .xaml side
|
Do you see this bug on iOS only? Or both iOS and Android |
Only Android raise the said exception. But iOS still ask for camera permissions. |
Would you like to debug the plugin?) |
Sure! |
I guess yes |
1.3.1 |
Hello Andrei, thank you for this great plugin!
I have a slight problem with the permissions.
My use case is audio only, so that I don't need camera permissions. Is there any way to prevent the app from asking the user to enable camera permissions?
Also, on Android, is there an option to not ask for local storage permissions?
I need to ask only for microphone permissions.
Thank you.
The text was updated successfully, but these errors were encountered: