Hi, I have faced a problem with Calendar plugin in Ionic 2 Framework. I am new with it, this is my first project
Here is my configuration.
Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.2
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 3.19
Node Version: v7.4.0
Xcode version: Not installed
â@angular/coreâ: â2.2.1â,
ionic-native version: ^2.4.1
I am following the instructions: http://ionicframework.com/docs/v2/native/calendar/ to install it, and havenât any errors during instalation.
But when I tried to use this plugin I had installation error. Looks like Cordova didnât include it:
Native: tried calling Calendar.hasReadPermission, but the Calendar plugin is not installed.
Install the Calendar plugin: âionic plugin add cordova-plugin-calendarâ plugin_not_installed
Also I have tried to install several plugin from ionic-native list for testing (ĐĄall Number, Geofence) and got the same errors. But Geolocation and Camera are working for me, like described on documentation.
So here is my steps for implementation Calendar plugin:
- ionic plugin add cordova-plugin-calendar
- import {Calendar} from âionic-nativeâ;
- Calendar.createCalendar(âMyCalendarâ).then(
(msg) => { console.log(msg); },
(err) => { console.log(err); }
); - Testing it on phonegap developer app on iOS device.
- Builded .apk file, installed it on android, but with different method:
Calendar.hasReadPermission().then(
// resolved promise does not return a value
() => console.log(âCalendar Plugin Readyâ),
(err) => console.log(err)
);
Also I was a bit confused with Calendar.js, do I need to include it in index.html file in Ionic 2 (if I am using ionic-native)? As I understand from ionic documentation I do not need to include it?
Anyway I have also tried to include it in index.html, error was disappear, but the code :
Calendar.hasReadPermission().then(
// resolved promise does not return a value
() => console.log(âCalendar Plugin Readyâ),
(err) => console.log(err)
);
didnât return nothing.
So looks like I am doing something wrong, as a lot of plugins doesnât work for me, does anyone know what exactly?
Thanks all for any help.