I'd like to create an App Clip that can view my app's custom file format. This way a paying user can share content with a friend without the friend having to pay for or install and set up the main app. Is this possible? Currently I have to have a separate "Viewer" app in the store for this purpose, but that's not a great experience.
Can an App Clip be used to preview file content?
Hi @picnicbob,
The short answer to the question is: it depends.
The longer answer:
Before we get more technical, you need to be aware that the app clip's functionality must also be included in your full app, so the app clip can't have functionality that the full app doesn't have. Assuming your full app contains functionality to view your custom file format, and that frameworks you use are available to app clips, what you'd want to do is create an app clip target in your app's Xcode project, and then add the code to the target to implement this functionality. You'll also have to make some configuration on your server and set up URLs that launch the app clip.
For detailed information, consider watching Explore App Clips,
Design Great App Clips, Configure and Link Your App Clips, and Create App Clips for Other Businesses, and Streamline Your App Clip.
There's also developer documentation that covers various tasks. I'd get started with Developing a Great App Cli which gives you an overview over available technology. Then, you can start with the app clip implementation as described in Creating an App Clip, and then read Configuring Your App Clip's Launch Experience.
The short answer to the question is: it depends.
The longer answer:
Before we get more technical, you need to be aware that the app clip's functionality must also be included in your full app, so the app clip can't have functionality that the full app doesn't have. Assuming your full app contains functionality to view your custom file format, and that frameworks you use are available to app clips, what you'd want to do is create an app clip target in your app's Xcode project, and then add the code to the target to implement this functionality. You'll also have to make some configuration on your server and set up URLs that launch the app clip.
For detailed information, consider watching Explore App Clips,
Design Great App Clips, Configure and Link Your App Clips, and Create App Clips for Other Businesses, and Streamline Your App Clip.
There's also developer documentation that covers various tasks. I'd get started with Developing a Great App Cli which gives you an overview over available technology. Then, you can start with the app clip implementation as described in Creating an App Clip, and then read Configuring Your App Clip's Launch Experience.
My apologies for messing up the URLs for the last three links:
Thanks for replying. From what I’ve read so far an App Clip works as a URL scheme behind the scenes. Without uploading the shared file to my private server (a potential privacy issue) is there a way to pass a mail attachment (or other local file content) to an App Clip? I admit I still have more reading/watching to do, so no need to go into great detail if you can point me in the right direction or tell me it’s impossible at the moment. Basically I want my App Clip to work as a Quicklook Preview extension without having to purchase the app.
The short answer to your question is no. This is because app clips cannot register for document types, or URL schemes. They can only be launched via app clip URLs. So if you sent someone a custom file via Mail, iOS would have no way of knowing to get your app clip, and even if it did the system would not consider it a valid target for opening the file.
If possible, you could choose to instead share a URL to the file like https://example.com/file/12345-abcd-6788, however URLs opened from apps aside from Messages will first take the user to Safari where they will then see the Smart App Banner (assuming the page is annotated with the apple-itunes-app meta tag) that can be used to bring up the app clip card.
I'd encourage you to file feedback with details about your use case if you'd like to see additional entry points into App Clips!
If possible, you could choose to instead share a URL to the file like https://example.com/file/12345-abcd-6788, however URLs opened from apps aside from Messages will first take the user to Safari where they will then see the Smart App Banner (assuming the page is annotated with the apple-itunes-app meta tag) that can be used to bring up the app clip card.
I'd encourage you to file feedback with details about your use case if you'd like to see additional entry points into App Clips!