IDarkMatter

@objc public protocol IDarkMatter: NSObjectProtocol

The Core DarkMatter class interface. stores ids and keys for the app.

  • Returns true if DarkMatter has been successfully initialized.

    Declaration

    Swift

    var initialized: Bool
  • Stores a list of all sdk versions that have been registered. The version strings should be in the form of:: (e.g.StoreFront::1.0.0.0).

    Declaration

    Swift

    var sdkVersions: [String]
  • The shared instance of an analytics tracker that can be used for sending analytics events.

    Declaration

    Swift

    var analytics: IAnalyticsTracker?
  • Deprecated - The old mID used mostly by analytics.

    Declaration

    Swift

    var magmicID: String
  • The user id for the currently logged in user.

    Declaration

    Swift

    var userID: String
  • A UUID that identifies the device.

    Seealso

    UIDevice.identifierForVendor

    Declaration

    Swift

    var deviceID: String
  • The current game version, either manually set when DarkMatter is initialize, or automatically pulled from the HiveManager.instance.bundleVersion.

    Declaration

    Swift

    var gameVersion: String
  • Undocumented

    Declaration

    Swift

    var platformID: String
  • Undocumented

    Declaration

    Swift

    var gameID: String
  • Undocumented

    Declaration

    Swift

    var gameSecret: String
  • Undocumented

    Declaration

    Swift

    var gameKey: String
  • Undocumented

    Declaration

    Swift

    var isDebugBuild: Bool
  • The game token used for requesting the manifest.

    Declaration

    Swift

    var gameToken: String
  • A boolean value determining if analytics should be sent.

    Declaration

    Swift

    var sendAnalytics: Bool
  • Initializes the instance with the given values. gameVersion will be set to the bundle version as reported by HiveManager.instance.bundleVersion

    Declaration

    Swift

    func initialize(gameID: String, devToken: String, prodToken: String, isDebug: Bool)

    Parameters

    gameID

    The game id.

    devToken

    The game token to use for debug builds.

    prodToken

    The game token to use for non debug builds.

    isDebug

    true if this is a debug build.

  • Initializes the instance with the given values.

    Declaration

    Swift

    func initialize(gameID: String, devToken: String, prodToken: String, isDebug: Bool, gameVersion: String)

    Parameters

    gameID

    The game id.

    devToken

    The game token to use for debug builds.

    prodToken

    The game token to use for non debug builds.

    isDebug

    true if this is a debug build.

    gameVersion

    The version of the game.

  • Registers a version of a subsytem of the SDK. These will be sent to the server with any request for a manifest and are used mainly for debugging.

    Declaration

    Swift

    func addSDKVersion(_ sdkver: String)
  • Convenience method for sending an analytics event for the given DarkMatterError. The event name will be _dmError.

    Declaration

    Swift

    func logDarkMatterError(errorKey: String, error: DarkMatterError)

    Parameters

    errorKey

    The string representation of the error enum value.

    error

    The DarkMatterError object. If the error object contains a message it will be sent as a parameter with the event.

  • Convenience method for sending an analytics event for the given name, key, and parameters.

    Declaration

    Swift

    func logDarkMatterError(eventName: String, errorKey: String, customParameters: [String])

    Parameters

    eventName

    The name of the event.

    errorKey

    The string representation of the error enum value.

    customParameters

    Custom parameters to be sent with the event.