Integrate the iOS SDK

Use the Xtremepush SDK to integrate your iOS App with the Platform

  1. To initialise Xtremepush you must modify your Application Delegate. Inside application didFinishLaunchingWithOptions add the following code to import the XPush SDK:
import XPush
#import <XPush/XPush.h>
  1. Inside applicationDidFinishLaunching:withOptions add the following, replacing XPUSH_APP_KEY with the SDK application key provided when adding the app to the platform :
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {    
    XPush.setAppKey("XPUSH_APP_KEY")
    XPush.applicationDidFinishLaunching(options: launchOptions)    
    return true
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [XPush setAppKey: @"XPUSH_APP_KEY"];
    [XPush applicationDidFinishLaunchingWithOptions:launchOptions];
}
  1. In case your project is provisioned in US region add the following code after XPush.setAppKey:
XPush.setServerURL("https://sdk.us.xtremepush.com")
[XPush setServerURL: @"https://sdk.us.xtremepush.com"];

Add description for CoreBluetooth

Since iOS 10 NSBluetoothPeripheralUsageDescription is required to be set if your app includes CoreBluetooth, even if it is not actively used. As the Xtremepush SDK includes CoreBluetooth you must add the NSBluetoothPeripheralUsageDescription key and associated usage description to your Info.plist file.

This usage description is only used when Acts as a Bluetooth LE accessory is added to background modes. The Xtremepush SDK does not use this mode, and iBeacon support is only enabled by following the instructions in iOS location permissions. Unless you use Acts as a Bluetooth LE accessory elsewhere in your app, this will not be shown to the user.

Failure to include this description key will result in an automated rejection when uploading your app to the App Store and an email notification similar to the one below:

Updated 4 months ago



Integrate the iOS SDK


Use the Xtremepush SDK to integrate your iOS App with the Platform

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.