Accessing preview image of SLComposeServiceViewController - ios

Has anyone had any luck capturing the image preview, a screenshot of the website, that apple presents in the its share extension for safari webpages, without having to simply replicate the functionality?

Related

WKWebView Camera Preview

I have a URL that needs to display a camera preview, whereas I display the said URL using WKWebView.
However, upon checking the camera preview is not working usingWKWebView, but it quite works when I open the URL using Safari, it's just that the preview only captures a single frame, from there, the image in the preview doesn't change.
Anyone here who tried doing this WKWebView? One workaround that I am thinking of is to use JS bridge.

AR images not working inside the WKWebView

Here is the AR Quick Look website from Apple docs - https://developer.apple.com/augmented-reality/quick-look/
If I go to this website in the Safari browser on my iPhone 8, then everything is working correctly. I can tap any of the 3D model and place it inside the Augmented Reality.
However, if I view the same website in the WKWebView, then the AR models are not working correctly. I am not able to tap any model and place it inside the AR.
For the comparison I am attaching screenshots from the Safari browser and from the WKWebView
Safari
WKWebView
As you can see in WKWebView, the AR icon is not even showing up.
Does anyone knows why AR images are not working inside the WKWebView?
I will be very glad for any help.
I just found a tweet from 2018 suggesting that WKWebView does not support AR Quick Look. You can find it here. The WebKit website also suggests that.
Most probably SFSafariController should be used instead.

Sharing a photo from an ios app

Given that I have a UIImage instance in my app how could I get
ios to show the image sharing dialog (Mail, add to notes, twitter, fb,
save image, etc)
Upon a cursory look to PHAsset I haven't found anything prominent :-(
You can search for UIActivityViewController. This class will display a dialog, having all sharing apps listed within dialog.

Add app to Safari share button

App should be automatically added to Safari share and on tapping Safari share button app shows on it like Facebook or Twitter. How can I implement this functionality?
For further reference I have added a image below.
You can use the share extension feature provided in IOS8.apple documentation

SLComposeViewController with screenshot but not image attachment

I notice that Mobile Safari's Twitter and Facebook share adds a screenshot of the current page without actually sharing it, eg:
Im trying to duplicate this via SLComposeViewController, however calling the addImage: actually adds the UIImage to the tweet/facebook album (as expected).
Is there a way to just display the screenshot of the page without adding the image ?
Edit:
Looks like SLComposeViewController conforms to UIAppearanceContainer however the UI_APPEARANCE_SELECTOR is not documented.
Safari is previewing the screenshot to the website because it has it loaded and ready in on the screen, when you addURL: on the SLComposeViewController it doesn't resolve that URL and grab a preview.
Also when you addImage: that's exactly what it's doing, it's adding an image to your post, this isn't what you want, you just want to have a visual and not a safari logo/icon in place of the attachment indicating a link.
I can only say there is a private method on the SLComposeViewController class which is how Safari is adding a preview image for URLs added...
You should always get this in your app when sharing a URL:
That sucks, you should add a feature request (http://bugreport.apple.com) so that you can add your own preview here, maybe Apple will make that public in future iOS releases.

Resources