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

Support swift 4+ ?

Open Esya opened this issue 6 years ago • 12 comments

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

Esya avatar Feb 01 '19 16:02 Esya

agreed, i encountered this issue in my project today

Superd22 avatar Feb 01 '19 16:02 Superd22

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

nilebma avatar Feb 03 '19 13:02 nilebma

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

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!

denkedaniel avatar May 10 '19 13:05 denkedaniel

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 ?

nilebma avatar May 10 '19 13:05 nilebma

Hi @nilebma. Can you make new release of your cordova-plugin-photo-library with [email protected]?

Piranit avatar May 16 '19 17:05 Piranit

@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!

nurfgun avatar May 21 '19 06:05 nurfgun

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!

denkedaniel avatar Jun 04 '19 14:06 denkedaniel

I just accepted a PR by @neverstop26 and my repo now integrates the updated dependency. Sorry for the late answer.

nilebma avatar Jun 12 '19 09:06 nilebma

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.

denkedaniel avatar Jun 12 '19 09:06 denkedaniel

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

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?

AmrAbdalrahman avatar Jul 08 '19 13:07 AmrAbdalrahman

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

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.

AmrAbdalrahman avatar Aug 05 '19 08:08 AmrAbdalrahman

@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!

thanks a lot too

chinieer avatar Feb 20 '20 03:02 chinieer