EternallLight / cordova-plugin-openwith-ios

A modified version of the Cordova iOS Share extension (cordova-plugin-openwith) by Jean-Christophe Hoelt for iOS. Supports receiving shared URLs, text and images as well as sharing several images at once.
https://web-mystery.com/
MIT License
28 stars 84 forks source link

release/v2.0.0 - testing notes #24

Closed melounek closed 4 years ago

melounek commented 4 years ago

@EternallLight good job with the release branch.

Plugin instalation ( #22 ) works correctly with the release branch.

it's not freezing anymore on the sharing-screen when I click on my app in the list, but

So basically I was never able enter myHandler (cordova.openwith.addHandler(myHandler)).

I tested that in my app and also in new empty cordova-app and here is my testing scenario:

cordova create cordovatest
cd cordovatest
cordova platform add ios

cordova plugin add https://github.com/EternallLight/cordova-plugin-openwith-ios.git#release/v2.0.0 --variable IOS_URL_SCHEME=duocardssharing

# updated index.js by readme
# updated app-id in config.xml (because of signing in Xcode)
# setup app-groups in Xcode (`group.<YOUR_APP_BUNDLE_ID>.shareextension`) for both app/shareExt targets

# Xcode -> run (on various devices), or:
cordova run iOS

hope it helps

EternallLight commented 4 years ago

Hi @melounek First of all, thank you for sharing this information. I believe you couldn't share files on a real devices because you had different iOS versions in deployment target option for you main app and app extension. Check out the updated instructions in the README.md file on the master branch. I tested on a real iPhone 7 device and it works now as expected. There are some issues when sharing text from Safari on a simulator but fortunately they do not show up on a real device.

melounek commented 4 years ago

Thanks for update, it works 👍 🥇

Only one more thing looks like a bug: Everytime I re-build by cordovat cordova build ios it will rename the ShareExt target from com.my.app.shareextension back to com.my.app. So I have to rename it back everytime (10th step in readme)

But thanks again and feel free to close this issue.

EternallLight commented 4 years ago

Yep, I noticed that, too. Will take a look. Thanks for confirming.

Best regards, Andrey Grunev

On Mon, May 11, 2020 at 3:20 PM Petr Heralecký notifications@github.com wrote:

Thanks for update, it works 👍 🥇

Only one more thing looks like a bug: Everytime I re-build by cordovat cordova build ios it will rename the ShareExt target from com.my.app.shareextension back to com.my.app. So I have to rename it back everytime (10th step in readme)

But thanks again and feel free to close this issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/EternallLight/cordova-plugin-openwith-ios/issues/24#issuecomment-626667214, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDSTCQLUU34NI6CY7KZPDDRQ7UR3ANCNFSM4M3KF3KQ .

EternallLight commented 4 years ago

It does not seem to be possible to fix this issue in the plugin directly. The cordova-ios platform correction is required – platforms/ios/cordova/lib/prepare.js. When I worked at Thirdlane, I did something like a loop over the build targets and determined which is the main app and which is extension (we had 2 app extensions besides the sharing one), and did corrections only for the main app. Unfortunately, cordova still does not support iOS app extensions out of the box. I'd really recommend you to run the application from Xcode – not only because you wouldn't face the bundle identifier override issue during cordova prepare, it is just much faster.

melounek commented 4 years ago

Thanks for checking. I would like to use only Xcode, but when I update the javascript code, I need to get it into platforms somehow, which does cordova build or cordova prepare, but these are renaming the identifier. Or if you know some better workflow how to "prepare" the updated JS, let me know.

Otherwise this should be better documented in the 10th point in the readme (the renaming or using loop-script you mentioned).

EternallLight commented 4 years ago

As a quick solution, you can correct your app build process and add to the last step copying the built stuff form ./www to ./platfforms/ios/www

melounek commented 4 years ago

will try, thanks

melounek commented 4 years ago

Unfortunately, cordova still does not support iOS app extensions out of the box.

Looks like the issue will be fixed soon. Now it's in cordova-ios version 6.0.0-dev https://github.com/apache/cordova-ios/pull/820