---
title: "iOS example integration"
slug: "ios-example-integration"
updated: 2026-06-09T22:26:56Z
published: 2026-06-09T22:26:56Z
canonical: "docs.xtremepush.com/ios-example-integration"
stale: true
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xtremepush.com/llms.txt
> Use this file to discover all available pages before exploring further.

# iOS example integration

This page shows a full example of how a completed integration would look like.

**Swift**

```swift
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        #if DEBUG
           XPush.setSandboxModeEnabled(true)
        #endif
        XPush.register(forRemoteNotificationTypes: [.alert, .sound, .badge])
        XPush.applicationDidFinishLaunching(options: launchOptions)
        return true
    }
    func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data){
        XPush.applicationDidRegisterForRemoteNotifications(withDeviceToken: deviceToken)
    }
}
```

**Objective-C**

```objectivec
@implementation XPAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
   #ifdef DEBUG
      [XPush setSandboxModeEnabled:YES];
   #endif
       [XPush registerForRemoteNotificationTypes:XPNotificationType_Alert | XPNotificationType_Sound | XPNotificationType_Badge];
      [XPush applicationDidFinishLaunchingWithOptions:launchOptions];
    return YES;
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
	[XPush applicationDidRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
@end
```
