Everyone,

we need some auditing & beta test help on this.

I've just finished the migration for the server & App side. Everything works fine in my test environment, but I had WTF moments on the way. Some magically resolved themselves on the next day, so I have no idea why they occured in the first place.

New server code is in Server/fcm, see README for details: https://github.com/openvehicles/Open-Vehicle-Server/tree/fcm/v3

The server now uses a child process for FCM communication, as each delivery attempt now takes 0.3 seconds. The new code also now automatically cleans up expired App tokens.

New App code & build is in Android/master: https://github.com/openvehicles/Open-Vehicle-Android/tree/master/latest

The App currently uses my API IDs (File "google-services.json") instead of the official OpenVehicles version, this needs to be changed for the release. It should nevertheless work with api.openvehicles.com, but I haven't tested that yet.

FCM makes it harder to configure an App for other servers than build into the App. I've done some experimentation and found a way to still keep the configuration as simple as before, i.e. you just need the custom FCM sender ID (which now always is the FCM/cloud project ID). Caveat is, this uses undocumented behaviour, so may need to be changed in the future.

See my comment & explanation here:
https://github.com/openvehicles/Open-Vehicle-Android/blob/master/OpenVehicleApp/src/main/java/com/openvehicles/OVMS/ui/MainActivity.java#L404

Code audits & tests are welcome.

When running your own server, follow the steps described in the README to get & install your FCM key. FCM keys btw. don't expire until the year 10000. Connect your module & App to your server, use "notify raise" to send test messages.

Btw, FCM migration doesn't need to be done in a specific order (server/App): this is just an API change on both sides, the infrastructure behind the scenes is more or less identical. An FCM App receives GCM transmissions and vice versa. Please test that as well if possible.

We need to finish migration before June 20, as the GCM APIs will then be switched off.

Regards,
Michael


Am 29.06.23 um 06:17 schrieb Mark Webb-Johnson:
Oh, google. They do love to deprecate…

I can handle the server side. But not sure what needs to be done there. Presumably this like the C2DM -> GCM migration we did a while ago (using a new agreed token type apns/c2dm/gcm/etc, if the new approache is not backwards compatible). The current server seems to call:

https://fcm.googleapis.com/fcm/send

Regards, Mark.

On 21 Jun 2023, at 7:25 PM, Michael Balzer <dexter@expeedo.de> wrote:

Signed PGP part
Time for another Google API deprecation.

It seems we'll need to update the Android App & possibly the server now to the FCM API for push notifications, the old GCM API will stop working in June 2024.

Anyone volunteering to take care of this?

Regards,
Michael


-------- Weitergeleitete Nachricht --------
Betreff: [Action Required] Update your apps to the latest Firebase Cloud Messaging APIs and SDKs
Datum:  Tue, 20 Jun 2023 13:26:22 -0700
Von:  Firebase <firebase-noreply@google.com>
Antwort an:  Firebase <firebase-noreply@google.com>
An:  dexter@expeedo.de


We’re writing to let you know that starting June 20, 2024 the legacy Firebase Cloud Messaging (FCM) APIs will be discontinued.

What do you need to know? 

On June 20, 2024, we’re reducing the number of Firebase Cloud Messaging (FCM) legacy register APIs and legacy send APIs that provide similar functionality. This step will allow us to provide you with a more consistent experience and align with Google security standards to improve security, reliability and performance.

Because of these API decommissions, some already-deprecated SDKs and features will stop working after June 20, 2024.

Please consult the tables below to find which Firebase Cloud Messaging (FCM) APIs and corresponding services/SDKs/features will be discontinued and replaced with new alternatives.

Discontinued Send API

Decommissioned service

New alternative

Legacy HTTP Protocol

Sending messages via the Legacy HTTP API.

Send messages via the HTTP v1 API.

XMPP Protocol

Sending upstream and downstream messages via the XMPP API.

Send downstream messages via the HTTP v1 API.

Send upstream messages via HTTP/gRPC directly from the App to your server.

Batch send API

Including multiple send requests in a single HTTP request to FCM known as Batch Send.

Send messages via the HTTP v1 API, which has been optimized for fanout performance


Discontinued Register API

Decommissioned SDK

New alternative

GCM register API

Google Cloud Messaging(GCM) SDKs (deprecated in 2018).

Latest FCM Android SDK.

Legacy Web register API

FCM JS SDK version<7.0.0 (deprecated in 2019)

Latest FCM JS SDK.

Instance ID Server API for Web

No SDK related to this API.

Latest FCM JS SDK.


Discontinued Feature

Decommissioned service

New alternative

Server keys

Authenticating requests with server keys.

Authenticate requests with access tokens generated from authorized service accounts

iOS Direct Channel

Sending messages via FCM’s direct channel to iOS devices while they are running in the foreground.

All iOS messages will be sent via APNS channel.


What do you need to do? 

Take the following actions before June 20, 2024, to ensure that you have access to the latest supported features and to reduce the risk of future decommissions affecting your usage:

  • Follow the instructions described in Firebase FAQ to migrate your individual APIs.
  • Update to the latest versions of Firebase SDKs.

Platform

Recommended FCM SDK version

Android

>= 23.1.2

iOS

>= 10.10.0

Web (Javascript)

>= 9.22.1

Your Firebase project(s) that use Firebase Cloud Messaging APIs are listed below:

  • MyOvmsServer (1043773844049)
    • Your recent usage of impacted APIs/features: Server Keys
    • Your recent usage of impacted APIs/features: Legacy HTTP protocol
We’re here to help 

If you have any questions, please review the Firebase FAQs.

Thanks, 
Todd on behalf of the Firebase team 

Was this information helpful? 

Yes     Neutral     No

You have received this mandatory service announcement to update you about important changes to Firebase or your account. 

-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26




_______________________________________________
OvmsDev mailing list
OvmsDev@lists.openvehicles.com
http://lists.openvehicles.com/mailman/listinfo/ovmsdev

-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26