Skip to content

Permissions FAQ

1. What interfaces do mini-apps need to use to get permissions?

In the native pages of the PhizClip, the following interfaces can be used to obtain the corresponding permissions.

1.1 iOS side

  • Camera permission: QR code scanning interface (scanCode), select image interface (chooseImage) for taking pictures, select video interface (chooseVideo) for recording videos, Camera component (CameraContext).
  • Album read permission: select image interface (chooseImage) to read album images, select video interface (chooseVideo) to read album videos.
  • Album write permission: save image to album (saveImageToPhotosAlbum), save video to album (saveVideoToPhotosAlbum).
  • microphone permission: record interface (startRecord), select video interface (chooseVideo) video recording, Camera component (CameraContext).
  • Geolocation permissions: get geolocation interface (getLocation), choose geolocation interface (chooseLocation), use map to view location (openLocation), open POI list to choose location (choosePoi), Map component.
  • Bluetooth permissions: Bluetooth-general, Bluetooth-low-power central device, Bluetooth-low-power peripheral device, Bluetooth-beacon and a series of api
  • Background audio playback: BackgroundAudioManager background playback audio capabilities, the user needs to add background Modes at target-capabilities and check the `audio,AirPlay,and

1.2 Android side

  • Camera permissions: QR code scanning interface (scanCode), select image interface (chooseImage) to take pictures, select video interface (chooseVideo) to record videos.
  • Microphone permissions: recording interface (startRecord).
  • storage permission: choose file interface (chooseMessageFile), choose image interface (chooseImage) to select from album, choose video interface (chooseVideo) to select from album.
  • geolocation permissions: get geolocation interface (getLocation), choose geolocation interface (chooseLocation).

1.3 Detailed interface documentation

2. What interfaces do I need to use to get permissions on HTML5 pages?

In the HTML5 page of the PhizClip, the following interfaces can be used to obtain the corresponding permissions.

2.1 iOS side

  • Camera permission: choose the image interface (pz.miniProgram.chooseImage) to take pictures
  • Album permission: select the image interface (pz.miniProgram.chooseImage) to choose from the album

2.2 Android side

  • Camera permission: select the image interface (pz.miniProgram.chooseImage) to take a picture
  • Storage permission: select the image interface (pz.miniProgram.chooseImage) to select from the album

Currently the permission-related JSSDK only supports the interface (pz.miniProgram.chooseImage)

2.3 Detailed interface documentation

3. What message will be returned if I fail to get permission? And what should I do?

There are two cases for failure to obtain permissions.

  1. firstly, in the SDK, it is supported to set the SDK to prohibit to obtain permission from APP actively, after setting, the SDK will prohibit the PhizClip to call the interface to obtain permission actively.
  2. second, if the user is not authorized, the call api failure will be executed fail callback method, return res, in the res of the errMsg contains the reason for failure (such as chooseImage:fail unauthorized).

For the above two cases of not getting permission, both the PhizClip page and H5 page need to implement their own pop-up windows according to the failure information returned by the callback, prompting the user to open the corresponding permission, for example, in the callback found that there is no camera or album permission information for fail, a pop-up window should be added to the page, such as "Please allow the APP to access your Please allow the app to access your camera or album permissions in the system".