Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Localized Push-Notifications isn't working #577

Closed
DavidKuennen opened this issue Nov 2, 2017 · 1 comment
Closed

Using Localized Push-Notifications isn't working #577

DavidKuennen opened this issue Nov 2, 2017 · 1 comment

Comments

@DavidKuennen
Copy link
Contributor

DavidKuennen commented Nov 2, 2017

I don't know whether this is an issue with react-native-firebase or something else:

I'm currently trying to use FCM while keeping it localized. I'm doing it by sending by Push-Notifications like this:

admin.messaging().sendToTopic(uid, {
    notification: {
        titleLocKey: "new_message_title",
        titleLocArgs: `['${name}']`,
        bodyLocKey: "new_message_body",
        bodyLocArgs: `['${text}']`,
        sound: "default"
    }
});

Which should be possible according to this.
But unfortunately this isn't working. And by not working I mean those messages are never being received.

If I use it like this tho:

admin.messaging().sendToTopic(uid, {
    notification: {
        title: "New Message",
        body: "New Message Body",
        sound: "default"
    }
});

it's working.

Does anyone know a solution for this to work? I really don't want to handle the localization stuff in my Push-Notifications-Service (since there is already a native solution).

Application Target Platform: only tested on android
Development Operating System: Windows 10
Build Tools: Android Studio
React Native version: 0.48.4
RNFirebase Version: 3.0.2
Firebase Module: Messaging

@DavidKuennen
Copy link
Contributor Author

DavidKuennen commented Nov 2, 2017

Oh well I figured it out. 😄

bodyLocArgs and titleLocArgs were wrong. It should be ["${name}"] istead of ['${name}'].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant