# Testing & Troubleshooting

There are known limitations for testing flow during implementations. It's not possible to test the full flow of deferred links and universal app links unless your app is already in Play Store / App Store.

## Testing iOS

If you are still in development mode and your app is not released to App Store, you can test SDK behavior by following steps:

1. Ensure the app is uninstalled on the device.
2. Visit the link on your device by pasting or typing its URL into your device's browser.
3. Platform will try to redirect to App Store page based on `App Store ID` you put in configuration. Your app might not exist at that moment.
4. Install you app in development mode like you normally do.
5. See the result. SDK should return the link you clicked if you managed to do it within the time window (currently 15 minutes).

## Testing Android

In most cases `referrer` param is not passed to Play Store unless your production app is released. That means even though your app is displayed in Play Store for internal/external test, `referrer` probably won't work and so SDK won't use deterministic flow.
However, still you can test probabilistic flow by following steps:

1. Ensure the app is uninstalled on the device.
2. Visit the link on your device by pasting or typing its URL into your device's browser.
3. Platform will try to redirect to Play Store based on `package name`. Your app might not exist at that moment.
4. Install you app in development mode like you normally do.
5. See the result. SDK should return the link you clicked if you managed to do it within the time window (currently 15 minutes).

You want to test `referrer` api in development mode, there are some workarounds for that. <br></br>
Take a look on that medium article: [link](https://medium.com/@madicdjordje/how-to-test-the-play-store-install-referrer-api-78a63d59945b)

:::note[Missing `click_id`]
If you encounter click_id missing in your build see limitations section [Play Store referrer missing](https://detour.swmansion.com/docs/platform/architecture/architecture-limitations#play-store-referrer-missing)
:::

### Testing Android App Links

Whether an installed app opens a Detour link depends on the Dashboard SHA-256 matching the key that signed **the build on your device**:

| Installation method                                     | SHA-256 to configure                   | Where to find it                                                                                         |
| :------------------------------------------------------ | :------------------------------------- | :------------------------------------------------------------------------------------------------------- |
| Google Play, any track                                  | Play App Signing key                   | Play Console → **Protected with Play** → **Manage Play app signing** → *App signing key certificate*     |
| `eas build`, any profile, including `development`       | Keystore in your EAS account           | `eas credentials -p android` → profile → **Keystore** → `SHA256 Fingerprint`                             |
| `npx expo run:android` / `npx react-native run-android` | Project's `android/app/debug.keystore` | `keytool -list -v -keystore android/app/debug.keystore -storepass android`, or `./gradlew signingReport` |

To check any build directly: `apksigner verify --print-certs app-debug.apk`. The complete procedure is described in [Finding your Android SHA-256 fingerprint](https://detour.swmansion.com/docs/platform/fundamentals/universal-app-links#finding-your-android-sha-256-fingerprint).

## Common issues

- No match found (404):
  - Check timestamps. The click may be older than the match window.
  - Confirm the click was recorded (Dashboard click logs).
  - For Android deterministic: confirm click_id is present in the referrer.

- 429 Too Many Requests:
  - Implement retry/backoff and ensure you are not using the same appID/key for heavy testing from many devices. Use staging keys.

- iOS clipboard prompt not appearing:
  - ensure `shouldUseClipboard` is enabled and that your app actually attempts to read the clipboard on first open.
  - check that the copy-link feature is enabled in the iOS configuration in the Dashboard, and that you copied the link to the clipboard on the screen you were redirected to