Search code examples
cordovaphonegap-pluginsionic-frameworkngcordova

$cordovaInstagram returns unknown Unknown Provider


I am trying to integrate the $cordovaInstagram plugin of ngCordova in my service:

.factory('ShareInstagramFactory', function($cordovaInstagram, $q) {
    var self = this;

    // Options
    var shareMessage = "Message";


    //
    // Instagram
    self.shareInstagram = function(imageData) {

        console.log("shareInstagram")

        var qInstagram = $q.defer();

        $cordovaInstagram.share(imageData, shareMessage).then(function() {
            // Worked
            qInstagram.resolve(true)
         }, function(err) {
            // Didn't work
            qInstagram.reject(err);
         });

        return qInstagram.promise;
    };

    return self;
})

However, I get the following issue

Error: $injector:unpr
Unknown Provider

https://docs.angularjs.org/error/$injector/unpr?p0=$cordovaInstagramProvider%20%3C-%20$cordovaInstagram%20%3C-%20ShareInstagramFactory

All my other ngCordova plugins work as expected.

Help!


Solution

  • I think that there is an issue into that point. I have implemented yesturday the sharewith instagram and could not make it work with ngCordova function.

    However, I made it work by using directly cordova plugin call :

    Instagram.share(canvasId, shareMsg, function(err) {
    

    Therefore, remove the ngCordova provider and replace your sharing functionnaly.