Skip to main content
Documentation
Tether

Tether SDK read modes

Read the Tether code in your iOS, React Native or Flutter app with a paste button, an automatic read, or a call you make. Android reads the install referrer.

The WarpLink SDK reads the Tether code on the iPhone and sends it to WarpLink. Tether needs SDK 1.4.0 or newer on iOS, React Native and Flutter. Older SDKs do not read the code.

The SDK sends only WarpLink codes: text that starts with wl1_, or wl1t_ for a test code. It never sends other clipboard text. After WarpLink uses a code, the SDK clears it from the clipboard, if the clipboard still holds that code.

Read modes

You pick one read mode in configure. The default is the paste button.

ModeWhen the SDK readsWhat the person sees
Paste button (default)When the person taps a system paste button that you place in your appOne tap. This tap shows no paste prompt
AutomaticDuring the first-launch check, and again on a later launch until a check completesiOS may show its own paste prompt
On callWhen your code calls readTetheriOS may show its own paste prompt at that moment

Use the paste button when your first-run screen has room for a button. Use automatic for the shortest path to the link. Use on call when you want to choose the moment, for example after a welcome screen.

Read the code in the app

Install SDK 1.4.0 or later (Swift Package Manager): .package(url: "https://github.com/WarpLinkApp/warplink-ios-sdk", from: "1.4.0"). Earlier versions do not read the code.

Replace YOUR_SDK_KEY with an SDK key for this app. Create one on the Keys page of the dashboard, on the SDK keys tab. An AI agent can call create_key with type sdk.

Set the read mode with tetherReadMode in configure. The default is .pasteButton. The SDK then reads the code after the person taps a system paste button.

.automatic reads during the first-launch check, and again on a later launch until that check completes. .onCall reads when your code calls WarpLink.readTether(completion:).

The first-launch check is the SDK's check for a link after an install. It repeats on a later launch until it completes.

In the default mode, add WarpLinkPasteButton to your first-run screen. It needs iOS 16. On iOS 15, use a plain button that calls WarpLink.readTether(completion:), as the snippet does. iOS may show its paste prompt then.

Route links in onLink. In the paste button and on call modes, onLink first gets an estimate, if the SDK found one. An estimate is a best guess and can be the wrong link.

When the SDK reads a valid code, the exact link reaches the read callback. It reaches onLink again only when onLink got another link first. The snippet calls routeOnce, so each link opens once.

In automatic mode, onLink fires once per check. The link is exact when the SDK read a valid code. With no code, it is an estimate, if the SDK found one. Check evidenceClass to tell them apart.

Put each part of the snippet in its place. lastRouted, routeOnce and handle go at file scope. The WarpLink.configure block goes in your App's init(). The if #available block goes in the body of your first-run view. Read WarpLink.lastTetherTestReceipt where you show or log it, for example in a button action.

The snippet calls router.replaceRoute and router.showRoute. Replace them with the app's own navigation code, which opens the screen for a link. If the app has no screen for the link, open the home screen.

Show or log the test receipt, so you can send it to verify_setup as tether_test_receipt. It is WarpLink.lastTetherTestReceipt. The SDK forgets it when the app restarts.

Your app gets a link from onLink and from the read callback. The read mode decides what onLink gets first.

ModeFirst onLink callSecond onLink call
AutomaticThe exact link, when the SDK read a valid code. With no code, an estimate, if the SDK found oneNone
Paste buttonThe estimate from the first-launch check, if the SDK found oneThe exact link, when the pasted code gives a link that differs from the estimate
On callThe estimate from the first-launch check, if the SDK found oneThe exact link, when readTether gives a link that differs from the estimate

In paste button and on call modes, the SDK reads nothing at first launch. The first-launch check can only estimate from device signals. An estimate has matchType probabilistic and evidenceClass estimated. It carries no UTM values. It can be a different link than the one the person tapped.

When the SDK reads a valid code, the exact link has matchType deterministic, evidenceClass exact and matchGuaranteed true. It always reaches the paste button or readTether callback. It reaches onLink too, but only when onLink already got a different link.

onLink never gets the same link twice. Two links are the same when their link ids match, or their destinations match when there is no link id. Only a Tether read can call onLink again. redeemInvitation answers only its own caller. If the first-launch check found no estimate, the exact link reaches only the read callback. React Native and Flutter deliver the second call when it follows the first in the same app session.

Route on the first call, and replace that route on the second. router is your own navigation code:

If the person has already acted on the estimate, keep the screen they are on. Apply the exact link's parameters, such as UTM values, to what you record.

What the read returns

A read returns one of four results: a match with the link's destination and parameters, no code with a reason, an unusable code, or a test receipt. A failed read, for example after a network error, is an error and not a result.

A no-code result carries one of three reasons:

No-code reasonMeaning
paste_not_allowedThe person declined the paste
clipboard_emptyThe clipboard held no text, or text that is not a WarpLink code
older_sdkThe build has no clipboard access. The name does not mean an old SDK version

A code that WarpLink does not accept gives an unusable result, or an error when the code expired on the device. Results also counts the reasons that WarpLink records: expired, other_app and link_ended. in_app_browser is in the REST list, but nothing reports it yet. Use them to see why a tap did not become a match.

Android

Android needs no clipboard. Tether on Android reads the install referrer from Google Play, as before. WarpLink.readTether gives TetherReadResult.NoClipboard to its callback once the SDK is configured, so the same shared code can call it on every platform. A wl1t_ code in the install referrer is a test, and its receipt is in WarpLink.lastTetherTestReceipt.

A valid Tether code wins over probabilistic matching, even when a newer link was tapped on the same network. Results show the match method as Tether.

Next steps