GovernIB / carpeta

Carpeta Ciutadana
5 stars 1 forks source link

Revisar APP de Carpeta i actualitzar API de notificacions #850

Closed anadal-fundaciobit closed 5 months ago

anadal-fundaciobit commented 5 months ago

Revisar APP de Carpeta i notificacions.

Es va rebre el següent correu indicant realitzar una sèrie de canvis a l'APP de EXPO per suportar el nou model i necessitats en el tema de les Notificacions PUSH.

Dear Expo developers and EAS customers,

Developers who use the Expo push notifications service will need to create a Firebase Cloud Messaging (FCM) credential and upload it to EAS in order to continue sending push notifications to Android devices after June 20th this year.

If you don’t use the Expo push notification service to send notifications to Android devices, you won’t be affected by this change and don’t need to do anything.

If your project is affected, read on to understand what the change is, how to prepare for it and test the changes, and what the migration timeline looks like. You can also view this announcement [on our blog](https://dev.us14.list-manage.com/track/click?u=445052060e27366a81ae194a1&id=522ffec10b&e=137d620f15).

What’s happening?
This June, Google is shutting down an old version of FCM, known as the FCM legacy API, and is requiring that all developers migrate to the FCM HTTP v1 API.
At Expo, we’ve added support for the FCM HTTP v1 API. However, the credentials for the FCM legacy API are different from the v1 API’s. This means we can’t automatically switch your projects from the legacy API to the v1 API without your uploading new credentials. However, we’ll walk you through the migration steps.

How to update to the new FCM v1 API

    Create your FCM v1 credential (google-services.json): Visit the [Firebase console](https://dev.us14.list-manage.com/track/click?u=445052060e27366a81ae194a1&id=71f18906e7&e=137d620f15). Under Settings → [Service Accounts](https://dev.us14.list-manage.com/track/click?u=445052060e27366a81ae194a1&id=d49f52f6c9&e=137d620f15) for your project, click the button to “Generate new private key” for the Firebase Admin SDK.
    Upload your credential to EAS: Browse to the credentials [page](https://dev.us14.list-manage.com/track/click?u=445052060e27366a81ae194a1&id=f9bd9de996&e=137d620f15) for your EAS project. Click on your Android application ID and find the section titled “FCM v1 service account key” from which you can upload your JSON credential.
    Alternatively, you can use [EAS CLI](https://dev.us14.list-manage.com/track/click?u=445052060e27366a81ae194a1&id=6f03d751b6&e=137d620f15) to upload your credential. From the terminal, go to your project’s directory and run eas credentials → choose Android → choose production → choose Google Service Accounts → choose FCM v1.
    Note: at this point, your project will still be using the FCM legacy API.
    Test your app with FCM v1: To test the FCM v1 API, specify ?useFcmV1=true in your HTTP requests to the Expo push notification service (that is, https://exp.host/--/api/v2/push/send?useFcmV1=true). The Expo push notification service will default to using the FCM legacy API until May 13, 2024. After this date, it will default to using the FCM HTTP v1 API and you can remove the useFcmV1 query parameter from your requests.
    If the push ticket or push receipt is unexpectedly errant and differs from what you get back from using the FCM legacy API, double check your FCM v1 credential or try uploading a new one. If you continue to experience errors or failures without resolution, please reach out to us via support@expo.dev or on Discord to debug further.
    Delete your FCM legacy credential token (optional): When you are fully satisfied the FCM v1 API is working well for you, you can delete your FCM legacy credential token from [EAS](https://dev.us14.list-manage.com/track/click?u=445052060e27366a81ae194a1&id=e25f020ea3&e=137d620f15). It’s also a good practice to revoke the token through the Firebase console.
    Deleting your FCM legacy credentials is optional. After Google shuts down the FCM legacy API, Expo will delete your leftover FCM legacy credentials from EAS.

FCM Timeline

    March 7 - May 13, 2024: The Expo push notification service will default to using the FCM legacy API. It will use FCM v1 if the HTTP request to send push notifications specifies ?useFcmV1=true in the request URL, or if the project has only an FCM v1 credential and no FCM legacy credential.
    May 13 - June 20, 2024: The Expo push notification service will change its default; it will default to FCM v1. It will use the FCM legacy API if the HTTP request to send push notifications specifies ?useFcmV1=false in the request URL, or if the projects has only an FCM legacy credential and no FCM v1 credential.
    June 20, 2024: Google will shut down the FCM legacy API. The Expo push notification service will always use FCM v1. The useFcmV1 query parameter will have no effect and we recommend removing it. Projects that do not have an FCM v1 credential will no longer successfully send notifications until a valid credential is uploaded.

We hope that this transition is as smooth as possible, but we understand that our community is diverse and so too are its use cases. Please reach out to us at support@expo.dev with any questions, concerns, or if you encounter unexpected difficulties with the transition process.
anadal-fundaciobit commented 5 months ago

Dins carpeta\carpeta-front\reactnative\expo-server-sdk-java hi ha aquest a llibreria per enviar notificacions a EXPO. Dia 14 de maig s'activa el nou protocol i en principi ha de funcionar, però l'API d'enviament actual llança logs tipo warnings al final encara que no dóna error. En cas que despres de dia 14 segueixi donant aquest error s'ha de mirar d'utilitzar carpeta\carpeta-front\reactnative\expo-server-sdk-java

anadal-fundaciobit commented 5 months ago

Actualitzada versió a Apple Store i Play Store. S'han hagut d'actualitzar llibreries i SDK EXPO.