Closed chanmathew closed 1 week ago
@chanmathew I just upgraded the plugin for Capacitor 6. Please install 4.0.0-beta.0 and let me know if it works in your project.
Hi @calvinckho - Thanks for the quick update!
~~I just reinstalled the 4x beta, ran npx cap sync
, rebuilt the app, and unfortunately still getting the same error.
Are there other files that you think I can share that might be a good starting point to help debug?~~
It seems to be working! I realized I was also missing the packageClassList in my root capacitor.config.json
, for some reason when running cap sync it only added the packageClassList
it to the target nested in ios/App/capacitor.config.json
. Not sure if that's on my end, maybe I need to clean my setup.
Just quick question, I noticed once I shared once to my app, the initial Share popup doesn't seem to open anymore, and it redirects straight to my app once I tap my app icon. How do I get it to trigger a UI everytime?
Nvm, figured it out. Thanks for your help!
For others that might come across this: I reverted the ShareViewController to inherit from SLComposeServiceViewController for now to use the default sharing prompt:
class ShareViewController: SLComposeServiceViewController
and then added a didSelectPost
function that basically tells the app that only share the data once the user presses "Post" in the default prompt, and then close the dialog.
override func didSelectPost() {
// Send data to the host app when the user taps the post button
self.sendData()
// Call this method to close the extension and return to the host app.
self.close()
}
And then I removed the self.sendData()
from viewDidLoad()
so it doesn't redirect the user to the app right away, but rather when they hit the post button.
Hi @calvinckho,
Thanks for creating this plugin.
I'm running Capacitor 6.0 and the latest 3.0.0-beta-0 of this plugin, and when I try to check for
Capacitor.isPluginAvailable('ShareExtension')
in the root of my Sveltekit app in my onMount function, it is returning unavailable.And the ShareExtension functions will say Error: "ShareExtension" plugin is not implemented on iOS (i haven't tested Android yet).
Is this compatible with Capacitor 6.0?
Here's my root layout in Sveltekit, which is basically the root of the app:
Here's my AppDelegate:
And I also copied your code in the readme for the ShareViewController.swft.
I installed your plugin, ran
npx cap sync
, then rebuilt my app. I've also setup a Share Extension target, with min deploy of iOS 13. The share sheet pops up when i try to share from other apps, but it just doesn't seem to load the plugin on the app side, so I can't see if the data is coming in or not.Any help would be much appreciated!