Comments (9)
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.
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.
@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.
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.
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.
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.
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.
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.
π
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)
- Airship.onChannelRegistration is never called on iOS HOT 2
- iOS Notification Options support HOT 5
- Airship.activeNotifications not parsing on iOS HOT 3
- Airship.addEvent doesn't work if CustomEvent's value is null HOT 2
- iOS production key HOT 3
- Flutter 3.10.0 support HOT 1
- Airship setUserNotificationsEnabled malfunction on Android HOT 1
- iOS push messages in foreground not working HOT 6
- iOS app icon badge behaves inconsistently HOT 1
- Android device debug issue HOT 5
- Android notifications are not displayed as Heads-up notifications HOT 2
- Airship.push.iOS.resetBadge is not calling the correct method name HOT 2
- Calling Airship.push.iOS.resetBadge crashes the app HOT 1
- Airship.messageCenter.onDisplay not parsing DisplayMessageCenterEvent properly HOT 2
- Crash on launch when using FlutterEngineGroup HOT 3
- Not able to get a push notification on my iOS device from a TEST Airship project HOT 5
- Push Icon Not Appearing in Android Release Build HOT 4
- Android: App is started by push message from terminated state HOT 2
- How to send a push notification prompt to a user and access the value in code on Android? HOT 5
- onPushReceived does run in background or terminated state in Iphone HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from airship-flutter.