Skip to content

feedloop/rudder-sdk-ios

 
 

Repository files navigation

Version

What is RudderStack?

RudderStack is a customer data pipeline tool for collecting, routing and processing data from your websites, apps, cloud tools, and data warehouse.

More information on RudderStack can be found here.

RudderStack iOS SDK

The RudderStack iOS SDK allows you to integrate RudderStack to your iOS application in order to track event data from your app. After integrating this SDK, you will also be able to send this data to your preferred analytics destination/s such as Google Analytics, Amplitude, and more, via RudderStack.

Installation

RudderStack is available through CocoaPods and Carthage.

CocoaPods

To install it, simply add the following line to your Podfile:

pod 'Rudder', :git => 'https://github.com/feedloop/rudder-sdk-ios.git', :tag => 'v1.x.xx-feedloop'

Carthage

And for Carthage support add the following line to your Cartfile

github "feedloop/rudder-sdk-ios" "v1.x.xx"

Remember to include the following code in all .m and .h files where you want to refer to or use Rudder SDK classes

#import <Rudder/Rudder.h>

Initialize Client

To the initialize RSClient, put the following code in your AppDelegate.m file under the method didFinishLaunchingWithOptions:

RSConfigBuilder *builder = [[RSConfigBuilder alloc] init];
[builder withDataPlaneUrl:<DATA_PLANE_URL>];
[RSClient getInstance:<WRITE_KEY> config:[builder build]];

A shared instance of RSClient is accesible after the initialization by [RSClient sharedInstance].

Sending Events

Track

[[RSClient sharedInstance] track:@"simple_track_event"];
[[RSClient sharedInstance] track:@"simple_track_with_props" properties:@{
    @"key_1" : @"value_1",
    @"key_2" : @"value_2"
}];

Screen

[[RSClient sharedInstance] screen:@"Main" properties:@{@"prop_key" : @"prop_value"}];

Identify

[[RSClient sharedInstance] identify:@"test_user_id"
                             traits:@{@"foo": @"bar",
                                      @"foo1": @"bar1",
                                      @"email": @"test@gmail.com"}
];

Group

[[RSClient sharedInstance] group:@"sample_group_id"
                          traits:@{@"foo": @"bar",
                                   @"foo1": @"bar1",
                                   @"email": @"test@gmail.com"}
];

Alias

[[RSClient sharedInstance] alias:@"new_user_id"];

Reset

[[RSClient sharedInstance] reset];

For detailed documentation, check our documentation page.

Contact Us

If you come across any issues while configuring or using the RudderStack iOS SDK, please feel free to contact us or start a conversation on our Slack channel. We will be happy to help you.

About

Repo for RudderStack's iOS SDK. RudderStack is an open-source, warehouse-first Customer Data Pipeline and Segment-alternative. It collects and routes clickstream data and builds your customer data lake on your data warehouse.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Objective-C 96.6%
  • Swift 2.7%
  • Other 0.7%