Open barbeau opened 6 years ago
Hi Sean,
The google-services.json that is present in the OneBusAway project is just a placeholder so that the ES components can build (GCM and now FCM require that a json config is present). The intent, however, is to have the hosting app replace the config provided by the SDK. Removing the existing json config should not break any existing functionality in OBA.
Push will only work for the application once you follow the steps to configure firebase messaging from the Firebase console and provide us with your FCM key so we can register it on the server side under your app key.
Perhaps we should comment inside the config file making it clear that the existing google-services.json is a placeholder. What do you think?
I've faced the same problem. The only feature I needed was Firestore. It was OK for me to initialise the store manually (the same approach as above). The requirement for google-services.json
was annoying, so I removed com.google.gms.google-services
from plugins
. The Firestore still working, but the requirement for google-services.json
gone. So, please use this "solution" if you want. However, I cannot know what other Firebase parts can be negatively affected by this trick.
Summary:
Currently, OneBusAway Android has a file
/onebusaway-android/google-services.json
that the ES SDK uses, presumably for some type of Firebase service.I'm in the process of adding another Firebase service to OBA Android. As part of that I'd need to add a
google-services.json
in the/onebusaway-android
directory for this Firebase service (Cloud Firestore), but I can't because the one for the ES SDK already exists.From this Firebase link, it looks like you can configure multiple Firebase projects within the same app - https://firebase.google.com/docs/configure/#use_multiple_projects_in_your_application
I'm proposing that the ES SDK
/google-services.json
be removed from the OBA app and replaced by passing credentials to the ES SDK via the/onebusaway-android/src/main/res/raw/embedded_social_config
file, and then the ES SDK can manually init Firebase within the SDK using these credentials. From the above link, the manual init would look something like:This design makes sense to me for three reasons:
embedded_social_config
)google-services.json
in an app belong to an SDKSteps to reproduce:
Try to configure the OneBusAway Android app with a new Firebase project:
google-services.json
file is generated by the Firebase console, follow the instructions to add it to the OBA Android project at/onebusaway-android/google-services.json
Expected behavior:
ES SDK shouldn't block me from adding a Firebase project to the OBA Android app - ideally there shouldn't be an existing
/onebusaway-android/google-services.json
file that's not owned by the OBA app.Observed behavior:
/onebusaway-android/google-services.json
already exists in OBA Android from the ES SDK configuration.A workaround would be to set up a secondary OBA Firebase project with a manual configuration for the OBA Android app as discussed at: https://firebase.google.com/docs/configure/#use_multiple_projects_in_your_application
Device, Android, and Embedded Social SDK version:
App = OBA Android with
master
branch at https://github.com/OneBusAway/onebusaway-android/commit/8eeda8586a394d293b3ae8bb99ef5c6df7a93176