Giter Site home page Giter Site logo

Comments (9)

szotp avatar szotp commented on September 6, 2024 1

I think I know what me the issue you reported, will check later today.

from flutter-apns.

szotp avatar szotp commented on September 6, 2024

Please check on latest prelease (1.5.0-dev.1). Note that this must be tested in release mode, otherwise app will just crash on start (known bug flutter/flutter#67624 (comment)).

from flutter-apns.

mrdc avatar mrdc commented on September 6, 2024

Please check on latest prelease (1.5.0-dev.1)

Hi, I'm testing this version right now. When app is in foreground payload.data.entries.first.key and payload.data.entries.first.value do work - I have access to the data, but when going from background to foreground with onResume, these fields are empty: in logs actionIdentifier:com.apple.UNNotificationDefaultActionIdentifier instead of real data.

BTW How can I access data in apns 1.5.0+ as in earlier versions: something like this: message['aps']['alert']['body']?

from flutter-apns.

szotp avatar szotp commented on September 6, 2024

BTW How can I access data in apns 1.5.0+ as in earlier versions: something like this: message['aps']['alert']['body']?

That's not possible, because firebase_messaging on Android side has discarded Map<String, dynamic> in favor of RemoteMessage object. But you should be able to get body parameter with payload.notification.body

from flutter-apns.

mrdc avatar mrdc commented on September 6, 2024

That's not possible, because firebase_messaging on Android side has discarded Map<String, dynamic> in favor of RemoteMessage object. But you should be able to get body parameter with payload.notification.body

Thanks, it works. Also for subtitle, sound, badge etc via payload.notification.apple

I'm quite new to all this firebase stuff, so it's not clear - I'm using iOS, so should I switch to flutter_apns_only?

from flutter-apns.

szotp avatar szotp commented on September 6, 2024

For most use cases I recommend using flutter_apns. If you are not supporting Android, or want to have custom notification handling there, you can go with flutter_apns_only.

from flutter-apns.

szotp avatar szotp commented on September 6, 2024

Checked the issue, I think the problem is on your side. You are logging payload.data.entries.first but there may be more entries, so just log entire payload.data map.

Adding actionIdentifier to the data map was the easiest way to pass additional information inside RemoteMessage object, the downside is that you will see more data entries than expected.

from flutter-apns.

mrdc avatar mrdc commented on September 6, 2024

Checked the issue, I think the problem is on your side. You are logging payload.data.entries.first but there may be more entries, so just log entire payload.data map.

Double checked - I've looked at wrong output in console, so no issues :) Works fine in foreground, background, locked states.
Thanks!

from flutter-apns.

lordgreg avatar lordgreg commented on September 6, 2024

@moreirawebmaster you can of course re-open the issue if your report wasn't resolved with our update. Thank you.

from flutter-apns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.