Session

@available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)
@objc(FritzSession)
public final class Session : NSObject

Encapsualtes your App Token and the Environment in which to send all Fritz-related requests.

Note

By default the SDK will read your App Token from the FritzToken line in your apps Info.plist. However, by providing a Session when conforming to BaseIdentifiedModel you have the ability to use models in your app that are from different Fritz accounts. This is useful if you are an SDK author and want to include Fritz as a dependency in your SDK without affecting the end-develoeprs ability to also use Fritz with their App Token.
  • Declaration

    Swift

    public struct Info : Decodable
  • Default session to use throughout SDK

    Declaration

    Swift

    @objc(defaultSession)
    public static let `default`: Session
  • App token sent on all requests

    Declaration

    Swift

    public let apiKey: String
  • Api to connect to

    Declaration

    Swift

    public let apiUrl: String
  • Namespace for local storage of Fritz files

    Declaration

    Swift

    public let namespace: String
  • Current settings for this session

    Declaration

    Swift

    public var settings: SessionSettings { get }
  • Create a session

    Declaration

    Swift

    @objc(initWithAppToken:apiUrl:namespace:)
    public init(apiKey: String, apiUrl: String, namespace: String)
  • Create a session

    Declaration

    Swift

    @objc(initWithAppToken:)
    public convenience init(apiKey: String)