Device

public class Device : ModelObject

Representation of a device the app is running on.

Remark

This class can only be initialized once per server. Use the factory method deviceForServer(_:) to get an already created instance or create one if there is no device object instance created already.
  • Device name

    Declaration

    Swift

    @objc
    public internal(set) dynamic var deviceName: String
  • Device ID

    Declaration

    Swift

    @objc
    public internal(set) dynamic var deviceId: String
  • Server device ID

    Declaration

    Swift

    @objc
    public internal(set) dynamic var serverDeviceId: String?
  • Device’s system name

    Declaration

    Swift

    @objc
    public internal(set) dynamic var systemName: String
  • Device model

    Declaration

    Swift

    @objc
    public internal(set) dynamic var model: String?
  • The Apple’s push notification token associated with the device.

    Declaration

    Swift

    @objc
    public internal(set) dynamic var apnsToken: String?
  • Boolean indicating whether the Device instance is the current device the app is running on.

    Declaration

    Swift

    @objc
    public private(set) dynamic var isCurrentDevice: Bool
  • Fetches the device object associated with a server or creates a new one if none exists.

    Declaration

    Swift

    public static func deviceForServer(_ server: Server?) -> Device?
    Parameters
    server

    Server instance.

    Return Value

    A Device object.