世博许可 PHONE_CALL [英] Expo Permission PHONE_CALL
本文介绍了世博许可 PHONE_CALL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hi i am trying to create a react native with expo app the main app's function is call users in an automatic way but we are not able to request PHONE_CALL permission using expo! what is the best way to call any Android permission?
The app is only Android but we don´t know how to request this permission!
Thanks for your help!
解决方案
You can use Linking.openURL
for this:
Linking.openURL('tel:123456789');
Here is an example of it in action: 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>
);
}
这篇关于世博许可 PHONE_CALL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文