cordova-plugin-photo-library
cordova-plugin-photo-library copied to clipboard
Support swift 4+ ?
Hi,
It seems the @objc decorator are needed for all the methods of the PhotoLibrary.swift file that need to be exposed to cordova, otherwise we get error such as "saveImage:" does not exist on "PhotoLibrary" thrown by cordova
agreed, i encountered this issue in my project today
I forked the project and add the @objc decorator before each function related to cordova command, and so far the plugin works again on my side :-)
https://github.com/nilebma/cordova-plugin-photo-library.git
If you want to test this fork, just run:
cordova plugin rm cordova-plugin-photo-library
cordova plugin add https://github.com/nilebma/cordova-plugin-photo-library.git
I don't know if they play a role regarding this issue, but these are some specs about my project:
- Ionic 4
- Cordova 8.1.2
- Cordova iOS 4.5.5
Some potentially relavant plugins:
- cordova-plugin-add-swift-support 1.7.2
- cordova-plugin-ionic-webview 2.2.3
I forked the project and add the @objc decorator before each function related to cordova command, and so far the plugin works again on my side :-)
https://github.com/nilebma/cordova-plugin-photo-library.git
If you want to test this fork, just run:
cordova plugin rm cordova-plugin-photo-librarycordova plugin add https://github.com/nilebma/cordova-plugin-photo-library.gitI don't know if they play a role regarding this issue, but these are some specs about my project:
- Ionic 4
- Cordova 8.1.2
- Cordova iOS 4.5.5
Some potentially relavant plugins:
- cordova-plugin-add-swift-support 1.7.2
- cordova-plugin-ionic-webview 2.2.3
Thank you so much! It helped me a lot. One question: I'm getting a dependency error and the plugin is not installing since I have newer swift version for it to use the swift 4 by default. In the plugin.xml of this plugin the dependecy for swift-support is <dependency id="cordova-plugin-add-swift-support" version="1.6.0"/>. Can you update it to a newer version of the plugin so the 2 can match as dependency pairs? Thank you so much for the good job!
Hi @neverstop26 . I now use the 2.0.2 version of the cordova-plugin-add-swift-support plugin in my project. Can you try to update this plugin in your project ?
Hi @nilebma. Can you make new release of your cordova-plugin-photo-library with [email protected]?
@nilebma I had to upgrade cordova-plugin-add-swift-support to 2.0.2 after upgrading cordova to 9... which breaks dependency of this plugin. Force install breaks ios build.
---edit---- Finally got it to work. sorry for the ios build break non-sense
my environments are : cordova 9.0.0 cordova ios 5.0.1 xcode 10.2.1
what I did :
cordova plugin rm cordova-plugin-photo-library
cordova plugin add [email protected]
cordova plugin add https://github.com/nilebma/cordova-plugin-photo-library.git --force
thanks a lot, nilebma!
Hi @nilebma! Can you just simply make a new release with <dependency id="cordova-plugin-add-swift-support" version="2.0.2"/> in plugin.xml as dependecy? For me the fork is working well if I manually modify the dependecy to 2.0.2! Thanks a lot!
I just accepted a PR by @neverstop26 and my repo now integrates the updated dependency. Sorry for the late answer.
Thanks @nilebma, I saw it! Also you could make a PR into the main plugin, maybe it will help others as it helped us :) Also i'm working on android video upload support - stuck on the thumbnail generating part - but it'll be available soon. I'll also will make a PR if it's ready.
I forked the project and add the @objc decorator before each function related to cordova command, and so far the plugin works again on my side :-)
https://github.com/nilebma/cordova-plugin-photo-library.git
If you want to test this fork, just run:
cordova plugin rm cordova-plugin-photo-librarycordova plugin add https://github.com/nilebma/cordova-plugin-photo-library.gitI don't know if they play a role regarding this issue, but these are some specs about my project:
- Ionic 4
- Cordova 8.1.2
- Cordova iOS 4.5.5
Some potentially relavant plugins:
- cordova-plugin-add-swift-support 1.7.2
- cordova-plugin-ionic-webview 2.2.3
thanks for your efforts. my Xcode is 10.2 and the Swift version is 4.2. when I used your solution get some errors related to the swift compiler. It is https://github.com/nilebma/cordova-plugin-photo-library.git compatible with swift v 4.2?
I forked the project and add the @objc decorator before each function related to cordova command, and so far the plugin works again on my side :-) https://github.com/nilebma/cordova-plugin-photo-library.git If you want to test this fork, just run:
cordova plugin rm cordova-plugin-photo-librarycordova plugin add https://github.com/nilebma/cordova-plugin-photo-library.gitI don't know if they play a role regarding this issue, but these are some specs about my project:
- Ionic 4
- Cordova 8.1.2
- Cordova iOS 4.5.5
Some potentially relavant plugins:
- cordova-plugin-add-swift-support 1.7.2
- cordova-plugin-ionic-webview 2.2.3
thanks for your efforts. my Xcode is 10.2 and the Swift version is 4.2. when I used your solution get some errors related to the swift compiler. It is https://github.com/nilebma/cordova-plugin-photo-library.git compatible with swift v 4.2?
I solved one of complex the errors related to the swift compiler by this solution and the other errors by the assistance of Xcode compiler after that works well.
@nilebma I had to upgrade cordova-plugin-add-swift-support to 2.0.2 after upgrading cordova to 9... which breaks dependency of this plugin. Force install breaks ios build.
---edit---- Finally got it to work. sorry for the ios build break non-sense
my environments are : cordova 9.0.0 cordova ios 5.0.1 xcode 10.2.1
what I did :
cordova plugin rm cordova-plugin-photo-library cordova plugin add [email protected] cordova plugin add https://github.com/nilebma/cordova-plugin-photo-library.git --forcethanks a lot, nilebma!
thanks a lot too