On mobile: mergAVRequestMediaAccess "video" and androidRequestPermission "android.permission.CAMERA"

Andrew at MWCM andrew at midwestcoastmedia.com
Tue Feb 28 16:12:08 EST 2023


> 
> Date: Tue, 28 Feb 2023 10:14:37 -0500
> From: Mike Kerner <MikeKerner at roadrunner.com>
> To: How to use LiveCode <use-livecode at lists.runrev.com>
> Subject: Re: On mobile: mergAVRequestMediaAccess "video" and
> 	androidRequestPermission "android.permission.CAMERA"
> Message-ID:
> 	<CADCoycOPhyvOovpkv0GbFe3rygWALfVPwDALW=bNU3TskH4J2w at mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
> 
> this isn't an uncommon problem.
> what other apps on ios do is throw up a separate dialog that directs the
> user to Settings->Privacy and Security->whatever (in your case, both
> "Camera" and "Microphone"), and tells the user to return to try again when
> that setting is changed.

Here is a code-block with deep links that I use in an iOS app to do pretty much the same thing, except for push notifications instead of camera access after the user declines the initial acceptance pop-up. You’ll need to change the path to your specific app bundle and update the root from NOTIFICATIONS_ID to something else like CAMERA (not 100% certain):

on mouseUp
   put "To enable Push Notification Settings go to your iOS device settings..." & RETURN & RETURN &"Settings -> Indiana On Tap -> Notifications" & RETURN & RETURN & "...then select Allow Notifications." into tMessage
   answer tMessage with "Good to know" and "Take me there!"
   put it into tReply
   if tReply = "Take me there!" then
      launch url "App-Prefs:root=NOTIFICATIONS_ID&path=com.midwestcoastmedia.indianaontap" // iOS 10+
      if the result is "no association" then
         launch url "prefs:root=NOTIFCATIONS_ID&path=com.midwestcoastmedia.indianaontap" // iOS 9
      end if // the result is "no association"
   end if // tReply = "Take me there!"
end mouseUp

—Andrew Bell


More information about the use-livecode mailing list