Segment-Batch 2.0.0

Segment-Batch 2.0.0

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布上次发布2020年10月

Arnaud Barisain-Monrose 维护。



  • Batch.com

Batch Segment Integration

Version License

为 analytics-ios 提供的 Batch.com 集成。

安装

要安装 Segment-Batch 分析集成,只需将以下行添加到您的 CocoaPods Podfile

pod 'Segment-Batch'

使用方法

添加依赖项后,您必须使用我们的 SDK 注册集成。为此,将 Google Analytics 集成导入您的 AppDelegate

#import <Segment-Batch/SEGBatchIntegrationFactory.h>

并添加以下行

SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"MySegmentWriteKey"];
[config use:[SEGBatchIntegrationFactory instance]];
[SEGAnalytics setupWithConfiguration:config];

或者,在 Swift 中

@import Segment_Batch
[...]

let segConfig = SEGAnalyticsConfiguration(writeKey: "MySegmentWriteKey")
segConfig.use(SEGBatchIntegrationFactory.instance())
SEGAnalytics.setup(with: segConfig)

注意:如果您之前使用了 "StaticLibWorkaround" subspec,请从现在起使用标准 spec(需要 Cocoapods 1.4.0)。该解决方案不再需要。

禁用配置和启动处理

如果您想禁用远程配置并自行Batch设置批处理,当调用startWithApiKey时,您可以告诉片段集成只关注Analytics。

SEGBatchIntegrationFactory.enableAutomaticStart = false;

注意:此操作对于某些功能(如手动集成)是必需的。