验证工具

用于自动 iOS 集成的 Branch CLI

概述

The Branch CLI is a simple plugin which integrates Branch into your iOS project for you.

其他重要功能

  • 验证 Universal Links :CLI 通过将项目的 Bundle ID,团队 ID 和 entitlement 文件中的域条目与链接域 (link domain) 的 Branch Apple 应用站点关联文件中存储的内容进行比较,来确保您的应用支持 Universal Links。
  • Supports multiple targets: To install for a specific target, use the --target flag, or use the configuration editor to change the inferred target each time. If the target in question is an extension, the tool will add the SDK, set the keys into the Info.plist, and patch source (if it's a Messages extension, for example).
  • Includes Rake for Task Management: This gem has a rake for Task Management that is available here.
  • Fastlane Plugin: There is also a Fastlane plugin available here, should you prefer to use it instead.

先决条件

  1. Ensure that you’ve set up your Branch Dashboard using the instructions here, and have your Branch Key and Branch link domain handy.
  2. 您要与 Branch 集成的 iOS 项目。

安装(Installation)

  1. 从终端,cd 进入您的 iOS 应用的项目目录(包括 xcodeproj 文件的目录)。
  2. 类型 gem install branch_io_cli into terminal.

📘

注意

If you get an error saying that you don’t have permissions to perform this operation, try installing with sudo.

示例:在没有第三方 SDK 的项目上使用 CLI

  1. 类型 br setup into terminal, and you’ll be greeted with a few options on the following screen:
975
  1. Fill out your Branch Key from Account Settings, and your app’s link domain information from your Link Settings pages.

📘

注意

You don’t need to add your -alternate.app.link domain. The CLI will take care of that for you.

  1. 完成后,您将看到以下说明:
975
  1. If your app does not have any third party SDKs integrated, pick option 2: Set this project up to use CocoaPods and add the Branch SDK.
  2. 在修改项目之前,CLI 将确认您的输入。如果输入的内容有误,则可以选择返回并更改值:
975
  1. To make changes to your URI scheme for example, enter N to the prompt.
  2. To insert your app’s URI scheme, enter 4 into the prompt:
975 975
  1. After entering a URI scheme, enter option 19: Accept and Continue, which starts the Universal Link validation process:
975
  1. If your link domains, are found in your app's apple-app-site-association file, the rest of the process will continue as expected.
975
  1. 安装 cocoapods 之后,CLI 将安装 Branch 插件,并将来自应用的值和各种代码片段注入到项目中。
975

您都完成了!

AASA 验证器

In case you need to validate your domain, use the AASA Validator to check universal linking is set up properly.

应用索引验证器

Check your app to see if it can properly index and surface content for Firebase through our App Indexing Validator.