Pushwoosh/pushwoosh-phonegap-plugin

Help configuring two plugins that use Google Services

Closed this issue · 5 comments

mg commented

Hi

We (Landsbankinn) have been using this plugin to send push notifications to our customers for some time now. Now we are looking into adding Google Tag Manager to our application, and are running into a problem. Both the
cordova-plugin-firebase-analytics plugin and this plugin expect to find a app/google-services.json file that points them to the correct endpoints at firebaseio.com and appspot.com with a project id. How does the PushWoosh plugin work with other plugins that want to control where the endpoints are? Is it possible to have maybe two configuration files and configure the PushWoosh plugin to access the information from some other file than "app/google-services.json"?

cheers.

wfhm commented

@mg,

The google-services.json is actually required by the firebase-messaging library that our SDK uses under the hood, so the requirement to keep it in the app/ directory comes from Firebase, not from Pushwoosh SDK, and we cannot do much with it. It is actually strange that firebase-analytics and firebase-messaging require different google-services.json files for the same project - they should use the same file you get from the Firebase Console for your project (unless the google-services.json files belong to different projects). May I ask you to share the exact error you get?

mg commented

@wfhm

hi, we are not getting an error, it is just that Google Analytics automatically generates a google-services.json file for us when we configure the stream that we are required to use for cordova-plugin-firebase-analytics. This services file points to a different appspot.com and firebaseio.com endpoints than the PushWoosh google-services.json file, and we are at a loss on how to reconcile the two.

wfhm commented

@mg,

Can you describe how and where exactly you obtain google-services.json files for Analytics and for Messaging from the console? I've only found one place to get it from the console - in the project settings in the Your apps window.

mg commented

@wfhm

Keep in mind we are using GA4

Go to the Google Analytics site
Open the admin console
Click "Data streams"
Click "Add stream"
Select either iOS or Android app
Fill out the form
Then download the generated goggle-analytics.json file

wfhm commented

@mg,

It looks like you have first created a project in Google console and then created a new project in Firebase console instead of migrating the original project to Firebase. As a result, these projects have different IDs, and the google-services.json files are different as well. It can be solved by manually adding missing parameters to the google-services.json from Firebase. This discussion thread on SO might help with the details.

I can see that you have created a support ticket in our Help Center, and the support team is already in contact with you. May I ask you to continue the conversation there to keep all the information in one place? I will additionally post the final solution here once we figure it out.