Want to Contribute?
The Mixpanel library for iOS is an open source project, and we'd love to see your contributions! We'd also love for you to come and work with us! Check out http://boards.greenhouse.io/mixpanel/jobs/25226#.U_4JXEhORKU for details.
If you are using Swift, we recommend our Swift Library (currently supports the tracking and people API).
Mixpanel supports CocoaPods
for easy installation.
To Install, see our full documentation »
pod 'Mixpanel'
pod 'Mixpanel-AppExtension'
Mixpanel also supports Carthage
to package your dependencies as a framework.
Check out the Carthage docs » for more info.
To integrate Mixpanel into your Xcode project using Carthage, specify it in your Cartfile
:
github "mixpanel/mixpanel-iphone"
Run carthage update
to build the framework and drag the built Mixpanel.framework
into your Xcode project.
To help users stay up to date with the latests version of our iOS SDK, we always recommend integrating our SDK via CocoaPods, which simplifies version updates and dependency management. However, there are cases where users can't use CocoaPods. Not to worry, just follow these manual installation steps and you'll be all set.
Add Mixpanel as a submodule to your local git repo like so:
git submodule add git@github.com:mixpanel/mixpanel-iphone.git
Now the Mixpanel project and its files should be in your project folder!
Add the "Mixpanel" folder from the "mixpanel-iphone" to your Xcode project's folder:
And drag and drop the Mixpanel folder into your Xcode Project Workspace:
Add all dependencies of the Mixpanel SDK to your app. The full list of necessary frameworks and libraries on lines 16-17 in the "Mixpanel.podspec" file in the "mixpanel-iphone" directory:
Import "Mixpanel.h" into AppDelegate.m, and initialize Mixpanel within application:didFinishLaunchingWithOptions:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[Mixpanel sharedInstanceWithToken:MIXPANEL_TOKEN];
}
You're done! You've successfully integrated the Mixpanel SDK into your app. To stay up to speed on important SDK releases and updates watch our iPhone repository on Github.
Have any questions? Reach out to support@mixpanel.com to speak to someone smart, quickly.