Read camera permission for iOS in Xamarin -
i have ios app developed in xamarin. when app not have permission access microphone, if user tries access microphone app, check settings using avaudiosession.sharedinstance().requestrecordpermission (delegate(bool granted))
, display message.
now need same if app not have permission access camera. need check if permission granted camera , display message accordingly. how can this?
did checked answer? detect permission of camera in ios think that's solution looking :).
edit: here highest voted answer's code ported c#
// replace media type whatever want avauthorizationstatus authstatus = avcapturedevice.getauthorizationstatus(avmediatype.video); switch (authstatus) { case avauthorizationstatus.notdetermined: break; case avauthorizationstatus.restricted: break; case avauthorizationstatus.denied: break; case avauthorizationstatus.authorized: break; default: throw new argumentoutofrangeexception(); }
Comments
Post a Comment