tamer-linking
Deep linking and external URL handling for Lynx. Requires the native LinkingModule.
Install
Run t4l link after installing.
Usage
Open an external URL
Build an app URL
Listen for incoming URLs
Read the URL the app launched with
API
openURL(url)
Hands the URL off to the system. Resolves true when the OS reports a successful open, false otherwise (no handler, malformed URL, native bridge unavailable). Works for https://, mailto:, tel:, sms:, App Store / Play Store URLs, and any registered custom scheme.
createURL(path?, options?)
Default scheme: tamerdevapp. Uses LinkingModule.createURL when available.
getInitialURL()
Returns Promise<string | null>.
addEventListener(type: 'url', listener)
Returns { remove: () => void }. Listener receives { url: string }.
removeEventListener(type: 'url', listener)
Removes the subscription.
How it works
- iOS:
openURLcallsUIApplication.shared.open(url, options: [:])on the main thread.addEventListener('url', …)listens forapplication(_:open:options:)anduserActivity(.continueUserActivity)callbacks dispatched by the host. - Android:
openURLdispatchesIntent.ACTION_VIEWwithFLAG_ACTIVITY_NEW_TASK. URL events come from the host'sonCreate/onNewIntenthandlers. - The simulator without Mail.app installed resolves
falseformailto:— that's expected. Real devices and any sim with Mail / Safari installed work normally. createURLis a pure helper that prefers the native bridge for canonical scheme handling, but falls back to JS string assembly when the bridge isn't available.
