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.identifierForVendorDeclaration
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.
gameVersionwill be set to the bundle version as reported byHiveManager.instance.bundleVersionDeclaration
Swift
func initialize(gameID: String, devToken: String, prodToken: String, isDebug: Bool)Parameters
gameIDThe game id.
devTokenThe game token to use for debug builds.
prodTokenThe game token to use for non debug builds.
isDebugtrueif 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
gameIDThe game id.
devTokenThe game token to use for debug builds.
prodTokenThe game token to use for non debug builds.
isDebugtrueif this is a debug build.gameVersionThe 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
errorKeyThe string representation of the error enum value.
errorThe 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
eventNameThe name of the event.
errorKeyThe string representation of the error enum value.
customParametersCustom parameters to be sent with the event.
IDarkMatter Protocol Reference