Comments (5)
Working on a major SDK update where I will add this with foreground presentation options.
from airship-flutter.
We're facing a similar need here. In our AppDelegate didFinishLaunchingWithOptions
method we set our foreground presentation options as appropriate:
NotificationCenter.default.addObserver(forName: Airship.airshipReadyNotification, object: nil, queue: nil) { notification in
if #available(iOS 14, *) {
Airship.push.defaultPresentationOptions = [.badge, .banner, .list, .sound]
Airship.push.notificationOptions = [.badge, .sound]
} else {
Airship.push.defaultPresentationOptions = [.alert, .badge, .sound]
Airship.push.notificationOptions = [.badge, .sound]
}
}
but we're not auto initialising the Airship SDK and are instead calling takeOff
slightly later on from Flutter.
When we call takeOff
from Flutter, the platform method handler then calls AirshipAutopilot.attemptTakeOff()
(line 184 of SwiftAirshipPlugin.swift) which in turn calls Airship.push.defaultPresentationOptions = [.alert]
(line 30 of AirshipAutopilot.swift).
from airship-flutter.
@tomalabaster You may need to delay setting the options til the next run loop by wrapping what you have in
DispatchQueue.main.async {
}
We have a major plugin rewrite coming that will add support for this and potentially be able to set it per notification all through flutter. This PR is the start of it - #161 we are just wrapping up a major native SDK release then we will focus on getting plugins up to date. I am hoping for a new flutter plugin by the end of this month.
from airship-flutter.
Thanks @rlepinski will give that a try and keep an eye out 👍
from airship-flutter.
We added support in 7.0.0:
Setting options you want to register for:
Airship.push.iOS.setNotificationOptions([IOSNotificationOption.alert, IOSNotificationOption.badge, ...])
Foreground presentation options:
Airship.push.iOS.setForegroundPresentationOptions([IOSForegroundPresentationOption.list, IOSNotificationOption.banner, ...])
from airship-flutter.
Related Issues (20)
- NoClassDefFoundError. HOT 7
- The size of the iOS installation package is abnormal HOT 3
- Update to Airship iOS 16.10? HOT 4
- Airship.onChannelRegistration is never called on iOS HOT 2
- 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
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.