-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #580 from DroidKaigi/fix-firebase-dependencies
Changed to not include Firebase implementation on the iOS side
- Loading branch information
Showing
5 changed files
with
42 additions
and
25 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
26 changes: 26 additions & 0 deletions
26
...ain/kotlin/io/github/droidkaigi/confsched2023/data/remoteconfig/DefaultRemoteConfigApi.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.github.droidkaigi.confsched2023.data.remoteconfig | ||
|
||
import dev.gitlive.firebase.Firebase | ||
import dev.gitlive.firebase.remoteconfig.get | ||
import dev.gitlive.firebase.remoteconfig.remoteConfig | ||
|
||
actual class DefaultRemoteConfigApi : RemoteConfigApi { | ||
|
||
private val firebaseRemoteConfig = Firebase.remoteConfig | ||
|
||
/** | ||
* If you want to change the interval time to fetch, please change it here | ||
*/ | ||
// init { | ||
// CoroutineScope(Dispatchers.IO).launch { | ||
// firebaseRemoteConfig.settings { | ||
// minimumFetchIntervalInSeconds = 12 * 3600L | ||
// } | ||
// } | ||
// } | ||
|
||
actual override suspend fun getBoolean(key: String): Boolean { | ||
firebaseRemoteConfig.fetchAndActivate() | ||
return firebaseRemoteConfig[key] | ||
} | ||
} |
25 changes: 2 additions & 23 deletions
25
...ain/kotlin/io/github/droidkaigi/confsched2023/data/remoteconfig/DefaultRemoteConfigApi.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,26 +1,5 @@ | ||
package io.github.droidkaigi.confsched2023.data.remoteconfig | ||
|
||
import dev.gitlive.firebase.Firebase | ||
import dev.gitlive.firebase.remoteconfig.get | ||
import dev.gitlive.firebase.remoteconfig.remoteConfig | ||
|
||
class DefaultRemoteConfigApi : RemoteConfigApi { | ||
|
||
private val firebaseRemoteConfig = Firebase.remoteConfig | ||
|
||
/** | ||
* If you want to change the interval time to fetch, please change it here | ||
*/ | ||
// init { | ||
// CoroutineScope(Dispatchers.IO).launch { | ||
// firebaseRemoteConfig.settings { | ||
// minimumFetchIntervalInSeconds = 12 * 3600L | ||
// } | ||
// } | ||
// } | ||
|
||
override suspend fun getBoolean(key: String): Boolean { | ||
firebaseRemoteConfig.fetchAndActivate() | ||
return firebaseRemoteConfig[key] | ||
} | ||
expect class DefaultRemoteConfigApi : RemoteConfigApi { | ||
override suspend fun getBoolean(key: String): Boolean | ||
} |
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
12 changes: 12 additions & 0 deletions
12
...ain/kotlin/io/github/droidkaigi/confsched2023/data/remoteconfig/DefaultRemoteConfigApi.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.github.droidkaigi.confsched2023.data.remoteconfig | ||
|
||
import io.github.droidkaigi.confsched2023.data.remoteconfig.FakeRemoteConfigApi.Status.Default | ||
|
||
actual class DefaultRemoteConfigApi : RemoteConfigApi { | ||
|
||
actual override suspend fun getBoolean(key: String): Boolean { | ||
return FakeRemoteConfigApi().apply { | ||
setUp(Default) | ||
}.getBoolean(key) | ||
} | ||
} |