-
Notifications
You must be signed in to change notification settings - Fork 22
/
PublicIdentity.swift
43 lines (40 loc) · 1.45 KB
/
PublicIdentity.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// File.swift
//
//
// Created by Yusuf Tör on 23/09/2022.
//
import Foundation
// MARK: - Identify
extension Superwall {
/// Creates an account with Superwall. This links a `userId` to Superwall's automatically generated alias.
///
/// Call this as soon as you have a `userId`.
///
/// - Parameters:
/// - userId: Your user's unique identifier, as defined by your backend system.
/// - options: An ``IdentityOptions`` object, whose property
/// ``IdentityOptions/restorePaywallAssignments`` you can set to `true`
/// to tell the SDK to wait to restore paywall assignments from the server before presenting any paywalls.
/// This should only be used in advanced use cases. If you expect
/// users of your app to switch accounts or delete/reinstall a lot, you'd set this when users log in to an
/// existing account.
public func identify(
userId: String,
options: IdentityOptions? = nil
) {
dependencyContainer.identityManager.identify(
userId: userId,
options: options
)
}
/// Objective-C-only method. Creates an account with Superwall. This links a `userId` to Superwall's automatically generated alias.
///
/// Call this as soon as you have a `userId`.
///
/// - Parameter userId: Your user's unique identifier, as defined by your backend system.
@available(swift, obsoleted: 1.0)
public func identify(userId: String) {
identify(userId: userId, options: nil)
}
}