MBXOfflineSwitch


@interface MBXOfflineSwitch : NSObject

Instance that allows connecting or disconnecting the Mapbox stack to the network.

  • Connects or disconnects the Mapbox stack. If set to false, current and new HTTP requests will fail with HttpRequestErrorType#ConnectionError.

    Declaration

    Objective-C

    - (void)setMapboxStackConnectedForConnected:(BOOL)connected;

    Parameters

    connected

    Set false to disconnect the Mapbox stack

  • Provides information if the Mapbox stack is connected or disconnected via OfflineSwitch.

    Declaration

    Objective-C

    - (BOOL)isMapboxStackConnected;

    Return Value

    True if the Mapbox stack is disconnected via setMapboxStackConnected(), false otherwise.

  • Returns the OfflineSwitch singleton instance.

    Declaration

    Objective-C

    + (nonnull MBXOfflineSwitch *)getInstance;
  • Releases the OfflineSwitch singleton instance.

    Users can call this method if they want to do manual cleanup of the resources allocated by Mapbox services. If the user calls getInstance() after reset, a new instance of the OfflineSwitch singleton will be allocated.

    Declaration

    Objective-C

    + (void)reset;