-
Notifications
You must be signed in to change notification settings - Fork 0
Creating a URL
Nightflix uses TMDB to display movies and series and allows users to choose a streaming provider to watch content. To integrate, providers must supply deep links that open their app to the right content when triggered from Nightflix. This article explains the types of deep links, how to implement a compatible URL scheme, and best practices.
Understanding deep links and URL schemes
Deep links direct users to specific content within your app rather than just launching the home screen. Historically mobile apps used custom URL schemes like myapp:// to deep link to content, but these schemes have limitations. The Branch blog notes that URI schemes provide no fallback when the app isn’t installed and can collide if multiple apps use the same scheme. Because of these issues, iOS and Android introduced universal links and app links, which are standard HTTPS URLs that map to both a web page and in-app content.
Custom URL schemes
A custom URL scheme is a unique prefix such as myapp:// registered by your app. When a user taps a link like myapp://movie/123, the mobile operating system opens your app and passes the path so you can load the content. Custom schemes are simple to set up and do not require backend configuration, but they lack built-in verification, offer no fallback, and may face collisions with other apps.
Universal links and app links
Universal Links (iOS) and App Links (Android) use standard HTTPS URLs such as https://myapp.com/movie/123. When tapped, the device checks whether your app is registered to handle that domain. If so, it opens the app; otherwise it loads the web page. These links have stronger security, automatic fallback to the web, and align with app store guidelines. Implementing universal/app links requires hosting configuration files (an apple-app‑site‑association file for iOS and an assetlinks.json file for Android) and updating your app’s entitlements and manifest.
Requirements for Nightflix integration
Nightflix identifies movies and episodes using TMDB IDs. To integrate with Nightflix you must:
Maintain a mapping from TMDB IDs to your own catalogue IDs. Nightflix displays TMDB titles; when a user selects “Play on [Your Service]”, the app will call your deep link with the TMDB ID substituted. Provide a base deep-link pattern for movies and series. Nightflix will append the TMDB ID or your internal ID according to your documentation. Support both custom URL schemes and universal/app links so that content opens smoothly across iOS, Android and web. Custom schemes should be a fallback for platforms or contexts (like certain social apps) where universal links are blocked. Designing a custom URL scheme Choose a unique scheme: Register a scheme that reflects your brand, such as yourservice. On iOS this is configured in Xcode’s Info tab under URL Types. On Android, declare an intent filter in your AndroidManifest.xml that matches your scheme and host.
Define path conventions: Decide how to encode content IDs. For example:
Movies: yourservice://movie/ Episodes: yourservice://show//episode/
Ensure there are no spaces or uppercase letters and document the path parameters clearly.
Handle incoming links: In your app delegate or main activity, parse the path and navigate to the appropriate screen. If the ID is invalid or not found, show a friendly message. Fallback handling: Because custom schemes provide no automatic fallback, implement logic in Nightflix to detect when the app isn’t installed. On iOS you can query canOpenURL and show an alert instructing the user to install your app. On Android, Nightflix uses the system to detect if the intent resolves; supply a Play Store URL as a fallback. Implementing universal links & app links
Universal and app links give a better user experience and are strongly recommended.
Host configuration files: Host the apple-app‑site‑association file at https://yourdomain.com/.well-known/ with applinks entries for the paths you wish to deep link. For Android, host an assetlinks.json file at the same location. Configure your app: iOS: Enable Associated Domains in Xcode and add applinks:yourdomain.com. Handle the link in scene(_:continue:) or the SwiftUI equivalent. Android: Add intent filters with android.intent.action.VIEW, android:scheme="https", and android:host="yourdomain.com" in your manifest, referencing the correct assetlinks.json. Define precise paths: Use specific URL patterns (for example /movie/*) and avoid broad wildcards to minimize misrouting. Test thoroughly: Check on devices with and without your app installed, across different browsers and social apps. Universal links won’t trigger when pasted directly into a browser address bar and may be blocked by some social apps; always provide a web fallback. Nightflix integration steps Provide your link format: Submit to the Nightflix team the base URL or scheme for movies and episodes. For example, if your movie deep link format is yourservice://movie/, Nightflix will call yourservice://movie/abc123. If you use universal links, supply https://yourdomain.com/movie/. Map TMDB IDs: Provide a mapping file or API so that Nightflix can translate TMDB IDs to your internal IDs. If your content IDs align with TMDB (e.g., you use TMDB movie IDs internally), specify that. Testing: Use the Nightflix preview mode to verify that clicking a title opens the correct content in your app. Check fallback behavior when your app is not installed. Documentation: Maintain up-to-date documentation of your URL scheme and update it whenever you change your app structure or deprecate content IDs. Security, compliance and best practices Follow platform guidelines: Both Apple and Google recommend universal links over custom schemes; comply with their policies to avoid rejection. Use HTTPS everywhere: Host configuration files over HTTPS with no redirects, and ensure all universal links use HTTPS. Provide clear fallbacks: If the link fails to open the app or content is not available, show a helpful web page rather than a 404 error. Monitor and update: Deep linking standards evolve. Regularly review your implementation for compatibility and update your scheme as needed. Responsibility disclaimer: Nightflix displays content available through TMDB and links to provider apps for legitimate streaming. Providers are responsible for ensuring their content is licensed and compliant with copyright laws. Conclusion
By creating a robust deep-linking scheme and aligning with modern standards, streaming providers can deliver a seamless Nightflix experience. Start by mapping your catalog to TMDB, choose a clear URL pattern, implement universal and app links, and thoroughly test across platforms. These steps will ensure that users can jump straight from Nightflix to your content with minimal friction, improving engagement while respecting platform requirements and legal obligations.