Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update iOS bridge #176

Merged
merged 11 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/swift-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Swift Lint

on: [pull_request]

jobs:
lint:
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set Xcode 14
run: |
sudo xcode-select -switch /Applications/Xcode_14.1.app

- name: Lint
run: cd ios && swiftlint --strict # force to fix warnings too
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ class AmplitudeFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
(map["deviceManufacturer"] as? Boolean)?.let { if (!it) trackingOptions.disableDeviceManufacturer() }
(map["osVersion"] as? Boolean)?.let { if (!it) trackingOptions.disableOsVersion() }
(map["osName"] as? Boolean)?.let { if (!it) trackingOptions.disableOsName() }
(map["versionName"] as? Boolean)?.let { if (!it) trackingOptions.disableVersionName() }
(map["adid"] as? Boolean)?.let { if (!it) trackingOptions.disableAdid() }
(map["appSetId"] as? Boolean)?.let { if (!it) trackingOptions.disableAppSetId() }
(map["deviceBrand"] as? Boolean)?.let { if (!it) trackingOptions.disableDeviceBrand() }
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
platform :ios, '13.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
20 changes: 12 additions & 8 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
PODS:
- Amplitude (8.16.1)
- amplitude_flutter (0.0.1):
- Amplitude (= 8.16.1)
- AmplitudeSwift (~> 1.0.0)
- Flutter
- AmplitudeSwift (1.0.0):
- AnalyticsConnector (~> 1.0.1)
- AnalyticsConnector (1.0.3)
- Flutter (1.0.0)

DEPENDENCIES:
Expand All @@ -11,7 +13,8 @@ DEPENDENCIES:

SPEC REPOS:
trunk:
- Amplitude
- AmplitudeSwift
- AnalyticsConnector

EXTERNAL SOURCES:
amplitude_flutter:
Expand All @@ -20,10 +23,11 @@ EXTERNAL SOURCES:
:path: Flutter

SPEC CHECKSUMS:
Amplitude: ef9ed339ddd33c9183edf63fa4bbaa86cf873321
amplitude_flutter: 8ddb231989e68ed8c005c838d7fc59edbca09833
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
amplitude_flutter: 16812bda98a0de430b0021dbd59648c84b76f9ed
AmplitudeSwift: 17755f7599198721c32e26b884423759c2daec7d
AnalyticsConnector: a53214d38ae22734c6266106c0492b37832633a9
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854

PODFILE CHECKSUM: fe0e1ee7f3d1f7d00b11b474b62dd62134535aea
PODFILE CHECKSUM: cc1f88378b4bfcf93a6ce00d2c587857c6008d3b

COCOAPODS: 1.11.3
COCOAPODS: 1.12.1
6 changes: 4 additions & 2 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,14 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Amplitude/Amplitude.framework",
"${BUILT_PRODUCTS_DIR}/AmplitudeSwift/AmplitudeSwift.framework",
"${BUILT_PRODUCTS_DIR}/AnalyticsConnector/AnalyticsConnector.framework",
"${BUILT_PRODUCTS_DIR}/amplitude_flutter/amplitude_flutter.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Amplitude.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AmplitudeSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AnalyticsConnector.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/amplitude_flutter.framework",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
14 changes: 14 additions & 0 deletions ios/Classes/FlutterLibraryPlugin.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Foundation
import AmplitudeSwift

class FlutterLibraryPlugin: BeforePlugin {
static let sdkLibrary = "amplitude-flutter"
// Version is managed automatically by semantic-release in release.config.js, please don't change it manually
static let sdkVersion = "4.0.0-beta.0"

override func execute(event: BaseEvent) -> BaseEvent? {
event.library = "\(FlutterLibraryPlugin.sdkLibrary)/\(FlutterLibraryPlugin.sdkVersion)"

return event
}
}
Loading
Loading