When I designed my App Clip Launch experience, I had in mind that the App can only be triggered via QR code
, NFC
or App Clip Code
. That why I linked the App Launch to a specific location with specific Id.
When my App went live last week, and when I try to scan a NFC tag the App is launching as expected every time.
Now, if I tap the App Clip icon on the home screen, the App is launching with the last URL scanned I dig some googling and I found that the App Clip is caching the last URL scanned and simulating a universal link launch when icon tapped!
This is not working for me! So I am looking for a way to check if the App was launched via scan or tap? I tried to log the App launch but it's always running in the order either via Scan (NFC) or icon tap:
AppDelegate.didFinishLaunchingWithOptions()
SceneDelegate.willConnectTo() // It's here where I am handling the Universal Link
How can I check if the user launched the App via Tap or Scan? Knowing that the App is always simulating Universal launch Link when icon tapped!
Or how I can look for the saved URL? I tried to fetch all UserDefaults
and Some Keychain
data, but I found nothing!
I faced the same issue! And unfortunately there’s no way to:
UserDefaults
orKeychain
Apple says clearly on their Human Interface Guidelines that if you want support multiple businesses you should add the location services factor!
So, now your tags for specific location should be mapped to a coordinates
[Longitude, Latitude]
. Apple has introduced a new location verification API just for App Clips that allows you to do a one-time check to see if the App Clip code, NFC tag or QR code that the user scanned is where it says it is.Enable Your App Clip to Verify the User’s Location To enable your App Clip to verify the user’s location, modify your App Clip’s
Info.plist
file:Info.plist
, add the NSAppClip key, and set its type toDictionary
.NSAppClipRequestLocationConfirmation
as the key, selectBoolean
as its type, and set its value totrue
.But using App Clip Location services is different:
activity.appClipActivationPayload
to confirm if the location (in Step 2) is in region where the user is right now.The Code bellow (Copied from Apple) explains how to do it.
And that’s it, this his how your support multiple businesses with App Clip