Charlotte_Anne
Charlotte_Anne

Reputation: 382

google-services.json firebase notifications react native android - one app not working

I have three different react-native android apps in a firebase project I use for push notifications. Two of them are working just fine. The third isn't working and I can't figure out what I've done differently.

Here's what I know so far:

1. Working App One

{
  "project_info": {
    "project_number": "XXXXX",
    "firebase_url": "XXXXX",
    "project_id": "XXXXX",
    "storage_bucket": "XXXXX"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "XXXXX",
        "android_client_info": {
          "package_name": "appOneName"
        }
      },
      "oauth_client": [
        {
          "client_id": "XXXXX",
          "client_type": 1,
          "android_info": {
            "package_name": "appOneName",
            "certificate_hash": "XXXXX"
          }
        },
        {
          "client_id": "XXXXX",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "XXXXX"
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": [
            {
              "client_id": "XXXXX",
              "client_type": 3
            },
            {
              "client_id": "XXXXX",
              "client_type": 2,
              "ios_info": {
                "bundle_id": "appOneBundle",
                "app_store_id": "XXXXX"
              }
            }
          ]
        }
      }
    }
  ],
  "configuration_version": "1"
}

2. Working App Two

{   "project_info": {
    "project_number": "XXXXXX",
    "firebase_url": "XXXXX",
    "project_id": "XXXXX",
    "storage_bucket": "XXXXXX"   },   "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "XXXXX",
        "android_client_info": {
          "package_name": "appOneName"
        }
      },
      "oauth_client": [
        {
          "client_id": "XXXX",
          "client_type": 1,
          "android_info": {
            "package_name": "appOneName",
            "certificate_hash": "XXXXXX"
          }
        },
        {
          "client_id": "XXXXX",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "XXXXX"
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": [
            {
              "client_id": "XXXXX",
              "client_type": 3
            },
            {
              "client_id": "XXXXX",
              "client_type": 2,
              "ios_info": {
                "bundle_id": "appOneBundle",
                "app_store_id": "XXXXX"
              }
            }
          ]
        }
      }
    },
    {
      "client_info": {
        "mobilesdk_app_id": "XXXXX",
        "android_client_info": {
          "package_name": "appTwoName"
        }
      },
      "oauth_client": [
        {
          "client_id": "XXXXXX",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "XXXXXXX"
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": [
            {
              "client_id": "XXXXX",
              "client_type": 3
            },
            {
              "client_id": "XXXXX",
              "client_type": 2,
              "ios_info": {
                "bundle_id": "appOneBundle",
                "app_store_id": "XXXXX"
              }
            }
          ]
        }
      }
    }   ],   "configuration_version": "1" }

3. Not Working App Three

{
  "project_info": {
    "project_number": "XXXXX",
    "firebase_url": "XXXXX",
    "project_id": "XXXXX",
    "storage_bucket": "XXXXX"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "XXXXX",
        "android_client_info": {
          "package_name": "appThreePackageName"
        }
      },
      "oauth_client": [
        {
          "client_id": "XXXXX",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "XXXXXX"
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": [
            {
              "client_id": "XXXXX",
              "client_type": 3
            },
            {
              "client_id": "XXXXX",
              "client_type": 2,
              "ios_info": {
                "bundle_id": "appOneBundleId",
                "app_store_id": "XXXXXX"
              }
            }
          ]
        }
      }
    },
    {
      "client_info": {
        "mobilesdk_app_id": "XXXXX",
        "android_client_info": {
          "package_name": "appOneName"
        }
      },
      "oauth_client": [
        {
          "client_id": "XXXXX",
          "client_type": 1,
          "android_info": {
            "package_name": "appOneName",
            "certificate_hash": "XXXXXX"
          }
        },
        {
          "client_id": "XXXX",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "XXXXXX"
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": [
            {
              "client_id": "XXXXX",
              "client_type": 3
            },
            {
              "client_id": "XXXXX",
              "client_type": 2,
              "ios_info": {
                "bundle_id": "appOneBundle",
                "app_store_id": "XXXXX"
              }
            }
          ]
        }
      }
    },
    {
      "client_info": {
        "mobilesdk_app_id": "XXXXXX",
        "android_client_info": {
          "package_name": "com.test" //just a random extra app I added for testing
        }
      },
      "oauth_client": [
        {
          "client_id": "XXXXXXXX",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "XXXXX"
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": [
            {
              "client_id": "XXXXX",
              "client_type": 3
            },
            {
              "client_id": "XXXXXX",
              "client_type": 2,
              "ios_info": {
                "bundle_id": "appOneBundle",
                "app_store_id": "XXXXXX"
              }
            }
          ]
        }
      }
    },
    {
      "client_info": {
        "mobilesdk_app_id": "XXXXXXX",
        "android_client_info": {
          "package_name": "appTwoName"
        }
      },
      "oauth_client": [
        {
          "client_id": "XXXXXX",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "XXXXXX"
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": [
            {
              "client_id": "XXXXXX",
              "client_type": 3
            },
            {
              "client_id": "XXXXXX",
              "client_type": 2,
              "ios_info": {
                "bundle_id": "appOneBundle",
                "app_store_id": "XXXXX"
              }
            }
          ]
        }
      }
    }
  ],
  "configuration_version": "1"
}

Any suggestions of what to look into would be welcomed - thanks!

Update: About a day after I first downloaded that problematic google-services.json I logged back into my firebase account, downloaded a new one and used it to replace the old one. After syncing files it's now working. I'm still not sure what caused this problem. Maybe the first download was somehow messed up, or maybe files didn't sync properly the first time. Anyway, I guess I'll leave this question up in case anyone else comes across a similar problem in the future.

Upvotes: 0

Views: 6774

Answers (1)

Ebi-Yaa Kwaw
Ebi-Yaa Kwaw

Reputation: 46

Have you found a fix for this yet? I encountered the same problem some days ago. Then I realized the package name or ID in my google-services did not match the package name in Android.Manifest. Make sure com.package.packageName is the same in Android.Manifest as google-services. It's case sensitive, too.

Upvotes: 3

Related Questions