DmcSDK / cordova-plugin-mediaPicker

cordova android ios mediaPicker support selection of multiple image and video gif ✨ cordova android 和 ios 图片视频选择cordova插件,支持多图 视频 gif,ui类似微信
MIT License
139 stars 93 forks source link

How do I use this plugin in an Ionic 4 app? #79

Open ashish701ranjan opened 5 years ago

ashish701ranjan commented 5 years ago

This is my "package.json":

{
  "name": "ionic-whatsapp-mock",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ionic cordova run browser --live-reload",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "^7.2.2",
    "@angular/core": "^7.2.2",
    "@angular/forms": "^7.2.2",
    "@angular/http": "^7.2.2",
    "@angular/platform-browser": "^7.2.2",
    "@angular/platform-browser-dynamic": "^7.2.2",
    "@angular/pwa": "^0.12.4",
    "@angular/router": "^7.2.2",
    "@angular/service-worker": "^7.2.2",
    "@ionic-native/call-number": "^5.8.0",
    "@ionic-native/camera": "^5.8.0",
    "@ionic-native/contacts": "^5.8.0",
    "@ionic-native/core": "^5.0.0",
    "@ionic-native/document-viewer": "^5.9.0",
    "@ionic-native/fcm": "^5.9.0",
    "@ionic-native/file": "^5.8.0",
    "@ionic-native/file-chooser": "^5.8.0",
    "@ionic-native/file-path": "^5.9.0",
    "@ionic-native/image-picker": "^5.8.0",
    "@ionic-native/media": "^5.8.0",
    "@ionic-native/media-capture": "^5.8.0",
    "@ionic-native/photo-viewer": "^5.8.0",
    "@ionic-native/splash-screen": "^5.0.0",
    "@ionic-native/status-bar": "^5.0.0",
    "@ionic/angular": "^4.1.0",
    "@ionic/storage": "^2.2.0",
    "@ngrx/effects": "^8.0.1",
    "@ngrx/store": "^8.0.1",
    "@ngrx/store-devtools": "^8.0.1",
    "@ngx-pwa/offline": "^6.2.0",
    "angular-in-memory-web-api": "^0.8.0",
    "call-number": "^1.0.1",
    "com-sarriaroman-photoviewer": "^1.2.2",
    "cordova-android": "8.0.0",
    "cordova-browser": "6.0.0",
    "cordova-plugin-camera": "^4.0.3",
    "cordova-plugin-contacts": "^3.0.1",
    "cordova-plugin-fcm-with-dependecy-updated": "^2.4.0",
    "cordova-plugin-file": "^6.0.1",
    "cordova-plugin-filechooser": "^1.2.0",
    "cordova-plugin-filepath": "^1.5.5",
    "cordova-plugin-media": "^5.0.2",
    "cordova-plugin-media-capture": "^3.0.2",
    "cordova-plugin-mediapicker-dmcsdk": "^2.4.5",
    "cordova-plugin-telerik-imagepicker": "^2.3.2",
    "core-js": "^2.5.4",
    "faker": "^4.1.0",
    "immer": "^3.1.3",
    "mx.ferreyra.callnumber": "0.0.2",
    "rxjs": "~6.5.1",
    "tslib": "^1.9.0",
    "zone.js": "~0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.13.8",
    "@angular-devkit/build-angular": "~0.13.8",
    "@angular-devkit/core": "~7.3.8",
    "@angular-devkit/schematics": "~7.3.8",
    "@angular/cli": "~7.3.8",
    "@angular/compiler": "~7.2.2",
    "@angular/compiler-cli": "~7.2.2",
    "@angular/language-service": "~7.2.2",
    "@ionic/angular-toolkit": "~1.5.1",
    "@ionic/lab": "^2.0.5",
    "@types/faker": "^4.1.5",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~12.0.0",
    "codelyzer": "~4.5.0",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^4.1.0",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "ionic": "^5.1.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "tslint": "~5.17.0",
    "typescript": "~3.1.6"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-contacts": {},
      "cordova-plugin-filechooser": {},
      "mx.ferreyra.callnumber": {},
      "cordova-plugin-camera": {},
      "cordova-plugin-telerik-imagepicker": {},
      "cordova-plugin-media-capture": {},
      "cordova-plugin-media": {},
      "cordova-plugin-file": {},
      "call-number": {},
      "com-sarriaroman-photoviewer": {},
      "cordova-plugin-fcm-with-dependecy-updated": {},
      "cordova-plugin-document-viewer": {},
      "cordova-plugin-filepath": {}
    },
    "platforms": [
      "browser",
      "android"
    ]
  }
}

I could not find a way to include the files as:

<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>

I believe there is no Ionic-native wrapper for this. I am trying to use this plugin as an alternative of ImagePicker plugin. I have tried with declare var MediaPicker: any; But this gives a Reference error for MediaPicker not defined when I use it in my functions. I also tried inspecting the window to see any reference of MediaPicker but could not see any. Can you please help me with this?

DmcSDK commented 5 years ago

"cordova-plugin-media": "^5.0.2", "cordova-plugin-media-capture": "^3.0.2", "cordova-plugin-mediapicker-dmcsdk": "^2.4.5", "cordova-plugin-telerik-imagepicker": "^2.3.2", Maybe these are conflicting,you can try remove other plugin =》try run

tamsel12 commented 4 years ago

"cordova-plugin-media": "^5.0.2", "cordova-plugin-media-capture": "^3.0.2", "cordova-plugin-mediapicker-dmcsdk": "^2.4.5", "cordova-plugin-telerik-imagepicker": "^2.3.2", Maybe these are conflicting,you can try remove other plugin =》try run

@DmcSDK i have tried this , But not able to import . Could you share import statement for this

DmcSDK commented 4 years ago

@tamsel12 try remove this plugin cordova-plugin-telerik-imagepicker

tamsel12 commented 4 years ago

@DmcSDK I reomved all the plugins that you have mentioned above but am not able to import the plugin

08Thug commented 4 years ago

i've also stuck with this issue @DmcSDK @tamsel12 @

DmcSDK commented 4 years ago

@ashish701ranjan @tamsel12 @08Thug is there no error log?

tamsel12 commented 4 years ago

@DmcSDK yes , Not able to import

vkyeswa commented 3 years ago

@tamsel12 are you using capacitor?, coz i managed to use it there