如何用native native打开日历应用程序

问题描述 投票:0回答:1

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

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

<TouchableOpacity
  style={[mainStyle.dashboardGridItem, mainStyle.gridTwo]}
  onPress={() => Linking.openURL('calendar://app')}
>
  <FastImage
    resizeMode={FastImage.resizeMode.contain}
    style={mainStyle.dashboardGridIcon}
    source={calendarIcon}
  />
</TouchableOpacity>
javascript android react-native mobile
1个回答
4
投票

试试这个

if(Platform.OS === 'ios') {
  Linking.openURL('calshow:');
} else if(Platform.OS === 'android') { 
  Linking.openURL('content://com.android.calendar/time/');
}
© www.soinside.com 2019 - 2024. All rights reserved.