cordova-plugin-photo-library icon indicating copy to clipboard operation
cordova-plugin-photo-library copied to clipboard

ionic v4+Native: `photoLibrary.getLibrary()` returns undefined

Open mixuala opened this issue 6 years ago • 5 comments

I'm not sure where to log this bug, but here it is. The cordova plugin works fine, but not through Ionic Native, "@ionic-native/photo-library": "^5.0.0-beta.21"

https://github.com/ionic-team/ionic-native/issues/2785

mixuala avatar Oct 22 '18 05:10 mixuala

Same issue


Ionic:

   ionic (Ionic CLI)          : 4.1.2
   Ionic Framework            : @ionic/angular 4.0.0-beta.7
   @angular-devkit/core       : 0.7.5
   @angular-devkit/schematics : 0.7.5
   @angular/cli               : 6.1.5
   @ionic/ng-toolkit          : 1.0.7
   @ionic/schematics-angular  : 1.0.5

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic 5.2.5, cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.2.0, (and 12 other plugins)

System:

   ios-deploy : 2.0.0
   NodeJS     : v8.11.1 (/Users/A2/.nvm/versions/node/v8.11.1/bin/node)
   npm        : 6.4.1
   OS         : macOS
   Xcode      : Xcode 10.0 Build version 10A255

aintnomoreloyalty avatar Oct 31 '18 12:10 aintnomoreloyalty

for the moment, I'm using the cordova plugin directly, not through Ionic Native.

mixuala avatar Nov 18 '18 06:11 mixuala

found the problem, not sure how to get it fixed officially. But IonicNative PhotoLibrary.getLibrary() has the wrong interface.

see: https://github.com/ionic-team/ionic-native/issues/2785#issuecomment-516274668

mixuala avatar Jul 30 '19 06:07 mixuala

Somebody asked for a hack to use the cordova plugin directly, and here it is:

import { PhotoLibraryCordova } from 'cordova-plugin-photo-library/PhotoLibrary';

class MyClass {
constructor(
  protected platform: Platform,
) {
  this.platform.ready().then( () => {
      if (typeof cordova != 'undefined')
        this.photoLibraryCordova = cordova.plugins['photoLibrary'] as PhotoLibraryCordova.Plugin;
  });
}
}

mixuala avatar Oct 11 '19 05:10 mixuala

https://github.com/terikon/cordova-plugin-photo-library/issues/151#issuecomment-540918483

On Thu, Oct 10, 2019 at 9:08 PM vedangkoolkarni [email protected] wrote:

@mixuala https://github.com/mixuala would you please let us know , how you directly used the cordova plugin ? , i am unable to do the same

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/terikon/cordova-plugin-photo-library/issues/151?email_source=notifications&email_token=AHTXT3KM6F72YZAICZHYVH3QN4SLNA5CNFSM4F6LNBLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA4HBZA#issuecomment-540569828, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHTXT3P7RTD43ZJUK7PDXUDQN4SLNANCNFSM4F6LNBLA .

mixuala avatar Oct 11 '19 05:10 mixuala