Skip to content

Packaged Integrations

Prateek Srivastava edited this page Nov 16, 2015 · 6 revisions

We're in the process of decoupling integrations from our main library. This lets partners host integrations themselves and eliminates the barrier of releasing independent updates to those integrations.

This update is an API compatible release, and the process for using our library hasn't changed significantly. The only change is how bundled integrations are picked up our library. Bundling an integration is a 2 step process:

  1. Add the integration dependency.

  2. Register it with your configuration.

Installation

First, you need to install our SDK. Use the alpha channel for now.

pod 'Analytics', '~> 3.0.2-alpha'

This will install only the Segment integration. If you need to add more integrations, add them as a dependency manually.

pod `Segment-Bugsnag`
pod `Segment-Branch`
...

Once you've setup your dependencies, you need to initialize our SDK (make sure you import all the required headers).

SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"YOUR_WRITE_KEY"];

// Add any of your bundled integrations.
config use:[SEGGoogleAnalyticsIntegrationFactory instance];
config use:[BNCBranchIntegrationFactory instance];
...

[SEGAnalytics setupWithConfiguration:config];

Quickstart

The rest of the steps are the same as before.

Quickstart

The rest of the steps are the same as before.

Migrating from v1 or v2

v3 is an API compatible release, but there are a few additional steps to bundle integrations.

  • Add the integration dependencies.
pod `Segment-Bugsnag`
pod `Segment-Branch`
...
  • Register them in your configuration when you initialize the SDK.
SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"YOUR_WRITE_KEY"];

// Add any of your bundled integrations.
config use:[SEGGoogleAnalyticsIntegrationFactory instance];
config use:[BNCBranchIntegrationFactory instance];
...

[SEGAnalytics setupWithConfiguration:config];