iOS code examples
With Pushwoosh samples for iOS, you can explore Pushwoosh functionality without integrating the SDK into your project, or review how the Pushwoosh SDK is implemented in our example projects
Prerequisites
Anchor link toBefore using the examples, ensure you have the following:
Pushwoosh sample application
Anchor link toThis project is a basic iOS application with the Pushwoosh SDK integrated, showcasing key features such as:
- Receiving push notifications.
- Tracking push notification delivery.
- Managing user tags.
- Sending events
- User registration
Use the sample app as a learning tool or a foundation for your development.
1. Download the sample app
Anchor link toClone the repository:
git clone https://github.com/Pushwoosh/pushwoosh-ios-sample.git2. Configure 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
3. Run the project
Anchor link to- Build and run the project.
- Navigate to the Settings tab in the app.
- Tap the Register for Pushes button.
- Grant permission for push notifications. The device will be registered with Pushwoosh.
Pushwoosh iOS examples
Anchor link toExplore our pushwoosh-quickstart-ios repository for fully documented code examples covering various SDK features. These samples are ready to use as references or starting points for your own projects.