gpt4 book ai didi

javascript - 如何使用 native react 打开日历应用程序

转载 作者:行者123 更新时间:2023-11-28 12:14:36 28 4
gpt4 key购买 nike

我需要使用我的 React Native 应用程序打开谷歌日历。我可以使用链接在浏览器中打开网站。但我找不到打开 Google 日历的方法。

这是我尝试过的。我需要修改AndroidManifest.xml吗?

<TouchableOpacity
style={[mainStyle.dashboardGridItem, mainStyle.gridTwo]}
onPress={() => Linking.openURL('calendar://app')}
>
<FastImage
resizeMode={FastImage.resizeMode.contain}
style={mainStyle.dashboardGridIcon}
source={calendarIcon}
/>
</TouchableOpacity>

最佳答案

试试这个

if(Platform.OS === 'ios') {
Linking.openURL('calshow:');
} else if(Platform.OS === 'android') {
Linking.openURL('content://com.android.calendar/time/');
}

关于javascript - 如何使用 native react 打开日历应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52272944/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com