---
title: PingOne Protect SDK for iOS
description: Using the iOS version of the SDK involves the following steps:
component: pingone-api
page_id: pingone-api:native-sdks:pingone-risk-sdks/risk_evaluation_sdk_ios
canonical_url: https://developer.pingidentity.com/pingone-api/native-sdks/pingone-risk-sdks/risk_evaluation_sdk_ios.html
section_ids:
  pingone-signals-protect-sdk-for-ios-version-5-3-0: PingOne Signals (Protect) SDK for iOS (version 5.3.0)
  adding-the-sdk-to-your-app: Adding the SDK to your app
  adding-the-sdk-to-your-app-using-cocoapods: Adding the SDK to your app using CocoaPods
  adding-the-sdk-to-your-app-using-swift-package-manager: Adding the SDK to your app using Swift Package Manager
  sdk-initialization: SDK initialization
  getting-the-data-for-risk-assessment: Getting the data for risk assessment
---

# PingOne Protect SDK for iOS

## PingOne Signals (Protect) SDK for iOS (version 5.3.0)

Using the iOS version of the SDK involves the following steps:

* Adding the SDK to your app using CocoaPods or Swift Package Manager

* Importing the SDK module

* Initializing the SDK

* Getting the data for risk assessment

### Adding the SDK to your app

#### Adding the SDK to your app using CocoaPods

If you're new to CocoaPods, refer to the [official documentation](https://guides.cocoapods.org/using/using-cocoapods) for information on how to create and use Podfiles.

Open your project's Podfile and add the following to your app's target:

|   |                                                                                                                                           |
| - | ----------------------------------------------------------------------------------------------------------------------------------------- |
|   | Update the pod version to match the version of the PingOne Signals SDK for iOS that you are using. Currently the latest version is 5.3.0. |

`pod 'PingOneSignals', '~> 5.3.0'`

Run pod install from the command line:

`pod install`

#### Adding the SDK to your app using Swift Package Manager

1. Select File > Add Packages…​ in Xcode's menu bar.

2. Search for the PingOne Signals SDK using the repo's URL: <https://github.com/pingidentity/pingone-signals-sdk-ios>

3. Set the Dependency Rule to Branch with the value 'main' or select an exact version, and make sure that `Add to Project` is set to your project.

4. Select `Add Package`.

5. Verify that the package was downloaded in your project.

### SDK initialization

Initialize the SDK. You'll typically do this in your app's `application:didFinishLaunchingWithOptions:` method, or any other entry point during your application launch. For example:

```none
import PingOneSignals

let initParams = POInitParams()
initParams.envId = <envId> // optional
// If you are using the PingFed authentication API and version 1.3 of the Integration Kit, uncomment the following line to turn off the collection of behavioral data
// initParams.behavioralDataCollection = false
let pingOneSignals = PingOneSignals.initSDK(initParams: initParams)

pingOneSignals.setInitCallback { error in
    if let error = error {
        print("Init failed - \(error.localizedDescription)")
    } else {
        print("SDK Initialized")
    }
}
```

|   |                                                                                                                   |
| - | ----------------------------------------------------------------------------------------------------------------- |
|   | The code above contains the String placeholder <\`envId\`>. Replace this with the ID of your PingOne environment. |

Optionally, set an event listener to get calls on successful or failed SDK initialization.

### Getting the data for risk assessment

Get the data for risk assessment by adding a call to the SDK's `getData` method, for example:

```none
import PingOneSignals

let pingOneSignals = PingOneSignals.sharedInstance()
pingOneSignals?.getData { data, error in
    if let data = data {
        print("data: \(data)")
    } else if let error = error {
        print("error getting data: \(error)")
    }
}
```
