Latest 0.0.2
License Apache License, Version 2.0
Platforms ios 9.0, requires ARC
Frameworks Foundation, UIKit, WebKit, AdSupport

architecture overview

CocoaPods Compatible
Xcode 9.0
iOS 9.0+
Swift 4.0


  • Xcode 9.0+
  • iOS 9.0+


UserReport iOS SDK can be installed in various ways.


CocoaPods is a centralized dependency manager for
Objective-C and Swift. Go here
to learn more.

  1. Add the project to your Podfile.

    pod 'UserReport'
  2. Run pod install and open the .xcworkspace file to launch Xcode.
  3. Import the UserReport framework.

    import UserReport


To install it manually drag the UserReport project into your app project in Xcode or add it as a git submodule.
In your project folder enter:

$ git submodule add [email protected]:AudienceProject/userreport-ios-sdk.git



Configure UserReport iOS SDK via SAK_ID, MEDIA_ID (You can find these values on media setting page) and information about user.

// Create user object
let user = User() = "[email protected]"

// You can also specify a email hash
user.emailMd5 = "MD5_EMAIL_HASH"
user.emailSha1 = "SHA1_EMAIL_HASH"
user.emailSha256 = "SHA256_EMAIL_HASH"

// Provide additional social network information
user.facebookId = "FACEBOOK_ID"

// Configure
UserReport.configure(sakId: "YOUR_SAK_ID", mediaId: "YOU_MEDIA_ID", user: user)

Screen tracking


To manually measure the screen view, use the method trackScreen().

class ViewController: UIViewController {
    override open func viewDidAppear(_ animated: Bool) {

        // Tracking screen view


If you want to automatically measure views as screens using the UserReportViewController class.

class ViewController: UserReportViewController {

Display mode

The survey can be appear in two ways:

  • .alert – show survey like an alert view (Default)
  • .fullScreen – show survey in full screen mode, like the modal view controller

To change the display mode, please specify following:

UserReport.shared?.displayMode = .fullscreen

Change settings

To update the default rules for appear the survey use follow:

let settings = Settings()
settings.sessionScreensView = 5
settings.inviteAfterNSecondsInApp = 20



In order for the survey not to be appear on important screens, you can use a variable mute.

UserReport.shared?.mute = true

Don’t forget to return back to false.

Update user info

When changing user data, you should also send the updated data to the UserRecord iOS SDK.

let user = User() = "[email protected]"


Session info

UserReport SDK stores the data on the count of screens viewed and the time the application is used. If necessary, you can get this data from a variable session. The session contains the following values:

  • screenView – number of screen viewed in current session
  • totalScreenView – number of screen viewed in all session
  • sessionSeconds – number of seconds spent in the application for current session
  • totalSecondsInApp – number of seconds spent in the application for all time
  • localQuarantineDays – number of days through which the survey will be appear again
  • settings – current settings for appear the survey
// Session information about the running time of the application and screen views
let session = UserReport.shared?.session

// Get current settings for appear survey
let currentSetting = session?.settings


If you decide to show the survey yourself, then you can use the following method:



UserReport iOS SDK is released under the Apache License 2.0. See LICENSE for details.

Latest podspec

    "name": "UserReport",
    "version": "0.0.2",
    "summary": "UserReport SDK for iOS.",
    "description": "UserReport is a set of flexible tools, that tell you who your users are, and what they want to achieve.",
    "homepage": "",
    "screenshots": "",
    "license": {
        "type": "Apache License, Version 2.0",
        "file": "LICENSE"
    "authors": "AudienceProject",
    "social_media_url": "",
    "platforms": {
        "ios": "9.0"
    "source": {
        "git": "",
        "tag": "0.0.2"
    "source_files": "UserReport/UserReport/**/*.{swift}",
    "frameworks": [
    "requires_arc": true,
    "pushed_with_swift_version": "4.0"

Pin It on Pinterest

Share This