Integration
The P101XP SDK is fully implemented in Swift
Attention starting with sdk version 1.53.17, the P101XP class has been renamed to P101XPSDK.
To integrate 101XP Mobile SDK into your app please perform the following actions:
- Get the latest version of SDK using CocoaPods (iOS)
- Integrate SDK into your application. The integration may be partial, however, some modules must be integrated: Authorization, Billing, Analytics and Firebase Crashlytics.
CocoaPods
1. To setup CocoaPods, please use the script setup_sdk_stage.sh or setup_sdk_release.sh (please, ask your release manager if you're not sure which script you want)
$ chmod +x setup_sdk_release.sh
$ ./setup_sdk_release.sh
2. Then, if you don't have Podfile, create it by running the command in the project's directory.
$ pod init
3. Add parameters plugin and pod 'P101XP' to your Podfile
platform :ios, '15.0'
plugin 'cocoapods-art', :sources => [
'p101xp-release'
]
source ’https://github.com/CocoaPods/Specs.git'
target 'P101XP-sample' do
use_frameworks!
pod 'P101XP'
end
post_install do | installer |
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
config.build_settings["DEVELOPMENT_TEAM"] = "DC7LZQ72AT"
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
While adding parameters to the Podfile, make sure use_frameworks! is not commented and platform :ios, '13.0' is added
4. Install pod for 101XP SDK and open the .xcworkspace file with the project.
$ pod repo-art update p101xp-release
$ pod install
$ open P101XP-sample.xcworkspace
4. To build on the simulator, you need to add to Excluded Architectures:

Importing 101XP SDK into Objective-C
- Under Build Settings, in Packaging, make sure the Defines Module setting for that framework target is set to Yes.
- Import the Swift code from that framework target into any Objective-C .m file within that target using this syntax and substituting the appropriate names.
1. Because the SDK uses UIWindowSceneDelegate, you must add the UIApplicationSceneManifest key to your Info.plist configuration file:
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
2. To ensure proper SDK functionality, it is necessary to conform to the UIApplicationDelegate and UIWindowSceneDelegate protocols and implement the required methods:
// AppDelegate.h
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
@interface SceneDelegate : UIResponder <UIWindowSceneDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
// AppDelegate.m
#import <P1010XP/P1010XP-Swift.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
return [P101XPSDK didFinishLaunchingWithOptions:application options:launchOptions];
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler {
[P101XPSDK didReceiveRemoteNotification: userInfo completionHandler:completionHandler];
}
- (void)applicationWillTerminate:(UIApplication *)application {
[P101XPSDK sceneWillTerminate];
}
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return [P101XPSDK supportedInterfaceOrientationsWithWindow:window];
}
@end
@implementation SceneDelegate
- (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts {
[P101XPSDK sceneOpenUrl: URLContexts];
}
- (void) scene:(UIScene *) scene continueUserActivity:(NSUserActivity *) userActivity {
[P101XPSDK sceneUserActivity:userActivity];
}
- (void)sceneDidEnterBackground:(UIScene *)scene {
[P101XPSDK sceneDidEnterBackground];
}
- (void)sceneDidBecomeActive:(UIScene *)scene {
[P101XPSDK sceneDidBecomeActive];
}
- (void)sceneWillEnterForeground:(UIScene *)scene {
[P101XPSDK sceneWillEnterForeground];
}
@end
3. For feedback communication with the SDK, your application must conform to the P101XPDelegate protocol and implement all required methods:
// ViewController.h
#import <P1010XP/P1010XP-Swift.h>
@interface ViewController : UIViewController <P101XPDelegate>
// ViewController.m
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[P101XPSDK initialize:self];
}
Updating 101XP SDK via CocoaPods
To update 101XP SDK you can run the script from the project directory with your Podfile:
./setup_sdk_release.sh
Or with the following commands:
$ pod repo-art update p101xp-release
$ pod update
List of required permissions
Add the following permissions to the application Info.plist:
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library.</string>
<key>NSCameraUsageDescription</key>
<string>This app requires access to the camera.</string>
<key>NSCalendarsUsageDescription</key>
<string>Advertising</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Advertising</string>
Localization
Add to your Info.plist for English, Russian support:
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>ru</string>
</array>