Как сохранить изображение в Галерее устройства IOS с использованием ionic 3? - PullRequest
0 голосов
/ 04 июня 2019

 let fileName = 'buildingAppImage' + Date.now() + '.jpeg';
        this.fileTransfer.download(img, (this.platform.is('android') ? this.file.externalRootDirectory + 'Download/': this.file.dataDirectory + 'Building-app-images/') + fileName).then((entry) => {
            console.log('download', entry.toURL());
            this.toast.createToast('Image downloaded successfully');
            this.dwnImg = entry.toURL();
            this.scale = temp;
            this.setZoom();
        }, err => {
            console.log(err);
            this.scale = temp;
            this.setZoom();
        })

Я пытаюсь сохранить изображение в галерее устройства ios.Я попытался использовать Cordova File Transfer, которая отлично работает для Android, но не работает для IOS.Добился успеха, но не может видеть изображение в файле или галерее в случае ios.

2019-06-04 11:25:52.003362+0530 Building-app[315:11346] -[CDVFileTransferDelegate connection:didReceiveResponse:] [Line 771] Streaming to file /var/mobile/Containers/Data/Application/[app-uuid]/Library/NoCloud/Building-app-images/buildingAppImage1559627751907.jpeg
2019-06-04 11:25:52.010234+0530 Building-app[315:11346] File Transfer Finished with response code 200
2019-06-04 11:25:52.011050+0530 Building-app[315:11346] -[CDVFileTransferDelegate connectionDidFinishLoading:] [Line 637] File Transfer Download success
2019-06-04 11:25:52.018645+0530 Building-app[315:11256] download file:///var/mobile/Containers/Data/Application/[app-uuid]/Library/NoCloud/Building-app-images/buildingAppImage1559627751907.jpeg

Я перепробовал множество модификаций версий и различных плагинов Cordova (включая Cordova-photolibrary).Любое рабочее решение будет высоко ценится.Заранее спасибо.

 "dependencies": {
    "@angular/animations": "5.2.11",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
    "@angular/forms": "5.2.11",
    "@angular/http": "5.2.11",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@ionic-native/android-permissions": "^4.20.0",
    "@ionic-native/camera": "^4.19.0",
    "@ionic-native/core": "~4.18.0",
    "@ionic-native/crop": "^4.18.0",
    "@ionic-native/device": "^4.20.0",
    "@ionic-native/diagnostic": "^4.20.0",
    "@ionic-native/file": "^4.20.0",
    "@ionic-native/file-transfer": "^4.20.0",
    "@ionic-native/network": "^4.20.0",
    "@ionic-native/photo-library": "^4.20.0",
    "@ionic-native/splash-screen": "~4.18.0",
    "@ionic-native/status-bar": "~4.18.0",
    "@ionic-native/toast": "^4.20.0",
    "@ionic/storage": "^2.2.0",
    "cordova": "^9.0.0",
    "cordova-ios": "~4.5.5",
    "cordova-plugin-add-swift-support": "^1.6.0",
    "cordova-plugin-android-permissions": "^1.0.0",
    "cordova-plugin-camera": "^4.0.3",
    "cordova-plugin-crop": "^0.4.0",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-file": "^6.0.1",
    "cordova-plugin-file-transfer": "^1.7.1",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^2.4.1",
    "cordova-plugin-network-information": "^2.0.1",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-plugin-x-toast": "^2.7.2",
    "cordova-sqlite-storage": "^2.6.0",
    "cordova.plugins.diagnostic": "^4.0.12",
    "fabric": "^2.4.6",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "ios-deploy": "^1.9.4",
    "rxjs": "5.5.11",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  }
...