How to add "unsupported" permission?

Please provide the following:

  1. SDK Version: 39
  2. Platforms(Android/iOS/web/all): Android (for now)

I am trying to add the permission “com.android.alarm.permission.SET_ALARM” to my app. This permission is now “supported” according to https://docs.expo.io/versions/latest/sdk/permissions.

I have tried adding it to app.json:

"android": {
  "permissions": [
    "com.android.alarm.permission.SET_ALARM"
  ]
},

I have also tried just asking in code (notice I have to cast the string since this permission is “unsupported”):

const ALARM_PERMISSION = 'com.android.alarm.permission.SET_ALARM' as PermissionType

const [permission] = usePermissions(ALARM_PERMISSION, {ask: true, get: false})

But nothing seems to work. Am I doomed to eject my otherwise simple app so that I can add this permission directly to the manifest?

EDIT:

To clarify, I am trying to use expo-intent-launcher to do the following:

IntentLauncher.startActivityAsync(ACTION_SET_ALARM)

which returns this error, hence the need for the permission:

Encountered an exception while calling native method: Exception occurred while executing exported method startActivity on module ExpoIntentLauncher: Permission Denial: starting Intent { act=android.intent.action.SET_ALARM cmp=com.google.android.deskclock/com.android.deskclock.HandleSetApiCalls } from ProcessRecord{cd38534 14798:host.exp.exponent/u0a355} (pid=14798, uid=10355) requires com.android.alarm.permission.SET_ALARM

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.