Amplitude-Flutter
Amplitude-Flutter copied to clipboard
Expose setOffline
Summary
Expose setOffline
via the flutter plugin
Both objective-c and Kotlin counterparts offer a method 'setOffline'.
/**
* Sets offline. If offline is true, then the SDK will not upload events to Amplitude servers;
* however, it will still log events.
*
* @param offline whether or not the SDK should be offline
* @return the AmplitudeClient
*/
public AmplitudeClient setOffline(boolean offline) {
this.offline = offline;
// Try to update to the server once offline mode is disabled.
if (!offline) {
uploadEvents();
}
return this;
}
- (void)setOffline:(BOOL)offline {
_offline = offline;
if (!_offline) {
[self uploadEvents];
}
}
Motivations
Prevent uploading events to Amplitude server in special conditions.