Dear Apple Developer Support,
I am writing to seek guidance regarding App Clips launch source differentiation in our restaurant application.
Background: Our restaurant uses QR codes that are permanently associated with specific table numbers. These QR codes successfully launch our App Clip and pass the table information via NSUserActivity with NSUserActivityTypeBrowsingWeb.
Current Issue: We are facing a significant challenge in distinguishing between different launch sources:
Camera Scan/URL Launch: When customers scan the QR code using the native camera or tap a URL, the App Clip launches with the correct table information.
App Library Launch: When customers launch the App Clip from the App Library, it restores the previous NSUserActivity with potentially outdated table information.
The Problem: Since we cannot determine whether the App Clip was launched from the camera/URL or from the App Library, we cannot reliably decide whether to use the table information carried by userActivity. This causes customers to be directed to incorrect tables when launching from the App Library.
What We've Tried: We have attempted various approaches to differentiate the launch source:
Checking for AppClipActivationPayload - but it exists in both scenarios
Examining UIApplicationLaunchOptionsKey and UISceneConnectionOptions
Analyzing URL parameters and timestamps
Implementing custom state management
However, none of these methods provide reliable differentiation between camera scan launches and App Library restorations.
Question: Is there any official API or recommended approach to programmatically determine if an App Clip was launched:
From a camera scan/URL tap (fresh launch), OR
From the App Library (state restoration)
Any guidance on how to properly handle this scenario would be greatly appreciated, as it significantly impacts the user experience in our restaurant ordering system.
Thank you for your time and assistance.
Best regards