The Velocidi iOS SDK is open-source and can be found at github.com/velocidi/velocidi-ios-objc-sdk.
To integrate VelocidiSDK into your Xcode project using CocoaPods, specify it in your
To integrate VelocidiSDK into your Xcode project using Carthage, specify it in your
carthage to build the framework and drag the built VelocidiSDK.framework into your Xcode project.
VelocidiSDK should work with any version of iOS equal or bigger than 11.0.
Initialize the VelocidiSDK with the necessary
trackingBaseUrl and the
matchBaseUrl URLs. Without this, VelocidiSDK will not work. We suggest doing this when the application launches.
iOS 14 IDFA access
In iOS 14 Apple introduces changes to the way the Advertising Identifier (IDFA) can be accessed. In particular, developers are forced to ask the user permission to access the IDFA:
The Examples folder contains two example applications ready for iOS 14, which ask for user permission before using the IDFA to execute any requests.
The Velocidi iOS SDK itself will not execute any request if the user did not allow tracking to proceed.
A tracking event will log a user action in Velocidi's CDP.
In order to send a tracking event, create an instance of
VSDKTrackingEvent. Then, call the singleton instance of
VSDKVelocidi and use the
You can also pass callback blocks that will be called when the request either succeeds or fails.
Match requests are used to link multiple identifiers in Velocidi's CDP. This way, any action made with any of the identifiers, across multiple channels (Browser, Mobile App, ...), can be associated to the same user.
In VelocidiSDK, a match request will link the user's Advertising Identifier with other provided identifiers (like an internal ID). A typical use case for this is, for instance, during the login action, to associate the user's ID with Apple's Advertising Identifier (identifier used in all the tracking event requests).
If none of the available tracking events matches your needs you can also extend
VSDKTrackingEvent and create your own.
Beware! Custom tracking events might not be interpreted by our services and will have limited functionality (logging and basic statistics). Please try to use one of the existing tracking events model classes or at least inherit from one of those classes when creating a custom event to ensure you make the most out of Velocidi's CDP.
Create a new Cocoa Touch class that inherits from
VSDKTrackingEvent (or any of the other tracking event model classes).
This new class can then be imported and used like any other tracking event:
Due to limitations of the framework we use to serialize classes to JSON (JSONModel), a Swift class that inherits from
VSDKTrackingEvent or any tracking event model class won't have its properties serialized when sending the event. To have this functionality you will have to create your custom event in Objective-C and import it into Swift:
- Create a new Cocoa Touch class.
- When prompted with the desired language, make sure to choose Objective-C. Press Next.
- After creating the class you'll be asked if you want to configure an Objective-C bridging header. Press Create Bridging Header.
- Three new files should have been created.
- Import the created custom event class in the bridging header file (AppName-Bridging-Header.h):
Add the desired fields to the custom event (see Objective-C instructions for custom events)
Use the newly created class as any other tracking event model class:
If you had any problem with importing the Objective-C class into Swift, please take a look at Apple's guide on Importing Objective-C into Swift.