[Zapworks Studio - WebAR] Ability to share text only

It seems that it’s not possible to share only text, but it should be. Sometimes clients want to share the experience itself, so it would be nice if I could just share the deeplink of the experience. Furthermore, right now it’s not possible to share images on iOS browsers, only Android. However, sharing text works on both using the web share api, so Zapworks Studio should support this on webar. An API to share just text. That’s all. Primary use case: share the link of the experience. Specially useful for AR experiences that don’t require an image tracking, like instant tracking or face tracking.

Right now, it’s not possible to share messages on webar at all, even if I use the snapshot feature. See the issue here, it was reported over 2 years ago and it’s not fixed yet.

Here is an example of the web share functionality for text only. You can try it out on Safari and Chrome for Android, it will work on both.

EDIT
Sharing images is now possible on iOS15. Still, sharing just text should be an option, just to share the URL of the experience as explained above.

1 Like

@simon your thoughts on this request and this one?

Yup, I definitely see the value in both. As more content moves to WebAR we’re less concerned about finding the minimum common subsets between native and Web APIs so I wouldn’t mind some APIs more aligned with the web capabilities, and I agree sharing just text / URL is a common use-case.

We’re working to bring the various branches of our runtime code (mainly with the different Instant Tracking implementations) back together again, and after that it will be easier to roll out smaller updates like this one.

I’ll mention internally and keep you posted.

One complicating factor - the WebShare API might require a user gesture so we might need to pop up a div as we do for external website links under WebAR - not a blocker, but might make it a bit more work to implement.

It does indeed require a “transient activation”.

One way you could do it is with the newish web frame functionality - this works for example:

(Z.device as any).launchWebFrame("https://mdn.github.io/dom-examples/web-share/", res => {
    console.log("The user has closed the frame");
});

Although in general you can use a data:// URL to set the web frame content from Javascript, the navigator.share function is only available on pages hosted from secure https:// domains so you will need to host the page externally for that to work.

2 Likes

so you will need to host the page externally for that to work.

Oh man lol. Too much work like this one.

We’re working to bring the various branches of our runtime code (mainly with the different Instant Tracking implementations) back together again, and after that it will be easier to roll out smaller updates like this one.

I’ll mention internally and keep you posted.

Looking forward to this update. Thanks Simon!