[英]Export Ionic calendar to google calendar
所以我制作了一個日歷應用程序,該應用程序使用ionic2日歷顯示給定日期的事件列表,但我想將事件導出到android上的本機日歷。 是否有任何文檔可讓我了解如何實現此功能?
嘗試使用此ionic-native插件
https://ionicframework.com/docs/native/calendar
從這個github項目中: https : //github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin
將插件導入模塊時,請使用以下方式:
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); }
);
});
}
希望能幫助到你!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.