katzer / cordova-plugin-app-event

Cordova App-Event Plugin
Apache License 2.0
26 stars 23 forks source link

Plugin crashes when using with cordova-email-plugin #3

Closed blablapolicja closed 8 years ago

blablapolicja commented 8 years ago

plugin crashes when I call cordova.plugins.email.isAvailable() or cordova.plugins.email.open()

2016-01-07 14 53 45

my code:

$scope.goToStatistics = function (){
    if (window.cordova) {
        cordova.plugins.email.isAvailable(function (isAvailable) {
            console.log(isAvailable);
        });
    }
};

I tried to wrap it in $ionicPlatform.ready(), but nothing changed Everything is ok, when I put plugin method in app.run()

.run(function ($ionicPlatform) {
    $ionicPlatform.ready(function() {
        cordova.plugins.email.isAvailable(function (isAvailable) {
            console.log(isAvailable);
        });
    });
})

Ionic 1.2.1 Cordova 5.4.1 cordova-ios 4.0.1 cordova-plugin-app-event 1.1.0 cordova-plugin-email 1.1.0

zfoltin commented 8 years ago

This plugin also causes issues when used with https://github.com/whiteoctober/cordova-plugin-app-version pluginInitialize is not implemented there and since the plugin name does not start with 'CDV' https://github.com/katzer/cordova-plugin-app-event/blob/master/src/ios/CDVPlugin%2BAPPAppEvent.m#L42 it insists on calling orig_pluginInitialize https://github.com/katzer/cordova-plugin-app-event/blob/master/src/ios/CDVPlugin%2BAPPAppEvent.m#L57 regardless if it's implemented or not.

zfoltin commented 8 years ago

Probably duplicate of https://github.com/katzer/cordova-plugin-app-event/issues/1

katzer commented 8 years ago

Fixed with v1.2.0