skip to Main Content

I am trying to setup push notifications for my expo react native app.
Running in expo go everything works fine.
Now for production I followed this Expo GUIDE.

The first 4 steps of this guide are reasonable.

But step 5 is very confusing:

  1. first of all, suddenly there is an app in the console, but there was no instruction to create one. So I just added one, with the same package name as in my app.json.
  2. Then it explains where to place the google-service.json file, how to reference it in the app.json and to put it into .gitignore. Which I have done.

a) But this results in a warning: File specified via "android.googleServicesFile" field in your app.json is not checked in to your repository and won't be uploaded to the builder.

b) and finally in a failed build: "google-services.json" is missing, make sure that the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.

So do I have to put the content of the google-services.json file into an EAS secret? even though the guide mentions nothing about doing this and even says You're all set! You can now send notifications to Android devices via Expo Push Notifications using the FCM V1 protocol. ?

2

Answers


  1. Back in the days we used expo go as well for our project and yes, the google service json was in the repo.

    Login or Signup to reply.
  2. The file google-services.json should be in android/app and can’t be in .gitignore. You can set google-services.json as expo secret in your project expo.dev. I am using my expo secret GOOGLE_SERVICES_JSON. To get variable i am using "googleServicesFile": ${process.env.GOOGLE_SERVICES_JSON} in file app.config.ts. See: How to upload a secret file and use it in my app config?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search