mParticle iOS
This documentation explains how to send mParticle events to your Branch dashboard. If you'd like to send Branch installs to your mParticle dashboard, please review the Branch/mParticle Data Integration.
这些说明适用于 mParticle SDK 版本7+集成
mParticle introduced a new attribution & deep linking API in v7 of their SDK (http://docs.mparticle.com/developers/sdk/ios/getting-started/#upgrade-to-version-7-of-the-sdk), so please contact your Branch or mParticle Account Managers for more details, if you have mParticle SDK < v7 installed in your app.
iOS 11.2 上 Universal Links 行为不一致
After updating a device to iOS 11.2, we found that the app's AASA file is no longer downloaded reliably onto your user’s device after an app install. As a result, clicking on Universal links will no longer open the app consistenly. You can set forced uri redirect mode on your Branch links to open the app with URI schemes. View details of the issue on the Apple Bug report.
技术要求
iOS 14 实施
为了帮助您全面管理用户体验,Branch SDK 将不会触发 IDFA 许可弹窗。
然而,如果您选择触发这一弹窗,在可行的情况下,Branch 仍然可以收集并使用 IDFA。
Branch 设置
配置 Bundle ID
- Make sure Bundle Id matches your Branch Dashboard
确认应用前缀(App Prefix)
- From your Apple Developer Account
配置 Branch 操作后台 (Dashboard)并启用 Universal Links
- Enter a URI scheme in the Branch Dashboard and enable Universal Links
配置 Associated Domain
- Add your link domains from your Branch Dashboard
-alternate
is needed for Universal Linking with the Web SDK inside your Websitetest-
要使用 test key 时需要- If you use a custom link domain, you will need to include your old link domain, your
-alternate
link domain, and your new link domain
配置权利
- 确认 entitlement 在 TARGETS 内
设置 info.pList
info.pList
-
Add Branch Dashboard values
- 添加
branch_app_domain
with your live key domain - Add your URI scheme as
URL Types
>Item 0
>URL Schemes
- 不要将您的 API key 添加到文件中(mParticle 通过操作后台 (Dashboard)进行处理)
- 添加
mParticle 设置
在 mParticle 上启用 Branch
- Before you can enable Branch in your mParticle dashboard, you must retrieve your Branch Key on the Link Settings page of your Branch dashboard.
- Please follow mParticle's documentation on how to Connect an Event Output; i.e. enable the Branch integration.
- If you have enabled Apple Search Ads for your Branch implementation, you must also check
Enable Apple Search Ads
in the Connection Settings.
在 mParticle 操作后台 (Dashboard)中添加了工具包并配置了 Branch API Key 之后,mParticle SDK 将负责初始化 Branch SDK 并转发适当的应用 Lifecycle Event 以处理深度链接。
安装 mParticle Branch 工具包
Option 1: CocoaPods
platform :ios, '8.0'
target 'APP_NAME' do
# if swift
use_frameworks!
‘pod 'mParticle-BranchMetrics', '~> 8'
end
Option 2: Carthage
github "mparticle-integrations/mparticle-apple-integration-branchmetrics"
导入 iOS Support Libraries
AdSupport
SafariServices
MobileCoreServices
CoreSpotlight
iAd
在 mParticle 工具包中初始化 Branch
mParticle iOS SDK(版本5.4.1和更高版本)将自动调用 Branch Kit 的以下方法:
initSessionWithLaunchOptions:
内application:didFinishLaunchingWithOptions:
handleDeepLink:
内application:openURL:options:
continueUserActivity:
内application:continueUserActivity:restorationHandler:
This means mParticle will automatically handle initializing Branch sessions. However, please ensure .onAttributionComplete
is enabled in the mParticleOptions
object.
mParticle appDelegate proxy 未启用
If the mParticle appDelegate proxy is not enabled, you must add mParticle's URI & Domain relays to the appDelegate.
此时,您应该开始在 Branch 操作后台 (Dashboard)中看到 Branch 会话数据(包括安装,重新打开和所有自定义事件)。
通过 mParticle 获得深度链接数据
我们与 mParticle 的集成支持创建和归属用于安装和打开应用的深度链接。深度链接通常将包含一些其他信息,这些信息将在用户最终打开您的应用时使用,以便您可以将用户正确地导到适当的内容,或者以其他方式自定义他们的体验。
Please ensure you've followed mParticle's documentation to ensure your deep link data is being retrieved.
React Native 中的 mParticle
If you integrate mParticle in React Native, you will still integrate the Branch kit as a Native module and follow the setup steps above. However, instead of retrieving deep link data in the the native layer, you'll retrieve deep link data via mParticle's React Native function found here.
NativeLink™ Deferred Deep Linking
- Use iOS pasteboard to enable deferred deep linking via Branch NativeLink™
先决条件
Make sure the underlying iOS SDK Version is v1.39.4+
To use this feature you must:
- Enable NativeLink™ Deep Linking in the Branch Dashboard Configuration tab
or- Manually configure your Branch Link to use
$ios_nativelink
Implement one of the pasteboard opt-in options in the native iOS SDK code.
测试深度链接
- Create a deep link from the Branch Dashboard
- 从设备中删除您的应用
- 在设备上编译和测试
- Paste deep link in Apple Notes
- 长按深度链接(而不是 3D Touch)
- Click Open in "APP_NAME"to open your app
实现功能
- Please refer to mParticle's making direct calls to kits documentation for how to access the Branch kit via the mParticle SDK.
- Once you have a reference to the Branch kit, refer to Branch's native iOS SDK documentation on how to implement secondary functionality.
示例测试应用
问题排查
Please refer to the Branch iOS SDK troubleshooting section.
Updated about 2 months ago