BearSDK
@objc
public class BearSDK : NSObject
BearSDK. Handles configuration and initialization of BearSDK.
Copyright
2013-2021 ARGO SASRequires
iOS 12.0 and laterVersion
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 typeBearError
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 untilreleaseResources
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()