setAllowConnection static method

  1. @Deprecated("Use setAllowInternetConnection instead")
void setAllowConnection(
  1. bool allowInternetConnection, {
  2. bool canDoAutoUpdateResources = true,
  3. void onConnectionStatusUpdatedCallback(
    1. bool isConnected
    )?,
  4. void onConnectionStatusUpdated2Callback(
    1. ServiceGroupType serviceType,
    2. bool isConnected
    )?,
  5. void onTopicNotificationsStatusUpdatedCallback(
    1. bool isAvailable
    )?,
  6. void onWorldwideRoadMapSupportDisabledCallback(
    1. Reason reason
    )?,
  7. void onWorldwideRoadMapSupportStatusCallback(
    1. Status status
    )?,
  8. void onWorldwideRoadMapSupportEnabledCallback()?,
  9. void onResourcesReadyToDeployCallback()?,
  10. void onOnlineCacheSizeChangeCallback(
    1. int size
    )?,
  11. void onWorldwideRoadMapVersionUpdatedCallback()?,
  12. void onAvailableContentUpdateCallback(
    1. ContentType type,
    2. Status status
    )?,
  13. void onWorldwideRoadMapUnsupportedCapabilitiesCallback()?,
  14. void onApiTokenRejectedCallback()?,
  15. void onApiTokenUpdatedCallback()?,
  16. void onLoginStatusUpdatedCallback(
    1. bool isLoggedIn
    )?,
})

Allow/deny internet connection.

Parameters

  • IN allowInternetConnection Set if the SDK can connect to the internet
  • IN canDoAutoUpdateResources Set if the SDK can auto-update resources (icons, translations, etc.)
  • IN onConnectionStatusUpdatedCallback Callback which is triggered when the connection status is updated. Provides the internet connection status
  • IN onConnectionStatusUpdated2Callback Callback which is triggered when the connection status is updated for each type of service group. Provides the internet connection status and the group
  • IN onTopicNotificationsStatusUpdatedCallback Callback which is triggered when the topic notification connection status is updated. Provides the internet connection status
  • IN onWorldwideRoadMapSupportDisabledCallback Callback that notifies that the worldwide road map support is disabled. Provides the reason
  • IN onWorldwideRoadMapSupportStatusCallback Callback that notifies that the worldwide road map support is updated. Provides the reason
  • IN onWorldwideRoadMapSupportEnabledCallback Callback that notifies that the worldwide road map support is enabled
  • IN onResourcesReadyToDeployCallback Callback that triggers when the resources (icons, translations, etc.) are ready to be deployed after the update.
  • IN onOnlineCacheSizeChangeCallback Callback that notifies that offboard cache changed size.
  • IN onWorldwideRoadMapVersionUpdatedCallback Callback that notifies that the worldwide road map version was updated.
  • IN onAvailableContentUpdateCallback Callback that notifies about existing content update. Provides information about the content type and the status.
  • IN onWorldwideRoadMapUnsupportedCapabilitiesCallback Callback that notifies that current SDK doesn't support all worldwide road map capabilities.
  • IN onApiTokenRejectedCallback Callback that notifies that current API token was rejected.
  • IN onApiTokenUpdatedCallback Callback that notifies that current API token was updated.
  • IN onLoginStatusUpdatedCallback Callback that notifies that social login state changed.

Throws

  • An exception if it fails.

Implementation

@Deprecated("Use setAllowInternetConnection instead")
static void setAllowConnection(
  bool allowInternetConnection, {
  bool canDoAutoUpdateResources = true,
  void Function(bool isConnected)? onConnectionStatusUpdatedCallback,
  void Function(ServiceGroupType serviceType, bool isConnected)?
      onConnectionStatusUpdated2Callback,
  void Function(bool isAvailable)? onTopicNotificationsStatusUpdatedCallback,
  void Function(Reason reason)? onWorldwideRoadMapSupportDisabledCallback,
  void Function(Status status)? onWorldwideRoadMapSupportStatusCallback,
  void Function()? onWorldwideRoadMapSupportEnabledCallback,
  void Function()? onResourcesReadyToDeployCallback,
  void Function(int size)? onOnlineCacheSizeChangeCallback,
  void Function()? onWorldwideRoadMapVersionUpdatedCallback,
  void Function(ContentType type, Status status)?
      onAvailableContentUpdateCallback,
  void Function()? onWorldwideRoadMapUnsupportedCapabilitiesCallback,
  void Function()? onApiTokenRejectedCallback,
  void Function()? onApiTokenUpdatedCallback,
  void Function(bool isLoggedIn)? onLoginStatusUpdatedCallback,
}) {
  offBoardListener.isAutoUpdateForResourcesEnabled = canDoAutoUpdateResources;
  offBoardListener.registerOnConnectionStatusUpdated(
    onConnectionStatusUpdatedCallback,
  );
  offBoardListener.registerOnConnectionStatusUpdated2(
    onConnectionStatusUpdated2Callback,
  );
  offBoardListener.registerOnTopicNotificationsStatusUpdated(
    onTopicNotificationsStatusUpdatedCallback,
  );
  offBoardListener.registerOnWorldwideRoadMapSupportDisabled(
    onWorldwideRoadMapSupportDisabledCallback,
  );
  offBoardListener.registerOnWorldwideRoadMapSupportStatus(
    onWorldwideRoadMapSupportStatusCallback,
  );
  offBoardListener.registerOnWorldwideRoadMapSupportEnabled(
    onWorldwideRoadMapSupportEnabledCallback,
  );
  offBoardListener.registerOnResourcesReadyToDeploy(
    onResourcesReadyToDeployCallback,
  );
  offBoardListener.registerOnOnlineCacheSizeChange(
    onOnlineCacheSizeChangeCallback,
  );
  offBoardListener.registerOnWorldwideRoadMapVersionUpdated(
    onWorldwideRoadMapVersionUpdatedCallback,
  );
  offBoardListener.registerOnAvailableContentUpdate(
    onAvailableContentUpdateCallback != null
        ? (ContentType type, Status status) =>
            onAvailableContentUpdateCallback(type, status)
        : null,
  );
  offBoardListener.registerOnApiTokenRejected(onApiTokenRejectedCallback);
  offBoardListener.registerOnApiTokenUpdated(onApiTokenUpdatedCallback);
  offBoardListener.registerOnLoginStatusUpdated(onLoginStatusUpdatedCallback);

  GemKitPlatform.instance.registerEventHandler(
    offBoardListener.id,
    offBoardListener,
  );

  staticMethod(
    'SdkSettings',
    'setAllowConnection',
    args: <String, dynamic>{
      'allow': allowInternetConnection,
      'listener': offBoardListener.id,
    },
  );
}