Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Idrees committed Aug 1, 2022
1 parent 9c2dba7 commit ae074fe
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 97 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fbAnalytics.sendEventAnalytics(eventName, eventStatus)
### For FireBase Remote Config, create an object RemoteConfigDate, passing topicName init :
```kotlin
private val remoteConfig = RemoteConfigDate("topicName")
private var remoteAdSettings = RemoteModel()
var remoteAdSettings = RemoteModel()
```
Make your Custom model the way you want to receive model, call getRemoteConfig() to get data:
```kotlin
Expand Down
101 changes: 7 additions & 94 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -1,120 +1,33 @@
{
"project_info": {
"project_number": "744390342276",
"project_id": "fir-e967c",
"storage_bucket": "fir-e967c.appspot.com"
"project_number": "816941791543",
"project_id": "newone-33895",
"storage_bucket": "newone-33895.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:744390342276:android:d471528021ee286dee34d1",
"mobilesdk_app_id": "1:816941791543:android:57ade9d363823c4c2902b2",
"android_client_info": {
"package_name": "ai.bom.firebase"
}
},
"oauth_client": [
{
"client_id": "744390342276-juc53gc7jmnb4tvnturfoh9mveh0oacl.apps.googleusercontent.com",
"client_id": "816941791543-mv4km02uaquvd4t4n424h5mbcr8smkla.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCIpEz4fDK_LI2FCj6eJvTY2jQme1dzzws"
"current_key": "AIzaSyB09QIqgLt95O5uQjyIk0duflBS_IwisUM"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "744390342276-juc53gc7jmnb4tvnturfoh9mveh0oacl.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:744390342276:android:dbe485ec01889a00ee34d1",
"android_client_info": {
"package_name": "com.app.remoteconfigdemo"
}
},
"oauth_client": [
{
"client_id": "744390342276-juc53gc7jmnb4tvnturfoh9mveh0oacl.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCIpEz4fDK_LI2FCj6eJvTY2jQme1dzzws"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "744390342276-juc53gc7jmnb4tvnturfoh9mveh0oacl.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:744390342276:android:e2fc5fdc69783cf9ee34d1",
"android_client_info": {
"package_name": "com.app.remoteconfigdemo.debug"
}
},
"oauth_client": [
{
"client_id": "744390342276-juc53gc7jmnb4tvnturfoh9mveh0oacl.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCIpEz4fDK_LI2FCj6eJvTY2jQme1dzzws"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "744390342276-juc53gc7jmnb4tvnturfoh9mveh0oacl.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:744390342276:android:785eb52588d59bc7ee34d1",
"android_client_info": {
"package_name": "smart.app.lock.master.locker.private.pin.pattern.safe.secure"
}
},
"oauth_client": [
{
"client_id": "744390342276-juc53gc7jmnb4tvnturfoh9mveh0oacl.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCIpEz4fDK_LI2FCj6eJvTY2jQme1dzzws"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "744390342276-juc53gc7jmnb4tvnturfoh9mveh0oacl.apps.googleusercontent.com",
"client_id": "816941791543-mv4km02uaquvd4t4n424h5mbcr8smkla.apps.googleusercontent.com",
"client_type": 3
}
]
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/ai/bom/firebase/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class MainActivity : AppCompatActivity() {
remoteConfig.getRemoteConfig {
it?.let {
val remoteJson = Gson().toJson(it)
remoteAdSettings = Gson().fromJson(remoteJson, RemoteModel::class.java)
if (!remoteJson.isNullOrEmpty())
remoteAdSettings = Gson().fromJson(remoteJson, RemoteModel::class.java)

Log.e("RemoteConfigNew*", "$remoteAdSettings")

if (remoteAdSettings.splashNative.value == "on") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class RemoteConfigDate(private val remoteTopic: String) {
return remoteConfig
}

private fun getRemoteConfig(): Any {
private fun getRemoteConfig(): Any? {
return Gson().fromJson(
getInstance()?.getString(remoteTopic),
Any::class.java
Expand Down

0 comments on commit ae074fe

Please sign in to comment.