ForkConnection

public class ForkConnection

ForkConnection should open permament connection to the backend and get reuested data from all available data sources and combine them Or would it be an overkill and not possible without storing data from other provider what will make it way harder to be HIPAA compliant?

  • Retrieves the unique application identifier.

    Declaration

    Swift

    public func getAppId() -> String
  • Undocumented

    Declaration

    Swift

    public func getAuthToken() -> String
  • Retrieves the unique end-user identifier.

    Declaration

    Swift

    public func getCustomerEndUserId() -> String?
  • Returns the URL that will receive webhook notifications.

    Declaration

    Swift

    public func getCallbackUrl() -> String?
  • Undocumented

    Declaration

    Swift

    public func storeData(
        _ forType: ForkStoreDataTypes,
        value: Double,
        date: Date? = nil,
        completion: @escaping (Result<Bool, ForkError>) -> Void
    )
  • Fetch and extracts local device raw data for the given time range.

    Declaration

    Swift

    public func fetchRawData(
        _ forType: ForkDataTypes,
        uuidString: String? = nil,
        from: Date? = nil,
        to: Date? = nil,
        completion: @escaping (Result<ForkHealthData, ForkError>) -> Void
    )

    Parameters

    forType

    The data type to make extraction for

    uuidString

    Optional ID of activity

    from

    Date, Extraction time range start date

    to

    Date, Extraction time range end date

    completion

    Callback

  • Fetch and extracts local device normalized data for the given time range.

    Declaration

    Swift

    public func fetchNormalizedData(
        _ forType: ForkDataTypes,
        uuidString: String? = nil,
        from: Date? = nil,
        to: Date? = nil,
        completion: @escaping (Result<[ForkNormalizedData], ForkError>) -> Void
    )

    Parameters

    forType

    The data type to make extraction for

    uuidString

    Optional ID of activity

    from

    Date, Extraction time range start date

    to

    Date, Extraction time range end date

    completion

    Callback

  • Extracts local device data for the given time range.

    Declaration

    Swift

    public func extractData(
        _ forType: ForkDataTypes,
        uuidString: String? = nil,
        from: Date? = nil,
        to: Date? = nil,
        completion: @escaping (Result<ForkData, ForkError>) -> Void
    )
  • Undocumented

    Declaration

    Swift

    public func extractAndPostData(
        _ forType: ForkDataTypes,
        from: Date? = nil,
        to: Date? = nil,
        completion: @escaping (Result<ForkData, ForkError>) -> Void
    )
  • Enable Background Delivery

    • If forTypes is not empty, then a daemon task is started which will listen for data updates coming from the platform and send them via webhooks in the background; the operation is not compound and each method call will override enabled background data types list;
    • If forTypes parameter is empty or null, then background data delivery is stopped for this connection if it was enabled;

    Declaration

    Swift

    public func enableBackgroundDelivery(_ forTypes: [ForkDataTypes])
  • Undocumented

    Declaration

    Swift

    public func setBackgroundDeliveryLogger(_ logger: ForkBackgroundDeliveriesLogger)
  • Undocumented

    Declaration

    Swift

    public func getBackgroundDeliveryDataTypes() -> [ForkDataTypes]?
  • Terminates any ongoing connections with Fork’s backend servers, clears any caches, and removes provided user details and tokens from the memory. Once the connection is closed, it cannot be used, and any method other than close() will throw an exception.

    Declaration

    Swift

    public func close()