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.
- Ensure that you’ve set up your Branch Dashboard using the instructions here, and have your Branch Key and Branch link domain handy.
- 您要与 Branch 集成的 iOS 项目。
- 从终端，cd 进入您的 iOS 应用的项目目录（包括 xcodeproj 文件的目录）。
gem install branch_io_cliinto terminal.
If you get an error saying that you don’t have permissions to perform this operation, try installing with sudo.
br setupinto terminal, and you’ll be greeted with a few options on the following screen:
- 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.
- 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.
- 在修改项目之前，CLI 将确认您的输入。如果输入的内容有误，则可以选择返回并更改值：
- To make changes to your URI scheme for example, enter N to the prompt.
- To insert your app’s URI scheme, enter 4 into the prompt:
- After entering a URI scheme, enter option 19: Accept and Continue, which starts the Universal Link validation process:
- If your link domains, are found in your app's apple-app-site-association file, the rest of the process will continue as expected.
- 安装 cocoapods 之后，CLI 将安装 Branch 插件，并将来自应用的值和各种代码片段注入到项目中。
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.
Updated 4 months ago