Using Swift Package Manager

This article provides information on how to use the Swift Package Manager to set up Blueshift's iOS SDK.

Using our iOS SDK is easy. Perform the following steps to set it up in your app's Xcode project using Swift Package Manager, so that you can integrate our platform with your app.

📘

Note

This article provides information on how to set up our SDK in your iOS project using Swift Package Manager. If you want to use CocaPods or Carthage instead, see:

1. Add SDK as a dependency

Swift Package Manager is a dependency manager that is bundled with iOS. We provide our SDK through the Swift Package Manager so that you can easily add the SDK in your app's code.

You can pick one of the following methods to add the SDK as a dependency to your app's code.

A. Using the Xcode menu

  1. Open Xcode.
  2. On the Apple menu, click File > Swift Packages > Add Package Dependency.
  1. On the Choose Package Repository dialog that appears, specify this URL: https://github.com/blueshift-labs/Blueshift-iOS-SDK, and click Next. This the URL of the SDK's repository.
  2. On the Choose Package Options dialog that appears, specify the appropriate version and click Next. Blueshift's iOS SDK version 2.1.14 or later is available via the Swift Package Manager.
  3. Select BlueShift_iOS_SDK for the main application target.
    To support Blueshift's rich push notifications, add the BlueShift_iOS_Extension_SDK to the notification service extension target and click Finish.

B. Using the project's configuration

  1. Open Xcode.
  2. Select the project on the left navigation, and then click + under Swift Packages.
  1. On the Choose Package Repository dialog that appears, specify this URL: https://github.com/blueshift-labs/Blueshift-iOS-SDK, and click Next. This the URL of the SDK's repository.
  2. On the Choose Package Options dialog that appears, specify the appropriate version and click Next. Blueshift's iOS SDK version 2.1.14 or later is available via the Swift Package Manager.
  3. Select BlueShift_iOS_SDK for the main application target.
    To support Blueshift's rich push notifications, add the BlueShift_iOS_Extension_SDK to the notification service extension target and click Finish.

2. Add SDK to notification content extension

To add the BlueShift_iOS_Extension_SDK to the notification content extension, select notification content target and click on the + icon under Frameworks and Libraries.

On the Choose frameworks and libraries to add dialog that appears, select Blueshift_iOS_Extension_SDK and click Add.


3. Register your app with Blueshift

Once you set up the SDK in your Xcode project, register your app as a channel in the Blueshift web app.

Summary

  • The SDK is installed and is ready to configure
  • The Push notification adapters are set for sending push notifications.

That’s it. You can proceed to the next steps.


What’s Next

Now that you're done getting the SDK in your project, you can get started with it.

Did this page help you?