Swiftpack.co -  rudderlabs/rudder-sdk-ios as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
rudderlabs/rudder-sdk-ios
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.
.package(url: "https://github.com/rudderlabs/rudder-sdk-ios.git", from: "v1.0.19")

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', '1.0.19'

Carthage

And for Carthage support add the following line to your Cartfile

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

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.

GitHub

link
Stars: 10
Last commit: 1 week ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

Release v1.0.3
1 year ago

Changes

  • Updated naming conventions for mitigating conflicts with files of the application
  • Added example project written in Swift
  • Added support for NSNull, NSDate, NSURL along with the existing support for NSString, NSNumber, NSDictionary, NSArray for properties and traits
  • Added support for passing dataPlaneUrl as NSRUL in RSConfig
  • Critical bug fixes and improvements

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API