SAPcpmsDestinations

open class SAPcpmsDestinations

Loads the configured destination name(s) and path(s) from SAP Mobile Services.

This sample code demonstrates how to create an SAPcpmsDestinations instance:

var urlSession = SAPURLSession()
let settingsParameters = SAPcpmsSettingsParameters(backendURL: <#URL only with domain#>, applicationID: <#appid#>)
let destinations = SAPcpmsDestinations(sapURLSession: urlSession, settingsParameters: settingsParameters)
  • Initializer for using SAPURLSession and the service url as an input

    Declaration

    Swift

    public init(sapURLSession: SAPURLSession, destinationsServiceUrl: URL)

    Parameters

    sapURLSession

    an SAPURLSession implementation that can be used to communicate with the SAP Mobile Services

    endpointsServiceUrl

    the full URL of the endpoints service

  • Initializer for using SAPURLSession and SAPcpmsSettingsParameters as an input

    Declaration

    Swift

    public convenience init(sapURLSession: SAPURLSession, settingsParameters: SAPcpmsSettingsParameters)

    Parameters

    sapURLSession

    an SAPURLSession implementation that can be used to communicate with the SAP Mobile Services

    settingsParameters

    SAPcpms settings metadata to be able to concatenate the SAPcpms service URL; The ‘backendURL’ and the ‘applicationID’ are used from this parameter.

  • Loads the configured destination(s) from mobile services.

    Declaration

    Swift

    open func load(completionHandler: @escaping ([String : String]?, Error?) -> Void)

    Parameters

    completionHandler

    called when the result received from the server on background queue. In a successful case the error parameter is nil.

  • Loads the configured destination(s) from mobile services and adds to the settingsParameters.

    Declaration

    Swift

    open func load(to settingsParameters: SAPcpmsSettingsParameters, completionHandler: @escaping (SAPcpmsSettingsParameters?, Error?) -> Void)

    Parameters

    settingsParameters

    settingsParameters which will be updated with the destinations

    completionHandler

    called when the result received from the server. In a successful case the error parameter is nil.