To integrate your application with devtodev system please perform the following actions:
- add the application to the Space using the wizard for adding application
- download the latest version of devtodev SDK or install via CocoaPods
- integrate SDK into your application. The integration may be whether partial or including all the possibilities.
CocoaPods is the easiest way to add devtodev into your iOS project.
- Firstly, install CocoaPods using
gem install cocoapods
- Create a file in your Xcode project called Podfile and add the following:
- Download the latest version of devtodev SDK from the GitHub repository.
- Include devtodev.framework dependency:
- Link against the embedded framework:
Add devtodev.framework to the Linked Frameworks and Libraries section.
- For the correct SDK functioning add the following frameworks:
- Security.framework (Optional)
- UIKit.framework (Optional)
- UserNotifications (Optional)
Add init method into didFinishLaunchingWithOptions method of your AppDelegate.m
/** * devtodev App Id and Secret key can be found in the devtodev application * settings page (“My apps” → App Name → “Settings” → “Integration”) */ [DevToDev initWithKey:applicationId andSecretKey:secretKey];
If the application you integrate SDK in is a part of cross-platform project, then the user data initialization is required.
Since the analytics of cross-platform projects is based on an unique user (unlike the usual projects where it is based on device identifiers), you have to:
- Set the unique cross-platform user identifier (it will be used for cross-platform project data collection).
- Actualize the user data. Mostly it is about game applications where the player has a game level as a characteristic. For such projects you need to set the current player level.
We recommend you to set the user identifier before SDK initialization, otherwise the user identifier from the previous session will be used since the SDK initialization moment till the setUserID method call.
If your cross-platform application supposes to be used without cross-platform authorization, don't use the setUserID method or use the empty string ("") as the user identifier. SDK will assign the unique identifier to user. This identifier will we used until the real cross-platform identifier assigns to the user.
/** * Method allows to initialize the user. It applies when SDK initialization or user relogin. * @param NSString activeUserId - unique cross-platform user identifier (max. 64 symbols) */ [DevToDev setUserId:@"activeUserId"]; /** * Method sets the current user level. Using this method allows to actualize * the SDK user data in game cross-platform applications. * @param NSUInteger level - number of current game level of the user */ [DevToDev setCurrentLevel:level]; /** * devtodev App Id and Secret key can be found in the devtodev application * settings page (“My apps” → App Name → “Settings” → “Integration”) */ [DevToDev initWithKey:applicationId andSecretKey:secretKey];
To enable the debug mode and make SDK notifications displayed in the console use this method:
/** * @param BOOL isActive */ [DevToDev setActiveLog: (BOOL) isActive];