测试 Branch iOS / Android / Web SDK

iOS / Android

链接用户体验

  1. 建立应该具有深度链接的快速链接(与打开主屏幕相比)
  2. 通过电子邮件将链接发送给自己
  3. 不要将链接粘贴到浏览器栏中
  4. 确保电子邮件没有“包装”链接(即追踪或安全域)
  5. 点击来自测试设备(而非模拟器)的链接
  6. 确保测试的应用版本使用与链接相同的 API key(测试 vs. 实时)
  7. Click link in these scenarios

SDK 初始化

  1. Enable debug mode for Branch SDK by calling the setDebug()/enableLogging() before the SDK is initialized. You can find examples in the above videos, and in our iOS or Android documentation.
  2. 启动您的应用,并在日志控制台(即 Logcat)中查看调试日志。
  3. 通过确保 SDK 向 v1/open 或 v1/install endpoint 发出了请求,验证 Branch SDK 是否已正确初始化:
  4. 关闭应用,并验证 SDK 是否向 v1/close endpoint 发送了请求。
  5. 重复执行步骤2-4,以确保在每次操作时都发送请求,而不仅仅是在您首次启动应用时发送。
  6. Create a Branch link through either of the available Branch methods, some of which are: Quick Links, API, or any of the SDK methods.
  7. Use the following methods for iOS or Android to test the link, and make sure that it is all set up. Make sure to verify that link data is passed into the application every time, and your application is able to parse the data correctly via initSession() callback.

SDK 自定义事件记录

Non-referred 事件:

  1. Trigger the custom event via SDK (iOS / Android)
  2. Verify that each event is sent to Branch by verifying the Logs (with debug/logging enabled, you should see a v1/event call) and Dashboard Liveview events.
  3. If you are a Data Feeds user, you should see this event attributed in a Custom Event export.
  4. If it is a commerce event (iOS / Android) - make sure all the commerce data is also passed to Branch through the same sources.

Referred 事件

  1. 点击链接
  2. Trigger the custom event via SDK (iOS / Android)
  3. If it is a commerce event iOS / Android) - make sure all the commerce data is also passed to Branch through the same sources
  4. 验证每个事件都已发送到
  5. SDK:验证日志(通过调用 setDebug()/enableLogging(),您应该看到一个 v1/event 调用)以及
  6. Data Feeds: You should see this event attributed with link ID in the last_attributed_touch_data_tilde_id data (Export API, CSVs, Webhooks)
  7. Dashboard Liveview events: You should see the event triggered and the link in the Session Referring Link URL

延迟深度连结

  1. 将测试设备连接到计算机
  2. 卸载设备上的所有应用版本(测试和生产)
  3. 点击设备中的 Branch Link
  4. 让链接重定向到 App Store,但不要下载该应用
  5. 通过 xcode 将应用构建到设备中| android studio
  6. 确保应用版本包含 Branch SDK 和与链接相同的 API key
  7. 必须在点击链接的2小时内发生(Branch 匹配窗口默认为2小时)
  8. 打开应用以初始化 Branch SDK,该 SDK 将浏览器<>设备对与最近的点击匹配
  9. 如果设备点击过 Branch Link,则一定会匹配;如果未点击,则 Branch 将使用指纹进行匹配
  10. 如果 Branch 发现浏览器<>设备对已经安装了应用,则 +is_first_session 参数值将为“ 0”
  11. 要在测试期间将 +is_first_session 设置为“ 1”,请在 SDK 中激活调试模式

Web SDK

SDK 初始化

  1. 确保您没有运行任何 Adblocker(Web SDK 受到阻止)
  2. 确保在网络调用中加载了 branch-latest.min.js
  3. 查找 app.link 请求:
  4. 确保响应为200 OK
  5. 确保 branch_key 参数中有正确的 Branch key
  6. Example: https://app.link/_r?sdk=web2.33.1&_t=446772116780734172&branch_key=key_live_hkDytPACtipny3N9XmnbZlapBDdj4WIL&callback=branch_callback__0

Journeys(网站向App引流解决方案)

  1. 确认 Web SDK 中使用的 API key 与应用内使用的 API key 一致
  2. 验证深度链接路由设置
  3. If not using $canonical_url, confirm keys accounted for via banner template, .setBranchViewData, or Metatags
  4. 确认应用可以识别 app.link 备用域
  5. 激活广告横幅并验证筛选项
  6. 检查包含 Web SDK 的 URL,广告横幅应显示在何处
  7. 检查包含 Web SDK 的 URL,其中不应出现广告横幅
  8. 在这些情况下,使用会深度链接(即不是主屏幕)的广告横幅加载网页
  9. iOS-Safari(未安装应用)
  10. iOS-Safari(已安装应用-冷启动)
  11. iOS-Safari(已安装应用-热启动)
  12. iOS-Chrome(未安装应用)
  13. iOS-Chrome(已安装应用-冷启动)
  14. iOS-Chrome(已安装应用-热启动)
  15. Android-Chrome(未安装应用)
  16. Android-Chrome(已安装应用-冷启动)
  17. Android-Chrome(已安装应用-热启动)

最佳实践

  1. Test on actual devices, and utilize Test Mode to imitate fresh installs, otherwise - Branch will be able to identify that device previously had the application installed, and will not send the install event.
  2. When testing on multiple devices at the same time - it is best to use different links, and not identify with the same ID. Otherwise, Branch will consider both devices to be used by the same user. In that case - links clicked on one device will be able to pass data to another device.
    We also recommend testing on different networks, or on one device at a time to prevent flaky behavior.
  3. During testing, you may run into Error messages containing the following text, or its variation: “can't open the page because the address is invalid.” This is an indicator that you used to have your application installed, and used it recently. You then uninstalled the application and clicked on a Branch link.
    This happens when our forced URI redirect mode tries to forcefully open the application via a URI scheme. When the application is not available on the device - it will result in the given error.
    This scenario will almost never happen to regular users, as our research has shown, however it will greatly improve app opening through deep linking.
    If you would rather be on a safe side - you may change the forcefulness of the mode at the top of your Link Settings page. We recommend keeping it at the intelligent mode setting.

视频演练


这个页面对您有帮助吗?