/ios-segment-integration

Batch's iOS SDK integration with Segment.com

Primary LanguageObjective-CMIT LicenseMIT

Batch Segment Integration

Deprecation notice

This integraion has been deprecated and does not work with recent Segment SDKs. Please contact us for more info on how to connect Segment and Batch depending on your usecase.

======================================

Version License

Batch.com integration for analytics-ios.

Installation

To install the Segment-Batch Analytics integration, simply add this line to your CocoaPods Podfile:

pod 'Segment-Batch'

Usage

After adding the dependency, you must register the integration with our SDK. To do this, import the Google Analytics integration in your AppDelegate:

#import <Segment-Batch/SEGBatchIntegrationFactory.h>

And add the following lines:

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

Or, in Swift:

@import Segment_Batch
[...]

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

Note: If you previously used the "StaticLibWorkaround" subspec, please use the standard spec from now on (Cocoapods 1.4.0 is required). The workaround is no longer needed.

Disabling configuration and start handling

If you'd like to disable the remote configuration and control yourself Batch's settings and when startWithApiKey is called, you can tell the segment integration to only worry about Analytics:

SEGBatchIntegrationFactory.enableAutomaticStart = false;

Note: This is required for some features like the manual integration