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

Notifications #19

Closed
ajatsoft opened this issue Apr 20, 2020 · 9 comments
Closed

Notifications #19

ajatsoft opened this issue Apr 20, 2020 · 9 comments

Comments

@ajatsoft
Copy link

I can get notifications...

my config:

in app:

Captura de pantalla 2020-04-20 a las 12 23 58

remote config:

Captura de pantalla 2020-04-20 a las 12 24 10

remote config json:

Captura de pantalla 2020-04-20 a las 12 24 20

if I send notification since firebase is ok, but when I send a chat message not send notification.

thank you¡¡¡

@TheAlphamerc
Copy link
Owner

You are getting json data from remote getting so you have to extract value of key from data.

void getFCMServerKey() async {
    final RemoteConfig remoteConfig = await RemoteConfig.instance;
    await remoteConfig.fetch(expiration: const Duration(hours: 5));
    await remoteConfig.activateFetched();
    var data = remoteConfig.getString('FcmServerKey');
    if (data != null) {
      serverToken = jsonDecode(data)["key"];
    }
  } 

@ajatsoft
Copy link
Author

yes, I configure it like my photos and I can't recibe notifications, I have to do anything else?
thank you a lot

@TheAlphamerc
Copy link
Owner

First of all please check notification by sending from the Postman.
You can use below demo json for notification.

{
  "notification": {
    "body": "this is a body",
    "title": "this is a title"
  },
  "priority": "high",
  "data": {
    "click_action": "FLUTTER_NOTIFICATION_CLICK",
    "id": "1",
    "status": "done",
    "title":"title",
    "body":"body",
    "tweetId":"wert"
    
     
  },
  "to": "ADD DEVICE FCM TOKEN HERE"
}

Postman notification configuration

Screenshot 2020-04-23 at 10 40 44 PM

Screenshot 2020-04-23 at 10 33 12 PM

@ajatsoft
Copy link
Author

{
"multicast_id": 4493036613982111398,
"success": 0,
"failure": 1,
"canonical_ids": 0,
"results": [
{
"error": "MismatchSenderId"
}
]
}

@TheAlphamerc
Copy link
Owner

Probably you are using incorrect server key. Check your server key first.

@ajatsoft
Copy link
Author

i cheked it , and y try after generate another one, config in my photos is ok?

@TheAlphamerc
Copy link
Owner

Your config seems ok in the photo. Please check you are using the correct FCM server key.

@ajatsoft
Copy link
Author

ajatsoft commented Apr 24, 2020 via email

@TheAlphamerc
Copy link
Owner

I haven't any idea what's wrong in your configuration. If your notification is not working with postman then it is obvious you have either missing something or not using correct values.

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

3 participants
@ajatsoft @TheAlphamerc and others