Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Device camera access
Started by jhow Sep 06 2016 03:42 PM

1 reply to this topic
camera capturescreen

Best Answer InfuseDreams , 07 September 2016 - 05:25 AM

@Jhow, looks like it. Take a look at this api: https://docs.coronalabs.com/daily/api/library/media/hasSource.html

 

 

 

For media.hasSource( media.Camera ), the first boolean will only be false if the device does not have a camera, or the user has explicitly denied camera access to the app.

[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

jhow

[GLOBAL: userInfoPane.html]
jhow
  • Contributor

  • 159 posts
  • Enterprise

Is there a way to tell if our app has camera access for the device it's running on?

 

For example, in Settings in my iPad's, I can scroll to my app and enable and disable the camera. Within my app, I would like to be able to show a button if the camera is enabled and hide it if it is not enabled. Therefore, I need a way to see if the app has camera access enabled.

 

Thank you!



[TOPIC: post.html]
#2

InfuseDreams

[GLOBAL: userInfoPane.html]
InfuseDreams
  • Enthusiast

  • 76 posts
  • Enterprise

  Best Answer

@Jhow, looks like it. Take a look at this api: https://docs.coronalabs.com/daily/api/library/media/hasSource.html

 

 

 

For media.hasSource( media.Camera ), the first boolean will only be false if the device does not have a camera, or the user has explicitly denied camera access to the app.



[topic_controls]
[/topic_controls]