分析
用于 analytics-ios 的 Adjust 集成
安装
要安装 Segment-Adjust 集成,只需在 CocoaPods 的 Podfile
中添加此行:
pod "Segment-Adjust"
...
在添加依赖项后,您必须使用我们的 SDK 注册该集成。为此,在您的 AppDelegate
中导入 Adjust 集成
#import <Segment-Adjust/SEGAdjustIntegrationFactory.h>
并添加以下行
NSString *const SEGMENT_WRITE_KEY = @" ... ";
SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:SEGMENT_WRITE_KEY];
[config use:[SEGAdjustIntegrationFactory instance]];
[SEGAnalytics setupWithConfiguration:config];
IOS14的IDFA跟踪
- 添加AppTrackingTransparency.framework - 该框架在iOS 14及更高版本中需要,以便SDK能够封装用户的跟踪同意对话框和访问用户是否被跟踪的同意值。
- 将"Privacy - Tracking Usage Description"添加到您的app Info.plist中,其中包含一个字符串,说明跟踪用户IDFA的意图。
- 实现Adjust SDK App-tracking授权包装器,以便方便高效地将新同意状态与后端通信。一旦用户对弹出对话框做出响应,它就会使用您的回调方法进行通信。SDK还将告知后端用户的选项。
Adjust.requestTrackingAuthorizationWithCompletionHandler().then((status) {
switch (status) {
case 0:
// ATTrackingManagerAuthorizationStatusNotDetermined case
break;
case 1:
// ATTrackingManagerAuthorizationStatusRestricted case
break;
case 2:
// ATTrackingManagerAuthorizationStatusDenied case
break;
case 3:
// ATTrackingManagerAuthorizationStatusAuthorized case
break;
}
});
- 允许Segment通过实现Segment IDFA收集文档中的adSupportBlock收集IDFA。
许可证
WWWWWW||WWWWWW
W W W||W W W
||
( OO )__________
/ | \
/o o| MIT \
\___/||_||__||_|| *
|| || || ||
_||_|| _||_||
(__|__|(__|__|
The MIT License (MIT)
Copyright (c) 2016 Segment, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.