简体   繁体   English

将Ionic日历导出到Google日历

[英]Export Ionic calendar to google calendar

so i made a calendar app that displays a list of events on a given date using ionic2 calendar but i want to export the events to the native calendar on android. 所以我制作了一个日历应用程序,该应用程序使用ionic2日历显示给定日期的事件列表,但我想将事件导出到android上的本机日历。 is There any docs that allows me to understand on how to implement such feature? 是否有任何文档可让我了解如何实现此功能?

try using this ionic-native plugin 尝试使用此ionic-native插件

https://ionicframework.com/docs/native/calendar https://ionicframework.com/docs/native/calendar

From this github project: https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin 从这个github项目中: https : //github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin

When you import the plugin in your module, then use this way: 将插件导入模块时,请使用以下方式:

    constructor(private calendar: Calendar) { }

    yourEvent(){
//check permission on android
     this.calendar.hasReadWritePermission().then((rta)=>{
          if (!rta){
            this.calendar.requestReadWritePermission();
            return;
          }
          this.calendar.createEventInteractively(title,location,otherNotes,startDate,endDate).then(
            (msg) => { console.log("msg "+JSON.stringify(msg)); },
            (err) => { console.log("err "+err); }


    );
    });
}

Hope it helps! 希望能帮助到你!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM