carsten-klaffke/send-intent

ios not receiving images

j-d-carmichael opened this issue · 3 comments

I have set the plist for the shareintent ext to (ios/App/ShareIntent/Info.plist)

...
	<key>NSExtension</key>
	<dict>
		<key>NSExtensionAttributes</key>
		<dict>
			<key>NSExtensionActivationRule</key>
			<dict>
				<key>NSExtensionActivationSupportsFileWithMaxCount</key>
				<integer>1</integer>
				<key>NSExtensionActivationSupportsImageWithMaxCount</key>
				<integer>1</integer>
				<key>NSExtensionActivationSupportsText</key>
				<true/>
				<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
				<integer>1</integer>
			</dict>
		</dict>
...

Within the app I can catch URLs and text just fine.

As soon as I try to share a photo to the app it fails:

  • on an iphone 7, latest ios
  • simulated iphone12, latest ios

Each time nothing gets passed to the app in the image object. The plugin logs:

⚡️  To Native ->  SendIntent checkSendIntentReceived 9529930
⚡️  TO JS {"file":"","url":"","text":"","image":""}

In the js code, for completeness, i log the object:

    SendIntent.checkSendIntentReceived().then((result) => {
      console.log('result from send intent: ', result);

And the output is:

⚡️  [log] - result from send intent:  {"file":"","url":"","text":"","image":""}

The thing is the app is registered correctly in the plist as the app is available to share photos to. Additionally, i checked to ensure this was not a "live photo" but still the same.

This is not handled so far. In Android, I convert images to a Base64 String. This could be added to the ShareViewController in iOS. Another approach to handle images could be my latest pull request #11, in which I generally enable binary file processing, but it is only implemented for Android so far.

Like video support, this is solved now. Check the updated Readme.md for the ShareViewController.swift and AppDelegate.swift. On the receiving side, you will get an URL which you can read out with the Capacitor "Filesystem" plugin.

Awesome!! I will get this updated very soon. And thank you!!