Skip to content

Instantly share code, notes, and snippets.

@sperand-io
Last active December 9, 2015 18:56
Show Gist options
  • Select an option

  • Save sperand-io/03c18ed2e633ec7e274b to your computer and use it in GitHub Desktop.

Select an option

Save sperand-io/03c18ed2e633ec7e274b to your computer and use it in GitHub Desktop.
Installing V2 of Segment's iOS SDK

To build the SDK to be small and use the integrations server-side only, add the following to your Podfile:

  pod 'Analytics/Segmentio', '~> 2.0.9'
  ... and to add any individual bundled integrations:
  pod 'Analytics/GoogleAnalytics'
  pod 'Analytics/Mixpanel'
  ... // the subspecs for additional bundled integrations are all listed here:
  ... // https://github.com/CocoaPods/Specs/blob/master/Specs/Analytics/2.0.9/Analytics.podspec.json

Then in your application delegate's - application:didFinishLaunchingWithOptions: method, setup the SDK like so:

  [SEGAnalytics setupWithConfiguration:[SEGAnalyticsConfiguration configurationWithWriteKey:@"YOUR_WRITE_KEY"]];

And of course, import the SDK in the files that you use it with:

  #import <Analytics/Analytics.h>

Now that the SDK is installed and setup, you're ready to use its methods, documented in the library reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment