Skip to content

Commit

Permalink
removed obj-c plugin wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Litvinenko committed Jan 6, 2025
1 parent 7b12ec2 commit dce40a2
Show file tree
Hide file tree
Showing 12 changed files with 102 additions and 83 deletions.
124 changes: 70 additions & 54 deletions example/ios/Runner.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions ios/airship_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ Airship flutter plugin.
s.author = { 'Airship' => '[email protected]' }
s.source = { :path => '.' }
s.source_files = 'airship_flutter/Sources/airship_flutter/**/*'
s.public_header_files = 'airship_flutter/Sources/airship_flutter/obj-c/**/*.h'
s.dependency 'Flutter'
s.ios.deployment_target = "14.0"
s.dependency "AirshipFrameworkProxy", "11.1.0"
s.swift_version = "5.0.0"
s.resource_bundles = {'airship_flutter_privacy' => ['airship_flutter/Sources/airship_flutter/swift/PrivacyInfo.xcprivacy']}
s.resource_bundles = {'airship_flutter_privacy' => ['airship_flutter/Sources/airship_flutter/PrivacyInfo.xcprivacy']}
end

7 changes: 0 additions & 7 deletions ios/airship_flutter/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,11 @@ let package = Package(
.package(url: "https://github.com/urbanairship/airship-mobile-framework-proxy.git", from: "11.2.1")
],
targets: [
.target(
name: "airship_flutter_objc",
path: "Sources/airship_flutter/obj-c",
publicHeadersPath: "include"
),
.target(
name: "airship_flutter",
dependencies: [
"airship_flutter_objc",
.product(name: "AirshipFrameworkProxy", package: "airship-mobile-framework-proxy")
],
path: "Sources/airship_flutter/swift",
resources: [
.process("PrivacyInfo.xcprivacy")
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import Flutter
import AirshipKit
import AirshipFrameworkProxy

#if canImport(AirshipCore)
import AirshipCore
#else
import AirshipKit
#endif

public class AirshipAutopilot: NSObject {

@objc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import Foundation
import AirshipKit
import SwiftUI
import Flutter

#if canImport(AirshipCore)
import AirshipCore
#else
import AirshipKit
#endif

class AirshipEmbeddedViewFactory: NSObject, FlutterPlatformViewFactory {
let registrar: FlutterPluginRegistrar
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import Foundation
import AirshipKit
import WebKit
import Flutter

#if canImport(AirshipCore)
import AirshipCore
#else
import AirshipKit
#endif

class AirshipInboxMessageViewFactory : NSObject, FlutterPlatformViewFactory {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import Flutter
import UIKit
import AirshipKit
import AirshipFrameworkProxy
import Combine

public class SwiftAirshipPlugin: NSObject, FlutterPlugin {
#if canImport(AirshipCore)
import AirshipCore
#else
import AirshipKit
#endif

public class AirshipPlugin: NSObject, FlutterPlugin {
private static let eventNames: [AirshipProxyEventType: String] = [
.authorizedNotificationSettingsChanged: "com.airship.flutter/event/ios_authorized_notification_settings_changed",
.pushTokenReceived: "com.airship.flutter/event/push_token_received",
Expand All @@ -21,18 +26,18 @@ public class SwiftAirshipPlugin: NSObject, FlutterPlugin {

private let streams: [AirshipProxyEventType: AirshipEventStream] = {
var streams: [AirshipProxyEventType: AirshipEventStream] = [:]
SwiftAirshipPlugin.eventNames.forEach { (key: AirshipProxyEventType, value: String) in
AirshipPlugin.eventNames.forEach { (key: AirshipProxyEventType, value: String) in
streams[key] = AirshipEventStream(key, name: value)
}
return streams
}()

private var subscriptions = Set<AnyCancellable>()

static let shared = SwiftAirshipPlugin()
static let shared = AirshipPlugin()

public static func register(with registrar: FlutterPluginRegistrar) {
SwiftAirshipPlugin.shared.setup(registrar: registrar)
AirshipPlugin.shared.setup(registrar: registrar)
}

private func setup(registrar: FlutterPluginRegistrar) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import AirshipFrameworkProxy
import UIKit

@objc(AirshipPluginLoader)
public class AirshipPluginLoader: NSObject, AirshipPluginLoaderProtocol {
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit dce40a2

Please sign in to comment.