BearSDK

@objc
public class BearSDK : NSObject

BearSDK. Handles configuration and initialization of BearSDK.

Requires

iOS 12.0 and later

Version

3.3.1

  • Shared instance of BearSDK.

    Note

    Do not forget to setup secret key before starting BearSDK usage.
    try? BearSDK.setSecretKey(_ secretKey: "")
    

    Declaration

    Swift

    @objc
    public static let shared: BearSDK
  • Setup secret key to configure BearSDK.

    Throws

    An error of type BearError

    Declaration

    Swift

    @objc
    public static func setSecretKey(_ secretKey: String, dev: Bool = false) throws

    Parameters

    secretKey

    BearSDK secret key

    dev

    development or production key provided? Default - false (production).

  • Registers device to receive push notifications.

    func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String) {
       BearSDK.shared.registerDevice(withFcmToken: fcmToken)
    }
    

    Declaration

    Swift

    @objc
    public func registerDevice(withFcmToken token: String)

    Parameters

    token

    Firebase Cloud Messaging token.

  • Get unique Bear device identifier.

    Declaration

    Swift

    @objc
    public var deviceId: Int { get }

    Return Value

    device id or 0 if device not registered yet.

  • The status of BearSDK resources.

    Declaration

    Swift

    @objc
    public var isLoaded: Bool { get }
  • Releases all BearSDK support resources. Ex.: default textures, initialized trackers and etc.

    Note

    once loaded Bear SDK resources will be kept until releaseResources is called. You should only release resources when user finishes enjoying augmented reality and switches to other app features.

    Declaration

    Swift

    @objc
    public func releaseResources()