Search code examples
cordovaionic-frameworkcross-platformcordova-plugins

Can we use Ionic 1 plugin in Cordova project


I am building a Cordova application and trying to use a plugin https://github.com/driftyco/ionic-plugin-deeplinks

But i am getting exception when i run my project. Can we use ionic plugin in crodova project?

Uncaught Error: [$injector:unpr] Unknown provider: $cordovaDeeplinksProvider <- $cordovaDeeplinks
http://errors.angularjs.org/1.5.3/$injector/unpr?p0=%24cordovaDeeplinksProvider%20%3C-%20%24cordovaDeeplinks
    at ionic.bundle.js:13443
    at ionic.bundle.js:17793
    at Object.getService [as get] (ionic.bundle.js:17946)
    at ionic.bundle.js:17798
    at getService (ionic.bundle.js:17946)
    at injectionArgs (ionic.bundle.js:17970)
    at Object.invoke (ionic.bundle.js:17992)
    at ionic.bundle.js:17808
    at forEach (ionic.bundle.js:13696)
    at createInjector (ionic.bundle.js:17808)

Solution

  • You can use this plugin only if you are Ionic framework for developing cordova apps. Ionic framework is based on AngularJS but used Cordova framework as its base.Check out this link which elaborates more about Ionic framework.

    If you are using vanilla cordova framework for app development, then you should use plugins like universal link plugin or custom URL scheme plugin to achieve this as these Ionic deep link plugin is evolved from these plugins using them as the base.

    Hope it helps. Cheers