Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose setOffline #81

Closed
marcotta opened this issue Nov 12, 2021 · 1 comment · Fixed by #142
Closed

Expose setOffline #81

marcotta opened this issue Nov 12, 2021 · 1 comment · Fixed by #142
Assignees

Comments

@marcotta
Copy link

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.

@justin-fiedler
Copy link
Contributor

Released in v3.16.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants