iOS SDK 7.0+ quick start
Ce contenu n'est pas encore disponible dans votre langue.
Get started with the Pushwoosh iOS SDK using this quick and simple example.
What’s new in iOS SDK 7.0+
Anchor link toStarting with version 7.0, the Pushwoosh iOS SDK has been redesigned with a fully modular architecture. The SDK is now split into separate modules: PushwooshFramework, PushwooshCore, PushwooshBridge, and PushwooshLiveActivities are required for basic integration, while PushwooshForegroundPush, PushwooshVoIP, and PushwooshTVOS can be added optionally based on your needs.
This modular approach allows you to include only the features your app actually uses, reducing the final binary size and improving build times. Each module can be updated independently, making it easier to adopt new features without affecting the rest of your integration.
This release introduces native Swift Package Manager support for easier dependency management, along with improved Swift interoperability across all modules. Documentation is now embedded directly into the binary frameworks, so you can access API reference and code examples right in Xcode via Quick Help and the Developer Documentation window. New features include full support for iOS 16+ Live Activities with Dynamic Island integration, customizable foreground push notifications with animated banners and haptic feedback, enhanced VoIP capabilities, and a dedicated tvOS module for Apple TV applications.
Prerequisites
Anchor link toTo integrate the Pushwoosh iOS SDK into your app, you will need the following:
Download the example project
Anchor link toClone the example project from GitHub:
git clone https://github.com/Pushwoosh/pushwoosh-ios-sample.gitConfigure the project
Anchor link toOpen the project in Xcode.
Add
https://github.com/Pushwoosh/Pushwoosh-XCFrameworkas Swift Package Dependency.Set the bundle identifier for the main target (PushwooshSampleApp) to match your Pushwoosh project (e.g.,
com.pushwoosh.PushwooshSampleApp).Use the same bundle identifier for the NotificationService target, appending
.NotificationService(e.g.,com.pushwoosh.PushwooshSampleApp.NotificationService).In
Info.plist, set the:Pushwoosh_APPIDkey to the Pushwoosh Application CodePushwoosh_API_TOKENkey to the Pushwoosh Device API Token
Important: Be sure to give the token access to the right app in your Pushwoosh Control Panel. Learn more
Run the project
Anchor link to- Build and run the project.
- The app will have two tabs: “Actions” and “Settings”. Navigate to the Settings tab.
- Tap the Register for Pushes button.
- Grant permission for push notifications. The device will be registered with Pushwoosh.
You should see a log entry like this:
Pushwoosh: Initializing application runtime[PW] BUNDLE ID: __YOUR_BUNDLE_ID__[PW] APP CODE: __YOUR_APP_CODE__[PW] PUSHWOOSH SDK VERSION: 7.0.0[PW] HWID: __YOUR_HWID__[PW] PUSH TOKEN: (null)[PW] [I] -[PWNotificationManagerCompatiOS10] NotificationCenter authorization granted: 1[PW] [I] -[PWPushNotificationsManagerCommon] Registered for push notifications: __YOUR_PUSH_TOKEN__Your device is now registered with Pushwoosh.
Send a push notification
Anchor link toGo back to the Pushwoosh Control Panel and send a push notification to your registered device.
Migrating from SDK 6.x
Anchor link toIf you’re upgrading from SDK version 6.x, the main change is how you access the Pushwoosh instance. In version 7.0+, use Pushwoosh.configure instead of Pushwoosh.sharedInstance():
Before (6.x):
Pushwoosh.sharedInstance().registerForPushNotifications()Pushwoosh.sharedInstance().delegate = selfAfter (7.0+):
Pushwoosh.configure.registerForPushNotifications()Pushwoosh.configure.delegate = selfAll other APIs remain the same, so updating your code requires only replacing sharedInstance() with configure throughout your project.
What’s next
Anchor link toTo learn more, please refer to the basic integration guide