【问题标题】:How to open calendar app with react native如何使用本机反应打开日历应用程序
【发布时间】:2019-02-15 18:47:02
【问题描述】:

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

这是我尝试过的。需要修改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】:

    试试这个

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

    【讨论】:

    • 有什么方法可以在 iOS 中打开 Google 日历吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多