Skip to content

Commit

Permalink
Merge pull request #232 from urbanairship/release-9.0.0
Browse files Browse the repository at this point in the history
Release 9.0.0
  • Loading branch information
crow authored Nov 16, 2024
2 parents 9e11745 + 86f9db5 commit e472992
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 42 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Flutter Plugin Changelog

## Version 9.0.0 - November 14, 2024

Major version release that drops support for v1 embeddings.

### Changes
- Drops support for deprecated v1 embeddings.

## Version 8.0.4 - November 8, 2024

Patch release that resolves an issue with Firebase integrations and fixes an issue with opt-in checks when requestAuthorizationToUseNotifications is set to false on iOS.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
package com.airship.flutter

import android.util.Log
import android.content.Context
import android.content.SharedPreferences
import android.os.Handler
import androidx.core.content.edit
import com.urbanairship.json.JsonSerializable
import com.urbanairship.json.JsonValue
import com.urbanairship.push.NotificationInfo
import com.urbanairship.push.PushMessage
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.embedding.engine.FlutterShellArgs
import io.flutter.embedding.engine.dart.DartExecutor.DartCallback
import io.flutter.embedding.engine.loader.FlutterLoader
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
Expand Down Expand Up @@ -54,24 +49,24 @@ class AirshipBackgroundExecutor(
fun startIsolate(callback: Long, args: FlutterShellArgs?) {
if (flutterEngine != null) return

val loader = FlutterLoader()
mainHandler.post {
loader.startInitialization(appContext)
loader.ensureInitializationCompleteAsync(appContext, null, mainHandler) {
if (!isIsolateStarted.get()) {
val engine = FlutterEngine(appContext, args?.toArray())
.also { flutterEngine = it }

methodChannel =
MethodChannel(engine.dartExecutor, BACKGROUND_CHANNEL).apply {
setMethodCallHandler(this@AirshipBackgroundExecutor)
}

val callbackInfo = lookupCallbackInformation(callback)
engine.dartExecutor.executeDartCallback(
DartCallback(appContext.assets, loader.findAppBundlePath(), callbackInfo)
)
if (!isIsolateStarted.get()) {
// Engine creation is still needed for background execution with v2 embeddings
val engine = FlutterEngine(appContext, args?.toArray())
.also { flutterEngine = it }

methodChannel = MethodChannel(engine.dartExecutor, BACKGROUND_CHANNEL).apply {
setMethodCallHandler(this@AirshipBackgroundExecutor)
}

val callbackInfo = lookupCallbackInformation(callback)
engine.dartExecutor.executeDartCallback(
DartCallback(
appContext.assets,
"flutter_assets",
callbackInfo
)
)
}
}
}
Expand Down
12 changes: 0 additions & 12 deletions android/src/main/kotlin/com/airship/flutter/AirshipPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result
import io.flutter.plugin.common.PluginRegistry.Registrar
import io.flutter.plugin.platform.PlatformViewRegistry
import kotlinx.coroutines.*
import java.util.concurrent.locks.ReentrantLock
Expand All @@ -47,17 +46,6 @@ class AirshipPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
private lateinit var streams: Map<EventType, AirshipEventStream>

companion object {
@JvmStatic
fun registerWith(
// Registrar is deprecated, but still recommended in case consumers don't use v2 embedding
// See: https://docs.flutter.dev/release/breaking-changes/plugin-api-migration#upgrade-steps
@Suppress("DEPRECATION")
registrar: Registrar
) {
val plugin = AirshipPlugin()
plugin.register(registrar.context().applicationContext, registrar.messenger(), registrar.platformViewRegistry())
}

internal const val AIRSHIP_SHARED_PREFS = "com.urbanairship.flutter"

internal val EVENT_NAME_MAP = mapOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package com.airship.flutter

class AirshipPluginVersion {
companion object {
const val AIRSHIP_PLUGIN_VERSION = "8.0.4"
const val AIRSHIP_PLUGIN_VERSION = "9.0.0"
}
}
5 changes: 0 additions & 5 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:label="airship_example"
android:icon="@mipmap/ic_launcher">
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/AirshipPluginVersion.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Foundation

class AirshipPluginVersion {
static let pluginVersion = "8.0.4"
static let pluginVersion = "9.0.0"
}
2 changes: 1 addition & 1 deletion ios/airship_flutter.podspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

AIRSHIP_FLUTTER_VERSION="8.0.4"
AIRSHIP_FLUTTER_VERSION="9.0.0"

#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: airship_flutter
description: "Cross-platform plugin interface for the native Airship iOS and Android SDKs. Simplifies adding Airship to Flutter apps."
version: 8.0.4
version: 9.0.0
homepage: https://www.airship.com/
repository: https://github.com/urbanairship/airship-flutter
issue_tracker: https://github.com/urbanairship/airship-flutter/issues
Expand Down

0 comments on commit e472992

Please sign in to comment.