To ensure your deep link works on iOS and opens your game when clicked, you’ll need to set up Universal Links (Apple’s equivalent of Android App Links). Here’s how to adapt your setup for iOS:
- Open your Unity project’s iOS build in Xcode.Welcome file
- Go to Signing & Capabilities > + Capability > Add Associated Domains.
- Add your domain in the format:
applinks:photontadpole.com
If you’re building from Unity, create or modify an Entitlements file (app.entitlements
) in your Xcode project to include:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:photontadpole.com</string>
</array>
</dict>
</plist>
For compatibility with older apps or custom URI schemes (e.g., photontadpole://
), add a URL scheme to your iOS app:
- In Xcode, open your project’s
Info.plist
. - Add a URL Scheme:
<key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string>com.photontadpole.lilasworld</string> <key>CFBundleURLSchemes</key> <array> <string>photontadpole</string> // Custom scheme: photontadpole://... </array> </dict> </array>
-
Test the
apple-app-site-association
File:
Visithttps://photontadpole.com/.well-known/apple-app-site-association
in a browser to ensure it’s publicly accessible and valid.
Validate it using Apple’s AASA Validator. -
Test the Link:
Sendhttps://photontadpole.com/lilasworld/download?scene=961
via iMessage, Notes, or Safari. If your app is installed, it should open directly. If not, it will open your website.
- Universal Links Only Work Over HTTPS: Ensure your domain has a valid SSL certificate.
- First Launch Behavior: On first launch, iOS may show a banner asking to open the app. After that, links open the app directly.
- Handling in AppDelegate (Advanced): For more control, modify the
AppDelegate.mm
file in your Xcode project to handle Universal Links (Unity’sApplication.deepLinkActivated
usually suffices).
Task | Android | iOS |
---|---|---|
Domain association file | assetlinks.json |
apple-app-site-association |
Intent filter/Entitlements | AndroidManifest.xml |
Xcode Associated Domains |
URL Handling | Application.deepLinkActivated |
Same as Android |
By following these steps, your deep link https://photontadpole.com/lilasworld/download?scene=961
will work seamlessly on both Android and iOS! 🚀