-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add documentation for remote config, crashlytics and database
- Loading branch information
1 parent
77ccc00
commit d7962a8
Showing
6 changed files
with
825 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 45 additions & 1 deletion
46
...onfig/src/commonMain/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfigInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,53 @@ | ||
package dev.gitlive.firebase.remoteconfig | ||
|
||
/** Wraps the current state of the [FirebaseRemoteConfig] singleton object. */ | ||
data class FirebaseRemoteConfigInfo( | ||
/** | ||
* Gets the current settings of the [FirebaseRemoteConfig] singleton object. | ||
* | ||
* @return A [FirebaseRemoteConfig] object indicating the current settings. | ||
*/ | ||
val configSettings: FirebaseRemoteConfigSettings, | ||
|
||
/** | ||
* Gets the timestamp (milliseconds since epoch) of the last successful fetch, regardless of | ||
* whether the fetch was activated or not. | ||
* | ||
* @return -1 if no fetch attempt has been made yet. Otherwise, returns the timestamp of the last | ||
* successful fetch operation. | ||
*/ | ||
val fetchTimeMillis: Long, | ||
|
||
/** | ||
* Gets the status of the most recent fetch attempt. | ||
* | ||
* @return Will return one of [FetchStatus.Success], [FetchStatus.Failure], [FetchStatus.Throttled], or [FetchStatus.NoFetchYet] | ||
*/ | ||
val lastFetchStatus: FetchStatus, | ||
) | ||
|
||
enum class FetchStatus { Success, Failure, Throttled, NoFetchYet } | ||
enum class FetchStatus { | ||
/** | ||
* Indicates that the most recent fetch of parameter values from the Firebase Remote Config server | ||
* was completed successfully. | ||
*/ | ||
Success, | ||
|
||
/** | ||
* Indicates that the most recent attempt to fetch parameter values from the Firebase Remote | ||
* Config server has failed. | ||
*/ | ||
Failure, | ||
|
||
/** | ||
* Indicates that the most recent attempt to fetch parameter values from the Firebase Remote | ||
* Config server was throttled. | ||
*/ | ||
Throttled, | ||
|
||
/** | ||
* Indicates that the FirebaseRemoteConfig singleton object has not yet attempted to fetch | ||
* parameter values from the Firebase Remote Config server. | ||
*/ | ||
NoFetchYet | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 46 additions & 1 deletion
47
...nfig/src/commonMain/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfigValue.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,57 @@ | ||
package dev.gitlive.firebase.remoteconfig | ||
|
||
/** Wrapper for a Remote Config parameter value, with methods to get it as different types. */ | ||
expect class FirebaseRemoteConfigValue { | ||
/** | ||
* Gets the value as a [Boolean]. | ||
* | ||
* @return [Boolean] representation of this parameter value. | ||
*/ | ||
fun asBoolean(): Boolean | ||
|
||
/** | ||
* Gets the value as a [ByteArray]. | ||
* | ||
* @return [ByteArray] representation of this parameter value. | ||
*/ | ||
fun asByteArray(): ByteArray | ||
|
||
/** | ||
* Gets the value as a [Double]. | ||
* | ||
* @return [Double] representation of this parameter value. | ||
*/ | ||
fun asDouble(): Double | ||
|
||
/** | ||
* Gets the value as a [Long]. | ||
* | ||
* @return [Long] representation of this parameter value. | ||
*/ | ||
fun asLong(): Long | ||
|
||
/** | ||
* Gets the value as a [String]. | ||
* | ||
* @return [String] representation of this parameter value. | ||
*/ | ||
fun asString(): String | ||
|
||
/** | ||
* Indicates at which source this value came from. | ||
* | ||
* @return [ValueSource.Remote] if the value was retrieved from the server, [ValueSource.Default] if the value was set as a default, or [ValueSource.Stataic] if no value was found and a static default value was returned instead. | ||
*/ | ||
fun getSource(): ValueSource | ||
} | ||
|
||
enum class ValueSource { Static, Default, Remote } | ||
enum class ValueSource { | ||
/** Indicates that the value returned is the static default value. */ | ||
Static, | ||
|
||
/** Indicates that the value returned was retrieved from the defaults set by the client. */ | ||
Default, | ||
|
||
/** Indicates that the value returned was retrieved from the Firebase Remote Config server. */ | ||
Remote | ||
} |
Oops, something went wrong.