博览会许可PHONE_CALL

时间:2020-02-21 23:08:46

标签: reactjs react-native expo

嗨,我正在尝试使用expo应用程序创建本机反应,主要应用程序的功能是自动呼叫用户,但我们无法使用expo请求PHONE_CALL权限!调用任何Android权限的最佳方法是什么?

该应用程序仅适用于Android,但我们不知道如何请求此权限!

感谢您的帮助!

1 个答案:

答案 0 :(得分:1)

您可以为此使用Linking.openURL

Linking.openURL('tel:123456789');

以下是实际操作的示例:https://snack.expo.io/@notbrent/ashamed-churros

import * as React from 'react';
import { Linking, Text, View } from 'react-native';

export default function App() {
  return (
    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
      <Text
        onPress={() => {
          Linking.openURL('tel:50000000');
        }}>
        Call some phone
      </Text>
    </View>
  );
}
相关问题