Skip to content

Commit

Permalink
Merge pull request #244 from urbanairship/MOBILE-4862
Browse files Browse the repository at this point in the history
Fix areNotificationsAllowed retrieval on Android
  • Loading branch information
crow authored Jan 8, 2025
2 parents 6364f7b + 3521b93 commit 28e7034
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions android/src/main/kotlin/com/airship/flutter/AirshipPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,14 @@ class AirshipPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
}
}
"push#isUserNotificationsEnabled" -> result.resolveResult(call) { proxy.push.isUserNotificationsEnabled() }
"push#getNotificationStatus" -> result.resolveResult(call) {
"push#getNotificationStatus" -> result.resolveDeferred(call) { callback ->
coroutineScope.launch {
proxy.push.getNotificationStatus()
try {
val status = proxy.push.getNotificationStatus()
callback(status, null)
} catch (e: Exception) {
callback(null, e)
}
}
}
"push#getActiveNotifications" -> result.resolveResult(call) {
Expand Down Expand Up @@ -277,22 +282,7 @@ class AirshipPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
}
// Live Activities

"featureFlagManager#trackInteraction" -> {
result.resolveDeferred(call) { callback ->
scope.launch {
try {
val args = call.jsonArgs()

val wrapped = JsonValue.wrap(args)
val featureFlagProxy = FeatureFlagProxy(wrapped)
proxy.featureFlagManager.trackInteraction(flag = featureFlagProxy)
callback(null, null)
} catch (e: Exception) {
callback(null, e)
}
}
}
}

"liveUpdate#start" -> result.resolveResult(call) {
try {
Expand Down

0 comments on commit 28e7034

Please sign in to comment.