Beamable SDK
|
This type defines the Client main entry point for the Connectivity feature. More...
Public Member Functions | |
Promise | SetHasInternet (bool hasInternet) |
Force the value of HasConnectivity. The connectivity is checked periodically, so if the given hasInternet value is not correct, the connectivity will be updated soon. If the given hasInternet value is different than the current HasConnectivity property, then the OnConnectivityChanged event will trigger as part of the execution of this method. More... | |
Promise | ReportInternetLoss () |
Force the value of HasConnectivity to be false. The connectivity is checked periodically, so if internet connectivity returns, the HasConnectivity will be updated soon. If the value of HasConnectivity used to be true, then the OnConnectivityChanged event will trigger as part of the execution of this method. More... | |
void | OnReconnectOnce (Action onReconnection) |
Run an action when the HasConnectivity value returns to true. If the HasConnectivity is already true, the action will be evaluated immediately. After connectivity is restored, and the action is executed, the action will never be executed again, even if further internet drops and restorations occur. See also the OnReconnectOnce(ConnectionCallback,int method. More... | |
void | OnReconnectOnce (ConnectionCallback promise, int order=0) |
Enqueue a Promise to run when the HasConnectivity value returns to true. If the HasConnectivity is already true, the promise will be evaluated immediately. When connectivity is restored, all of the ConnectionCallback's will be invoked, and the Promises that are created will be awaited before the SetHasInternet's return Promise is completed. More... | |
Properties | |
bool | HasConnectivity [get] |
true when Beamable thinks the current device has an internet connection. This property will update automatically as the device goes on and off line. You can sue the OnConnectivityChanged event to listen for changes in this property. | |
bool | ForceDisabled [getset] |
This property allows you to simulate network outage. When true, the Disabled property will be triggered, which forces the HasConnectivity to be false, even if the device is online. When false, it is still possible that Disabled can be triggered, if the IConnectivityServiceExtensions.GlobalForceDisabled property has been set. | |
bool | Disabled [get] |
true if the ForceDisabled property has been set to true, OR if the IConnectivityServiceExtensions.GlobalForceDisabled property has been set to true. When Disabled is true, the HasConnectivity property will be forced to false. This can be helpful to simulate network outage, even if the device is online. | |
Events | |
Action< bool > | OnConnectivityChanged |
An event that will trigger anytime the HasConnectivity status changes. | |
This type defines the Client main entry point for the Connectivity feature.
void Beamable.Api.Connectivity.IConnectivityService.OnReconnectOnce | ( | Action | onReconnection | ) |
Run an action when the HasConnectivity value returns to true. If the HasConnectivity is already true, the action will be evaluated immediately. After connectivity is restored, and the action is executed, the action will never be executed again, even if further internet drops and restorations occur. See also the OnReconnectOnce(ConnectionCallback,int method.
onReconnection | Some action to invoke when internet connectivity returns. |
Implemented in Beamable.Api.Connectivity.ConnectivityService.
void Beamable.Api.Connectivity.IConnectivityService.OnReconnectOnce | ( | ConnectionCallback | promise, |
int | order = 0 |
||
) |
Enqueue a Promise to run when the HasConnectivity value returns to true. If the HasConnectivity is already true, the promise will be evaluated immediately. When connectivity is restored, all of the ConnectionCallback's will be invoked, and the Promises that are created will be awaited before the SetHasInternet's return Promise is completed.
promise | Some function that generates a Promise. The generator will be evaluated when internet is restored. |
order | The order to invoke the promise |
Implemented in Beamable.Api.Connectivity.ConnectivityService.
Promise Beamable.Api.Connectivity.IConnectivityService.ReportInternetLoss | ( | ) |
Force the value of HasConnectivity to be false. The connectivity is checked periodically, so if internet connectivity returns, the HasConnectivity will be updated soon. If the value of HasConnectivity used to be true, then the OnConnectivityChanged event will trigger as part of the execution of this method.
Implemented in Beamable.Api.Connectivity.ConnectivityService.
Promise Beamable.Api.Connectivity.IConnectivityService.SetHasInternet | ( | bool | hasInternet | ) |
Force the value of HasConnectivity. The connectivity is checked periodically, so if the given hasInternet value is not correct, the connectivity will be updated soon. If the given hasInternet value is different than the current HasConnectivity property, then the OnConnectivityChanged event will trigger as part of the execution of this method.
hasInternet | true if the device has internet, false otherwise. |
Implemented in Beamable.Api.Connectivity.ConnectivityService.