amplitude / Amplitude-Kotlin

Amplitude Kotlin SDK
MIT License
27 stars 10 forks source link

feat: offline support #171

Closed Mercy811 closed 6 months ago

Mercy811 commented 6 months ago

Summary

Requirements

ACCESS_NETWORK_STATE permission is required. If not, this feature will not supported and will fallback to previous behavior (causing an error)

User interfaces

This feature is enabled by default.

To opt out of using AndroidNetworkConnectivityPlugin and implement custom offline logic, setting config.offline to null will prevent plugin setup.

// Disable this feature
amplitude = Amplitude(
    Configuration(
        apiKey = AMPLITUDE_API_KEY,
        context = applicationContext,
        offline = AndroidNetworkConnectivityCheckerPlugin.Disabled
    )
)

// Implement your own plugin to toggle offline 

Implementation

Checklist

github-actions[bot] commented 6 months ago

:tada: This PR is included in version 1.13.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: