Okay, here are the detailed project instructions for the backend team to set up the necessary infrastructure for deep linking and deferred deep linking for your Unity game, "Lila's World".
Project Goal: Implement web server logic to handle deep links (https://photontadpole.com/lilasworld/download?scene=...).
2. If the user does not have the app installed, they should be redirected to the appropriate app store (Apple App Store or Google Play Store).
Target Deep Link Example: https://photontadpole.com/lilasworld/download?scene=961
This involves creating a handler (e.g., a script or route) for the path /lilasworld/download.
2.1. Request Handling:
- Configure the web server (e.g., Nginx, Apache, Node.js/Express) to route requests for
https://photontadpole.com/lilasworld/downloadto your handler script/application. - The handler must accept
GETrequests.
2.2. User-Agent Detection:
- Inspect the
User-Agentheader of the incoming request to determine the user's operating system (iOS or Android) and potentially the browser/device type. This is crucial for redirection.
2.3. Redirection Logic (App Not Installed / Fallback):
- This logic executes if Universal Links / App Links don't automatically open the app (which usually means the app isn't installed or deep linking isn't configured correctly on the device/app).
- Based on the detected OS:
- If iOS: Redirect the user to the Apple App Store page for Lila's World.
https://apps.apple.com/us/app/lilas-world-create-play-learn/id1523048072
- If Android: Redirect the user to the Google Play Store page for Lila's World.
https://play.google.com/store/apps/details?id=com.photontadpole.lilasworld&hl=en_IN- Make sure for Android to add the encoded deeplink at the end before redirecting
- If iOS: Redirect the user to the Apple App Store page for Lila's World.
When a user visits this URL, your server should: https://play.google.com/store/apps/details?id=YOUR_APPLICATION_ID&referrer=YOUR_ORIGINAL_DEEPLINK_URL_ENCODED
Example with your link:
Original URL: https://photontadpole.com/lilasworld/download?scene=961 URL Encoded Original URL: https%3A%2F%2Fphotontadpole.com%2Flilasworld%2Fdownload%3Fscene%3D961 (Use an online URL encoder or standard libraries in your server language).
Final Redirect URL: https://play.google.com/store/apps/details?id=com.photontadpole.lilasworld&referrer=https%3A%2F%2Fphotontadpole.com%2Flilasworld%2Fdownload%3Fscene%3D961
If Other/Unknown: Redirect to a generic landing page or default to one of the stores (e.g., Play Store).
- Use an HTTP
302 Found(temporary redirect) status code.
Important: The steps above handle direct linking and the store redirect. The deferred part requires more complex logic.