Swiftpack.co -  pusher/push-notifications-swift as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Swift SDK for the Pusher Beams product:
.package(url: "https://github.com/pusher/push-notifications-swift.git", from: "3.0.4")

Pusher Beams iOS & macOS SDK

Build Status codecov Documentation CocoaPods Carthage Swift Package Manager compatible Twitter

Example Code

Building and Running

Minimum Requirements

  • Swift 5.0+
  • Xcode - The easiest way to get Xcode is from the App Store, but you can also download it from developer.apple.com if you have an AppleID registered with an Apple Developer account.



CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods version 1.3.1 or newer is recommended to build Pusher Beams.

To integrate Pusher Beams into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'

# Replace `<Your Target Name>` with your app's target name.
target '<Your Target Name>' do
    pod 'PushNotifications', '~> 3.0.4'

Then, run the following command:

$ pod install


Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

Carthage version 0.26.2 or newer is recommended to build Pusher Beams.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate Pusher Beams into your Xcode project using Carthage, specify it in your Cartfile:

github "pusher/push-notifications-swift"

Continue following the steps below depending on the platform that you're building the dependency for:

  • If you're building for OS X, follow this guide.
  • If you're building for iOS, tvOS, or watchOS, follow this guide.

Swift Package Manager

Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

Manual Xcode integration

To integrate Pusher Beams into your Xcode project using Swift Package Manager, in your Xcode choose File > Swift Packages > Add Package Dependency... and provide the following URL:


Swift Package Manager dependency

To add Pusher Beams as a dependency of your own package use the follwing code:

dependencies: [
    .package(url: "https://github.com/pusher/push-notifications-swift.git", from: "3.0.4")

Migrating from 2.x.x to 3.x.x

We now require you to start beams before you can use the library, for example to register any interests. This means the following code would no longer work and log an error to the console:

try! PushNotifications.shared.addDeviceInterest("donuts")

You now need to replace it with the following:

try! PushNotifications.shared.addDeviceInterest("donuts")

We recommend start is always called in the application didFinishLaunchingWithOptions callback. Note that you can still control when you show the request for push notification prompt, start does not call this prompt.

Running Tests

Generating Test Coverage Reports

We're using Slather for generating test coverage reports locally and Codecov when pull requests are submitted.

Using Slather

Create a report as static html pages by running:

slather coverage --html --scheme PushNotifications --workspace PushNotifications.xcworkspace/ PushNotifications/PushNotifications.xcodeproj/

Open the html reports:

open 'html/index.html'

Pusher Beams Reference

  • Autogenerated reference docs.
  • Pusher Beams iOS SDK docs.


  • Found a bug? Please open an issue.
  • Have a feature request. Please open an issue.
  • If you want to contribute, please submit a pull request (preferrably with some tests).


Pusher Beams is owned and maintained by Pusher.


Pusher Beams is released under the MIT license. See LICENSE for details.


Stars: 30
Last commit: 19 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API