Code Monkey home page Code Monkey logo

Comments (9)

jschmitz1 avatar jschmitz1 commented on September 25, 2024

It would also be of great help to me, if you could give me some example code how i could instead process the Push Notification and its Payload on app launch. I don't necessarily need to process it in the background as soon as it arrives on the device, i just need to be sure i process it at all.
I have looked through the documentation but couldn’t really find an example on this and had no luck trying to implement it myself. Thank you in advance

from airship-flutter.

jyaganeh avatar jyaganeh commented on September 25, 2024

Hi @jschmitz1, we're looking into this. I've been able to reproduce the behavior you're seeing, but haven't gotten to the bottom of it yet. I'll get back to you once we've identified the problem, and will check with the team to see if there's a way to delay handling of pushes received in the background like you describe. I'm not sure that's possible, currently, but we might be able to come up with something.

Thanks for the detailed report! πŸ‘

from airship-flutter.

rlepinski avatar rlepinski commented on September 25, 2024

@jschmitz1 On iOS, the app does not process the notification, instead the OS does that. Because of that, standard push notifications never actually wake up the app. To wake the app up with the push you need to send content-available: 1 (push api) or background processing (composer). Also, your app needs to be set up with background remote-notification capability. You can find that in the Xcode settings for the target.

from airship-flutter.

jschmitz1 avatar jschmitz1 commented on September 25, 2024

Hey @rlepinski, thanks for your support. We tried setting content-available to true, and it did not change the behavior for us sadly. The required capabilities are already set in the Xcode target

from airship-flutter.

rlepinski avatar rlepinski commented on September 25, 2024

I am still trying to figure this one out. I am unable to get any of the normal iOS callbacks to be called on a flutter app, with or without Airship. I verified things work on a native ap. I see this issue - flutter/flutter#52895 not sure if its related but seems like its the same problem.

from airship-flutter.

rlepinski avatar rlepinski commented on September 25, 2024

IMO its a flutter issue - flutter/flutter#52895 (comment)

If they don't agree, then I might have to make some changes in the plugin.

As a workaround, you can use this branch for now - https://github.com/urbanairship/airship-flutter/tree/workaround-bg-push

Once I hear back from the Flutter devs I'll update you with a proper solution.

from airship-flutter.

jschmitz1 avatar jschmitz1 commented on September 25, 2024

Thank you for the effort so far.
I am looking forward to a reply from the flutter team.

I tried your workaround branch and sadly it does not seem to alter the behavior for me. Possibly i am missing something here. I register my listener via the onPushReceived.listen() method and i have the Background fetch and Remote notifications capabilities activated.
Am i missing something?

from airship-flutter.

jschmitz1 avatar jschmitz1 commented on September 25, 2024

Nevermind, i figured it out. Forgot to sent the content-available field again. Thank you for the workaround branch, it's working as expected now!

from airship-flutter.

rlepinski avatar rlepinski commented on September 25, 2024

πŸŽ‰

I will probably merge the workaround in the next release. The only issue it will cause is if our plugin is using it, then other plugins wont be able to use it since it calls through to the first plugin that returns true. I cant return false since flutter wont call the completion handler with nodata if it doesn't have a plugin that returns true https://github.com/flutter/engine/blob/main/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm#L263

from airship-flutter.

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.