Skip to content

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.

License

Notifications You must be signed in to change notification settings

IFTTT/rudder-sdk-ios

 
 

Repository files navigation

Version

RudderStack iOS SDK

RudderStack's iOS SDK lets you track event data from your iOS applications. After integrating the SDK, you will be able to send the event data to your preferred destination/s such as Google Analytics, Amplitude, and more.

For detailed documentation on the iOS SDK, click here.

Installing the iOS SDK

The iOS SDK is available through CocoaPods and Carthage.

CocoaPods

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

pod 'Rudder', '1.0.24'

Carthage

For Carthage support, add the following line to your Cartfile:

github "rudderlabs/rudder-sdk-ios" "v1.0.24"

Remember to include the following code in all .m and .h files where you want to refer to or use the RudderStack SDK classes, as shown:

#import <Rudder/Rudder.h>

Initializing the RudderStack client

To the initialize RSClient, place 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, click here.

Contact us

For more information on using the RudderStack iOS SDK, you can contact us or start a conversation on our Slack channel.

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

No packages published

Languages

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