Skip to main content
Version: 1.54.x

Integration

To integrate 101XP Mobile SDK into your app please perform the following actions:

  • Get the latest version of SDK (iOS)
  • Integrate SDK into your application. The integration may be partial, however, some modules must be integrated: Authorization, Billing, Analytics and Firebase Crashlytics.

Swift Package Manager (SPM) ​

1. Download the latest version of the SDK in the Download the sdk

2. Unpack the downloaded archive into the root of your project.

3. Open the project in Xcode, click “File” → “Add Package Dependencies…” → “Add Local…”.

4. In the window that appears, select the root of your project and choose the “P101XP” directory (this directory will be extracted from the archive in step 2), then click “Add Package”.

5. Congratulations! The SDK has been successfully installed!

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];
}

4. To build on the simulator, you need to add to Excluded Architectures:

Updating 101XP SDK via SPM​

To update the SDK, download the new version in the Download the sdk, and replace it in the root directory of your project.

List of required permissions​

Add the following permissions to the application Info.plist:

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, German and French support:

Info.plist
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>de</string>
<string>fr</string>
<string>ru</string>
</array>