firebase-unity-sdk
firebase-unity-sdk copied to clipboard
[Question] Localization body_loc_key, where is it to be in the push notification structure in HTTP v1???
[REQUIRED] Please fill in the following fields:
- Unity editor version: Unity 2022.3.20f1
- Firebase Unity SDK version: Version 11.7.0
- Source you installed the SDK: .unitypackage
- Problematic Firebase Component: messaging
- Other Firebase Components in use: auth, analytics, dynamic links
- Additional SDKs you are using: Facebook, yodo, tapjoy, helpshift
- Platform you are using the Unity editor on: windows
- Platform you are targeting: iOS, Android
- Scripting Runtime: IL2CPP
- Pre-built SDK from the website or open-source from this repo: prebuilt
[REQUIRED] Please describe the question here:
Migrating from legacy FCM APIs to HTTP v1, what has happened to localization?
All the documentation shows body_loc_key as remaining the same as old FMC. All doc examples are very simple and nothing mentions how localization has changed.
With new version, no matter where I stick the body_loc_key it does not seem to work.
Hi @toom1984,
Could you provide a sample payload you're sending as well as the specific platform you're targeting so that we can identify what's causing this to happen?
hi, this is the payload we have been sending using the old system
^ array:2 [▼ "registration_ids" => array:1 [▼ 0 => "dNpJjg9WRmGlIGmDk3hN6q:APA91bEBfmt064CEzNROd9uiFqACawbpaIFy8G9sNK6CrM-u6rxVUUjl4HGFL6NSi_1un0mRoT9j3hNYjcIkoeaQmMxiXV97YKHmpIuQamH3m3YVToG9B8DKCwQSxF4A00_mwnmPl ▶" ] "notification" => array:2 [▼ "body" => "hi" "body_loc_key" => "match_first2" ] ]
sending the same thing with new HTTP v1 the "body_loc_key" seems to go missing on the way, we have tried wrapping "notification" in "android", but that didn't change anything. Debugging in app shows OnMessageReceived e.message.Notification.BodyLocalizationKey (and title key) are empty.
Hi @toom1984
For the layout of the message, it does now need to be wrapped in an "android", like: "android":{ "notification": { "body_loc_key":"...", } }
And to clarify, using the old legacy FCM APIs, you were able to get the body_loc_key passed through correctly, and it is just with the new v1 API that you can't, correct?
The old method has been working. I will try again with it wrapped in "android". Does this mean that also for iOS it would need to be wrapped in iOS? And for what platform would it not be needed to wrap it? Could you point to anywhere in the documentation where it mentions this change.
For iOS it should be in:
apns: {payload: {aps:{alert:
As for documentation, I can't find anything specific that calls out exactly what changes there are, but these generally seem to call out most of them: https://firebase.google.com/docs/cloud-messaging/migrate-v1 https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages
Hey @toom1984. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Since there haven't been any recent updates here, I am going to close this issue.
@toom1984 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.