Quick start
Get started with the Pushwoosh iOS SDK using this quick and simple example
Prerequisites
To integrate the Pushwoosh iOS SDK into your app, you will need the following:
Download the example project
Clone the example project from GitHub:
git clone https://github.com/Pushwoosh/pushwoosh-ios-sample.git
Configure the project
-
Open the project in Xcode.
-
Add
https://github.com/Pushwoosh/Pushwoosh-XCFramework
as 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 thePushwoosh_APPID
key to the Pushwoosh Application Code.
Run the project
- 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: 6.7.13[PW] API TOKEN: qwer******************vbnm[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
Go back to the Pushwoosh Control Panel and send a push notification to your registered device.
What’s next
To learn more, please refer to the basic integration guide