Skip to content

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

Before using the examples, ensure you have the following:

Pushwoosh sample application

This 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

Clone the repository:

Terminal window
git clone https://github.com/Pushwoosh/pushwoosh-ios-sample.git

2. Configure the project

  1. Open the project in Xcode.
  2. Add https://github.com/Pushwoosh/Pushwoosh-XCFramework as Swift Package Dependency.
  3. Set the bundle identifier for the main target (PushwooshSampleApp) to match your Pushwoosh project (e.g., com.pushwoosh.PushwooshSampleApp).
  4. Use the same bundle identifier for the NotificationService target, appending .NotificationService (e.g., com.pushwoosh.PushwooshSampleApp.NotificationService).
  5. In Info.plist, set the Pushwoosh_APPID key to the Pushwoosh Application Code.

3. Run the project

  1. Build and run the project.
  2. Navigate to the Settings tab in the app.
  3. Tap the Register for Pushes button.
  4. Grant permission for push notifications. The device will be registered with Pushwoosh.

Pushwoosh quickstart applications

The quickstart collection includes individual projects, each showcasing specific SDK features. Use these as references or starting points for your app

1. Download the quickstart applications

Clone the example project from GitHub:

Terminal window
git clone https://github.com/Pushwoosh/pushwoosh-ios-sample.git

2. Explore the projects

Each folder contains a project tailored to a specific feature:

3. Configure and run

  1. Open the project in Xcode.
  2. Set the bundle identifier to match your Pushwoosh project.
  3. Copy the Application Code from the Pushwoosh Dashboard.
  4. In Info.plist, set the Pushwoosh_APPID key to the Application Code
  5. Build and run the project.
  6. Use the Pushwoosh Control Panel to send a push notification and see it in action.