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.
