firebase / firebase/firebase-unity-sdk
[Bug] firebase doesn't select app by package name
- Dominant language
- C#
- Stars
- 320
- Forks
- 60
- Avg merge
- 13h 32m
- Merged PRs (30d)
- 13
Description
### Description
when google-services.json contains more than 1 app, firebase doesn't choose app base on package name, it always choose one of apps no matter what package name.
### Reproducing the issue
- create an empty firebase project
- create 2 android apps with 2 different package name (1) and (2)
- create an empty unity project with package name (1)
- download google-services.json and place into unity project
- log Debug.LogError(FirebaseApp.DefaultInstance.Options.AppId); in script
- build apk (1)
- change package name to (2)
- build apk (2)
- run apk (1) => logcat will show appId of app (1)
- run apk (2) => logcat will show appId of app (1)
### Firebase Unity SDK Version
12.1.0
### Unity editor version
2022.3.17
### Installation Method
Unity Package Manager
### Problematic Firebase Component(s)
_No response_
### Other Firebase Component(s) in use
_No response_
### Additional SDKs you are using
_No response_
### Targeted Platform(s)
Android
### Unity editor platform
Windows
### Scripting Runtime
Mono
### Release Distribution Type
Pre-built SDK from https://firebase.google.com/download/unity
### Relevant Log Output
_No response_
### If using CocoaPods for Apple platforms, the project's Podfile.lock
Expand Podfile.lock snippet
```yml
👀 Replace this line with the contents of your Podfile.lock!
```
Contributor guide
Research direction
Reproduce the issue in the Unity Android project using two apps and the provided google-services.json, then trace the SDK path that selects the Firebase app by package name. Done means builds with package names (1) and (2) log the corresponding AppId instead of always selecting app (1).
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, unity
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100