feat: adds support for setting offline mode #635
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces online/offline mode support for the Amplitude SDK. Online mode indicates that the platform has an active connection to the network, while offline mode indicates that the platform does not have an active connection to the network. During online mode, the SDK works as usual and sends events at the configured time interval, while during offline mode, the SDK does not send events at all, but stores unsent events to the configured storage. Events persisted in the configured storage are available to be sent at a later time. The SDK by default is set to online mode, unless explicitly set through initialization options or the
setOffline()
API. Note that the online/offline mode support does not include automatic toggles between modes. The mode must explicitly be set by the instrumenter.To set Amplitude SDK to offline mode
setOffline()
APITo set Amplitude SDK to online mode
setOffline()
APISummary
Checklist