Intercom & Recording Permissions
During IPC panel development, features like intercom, recording, and screenshot require explicit user permissions:
- Intercom: Microphone permission (
scope.record) - Recording/Screenshot: Storage/Photos permission (
scope.writePhotosAlbum)
Background
- When invoking permission-required features for the first time on iOS or Android, the system will show a permission popup where users can allow or deny access.
- ⚠️ If the user denies permission, the system will not show the popup again automatically, and existing APIs cannot trigger it. Calling permission-related APIs will fail, so developers must guide users to manually enable permissions in system settings.
Recommended Solution
1. Intercom Feature
Enable Intercom
- Check the microphone permission status (
ty.authorizeStatus) - If it returns
fail→ permission has never been requested → callty.authorizeto request permission - If
ty.authorizealso returnsfail→ user previously denied → show a custom modal guiding the user to system settings - If success → permission granted → call intercom directly
Example Code
2. Recording & Screenshot Feature
Enable Recording or Screenshot
- Check storage/photos permission status (
ty.authorizeStatus) - If it returns (
fail) → permission has never been requested → call (ty.authorize) - If (
ty.authorize) returns (fail) → user previously denied → guide the user to manually enable it in system settings - If it returns (
success) → permission granted → recording or screenshot can be used directly
💡 Note: After starting recording, wait at least 3 seconds before stopping; otherwise, errors may likely occur
Example Code