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

refactor: update iOS bridge #176

merged 11 commits into from
Mar 6, 2024

Conversation

Mercy811
Copy link
Contributor

@Mercy811 Mercy811 commented Mar 6, 2024

  • Update iOS bridge file at ios/Classes/SwiftAmplitudeFlutterPlugin.swift
  • App lifecycle events are not support in the pre-release version. Will have another ticket for it
  • Add swiftlint to CI
  • Don't have iOS native unit tests right now because the one for Android should cover all cases where method channel goes wrong.
  • Update set library logics by refactor: update iOS bridge #176 (comment)
    • Before
      • release.config.js has to change package version for Flutter, Android (BuildConfig.SDK_VERSION`) and Swift plugins separately
      • Android and Swift library plugins set library for every events
    • Now
      • release.config.js only need to change package version for Flutter
      • Flutter pass library along with configuration when init
      • Native sides read library and pass to library plugins

@Mercy811 Mercy811 marked this pull request as ready for review March 6, 2024 02:03
Copy link
Contributor

@justin-fiedler justin-fiedler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. See nits. Thanks @Mercy811 !

ios/Classes/SwiftAmplitudeFlutterPlugin.swift Outdated Show resolved Hide resolved
ios/Classes/SwiftAmplitudeFlutterPlugin.swift Outdated Show resolved Hide resolved
@@ -66,7 +65,7 @@ class AmplitudeFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
amplitude = Amplitude(configuration)

// Set library
amplitude.add(FlutterLibraryPlugin())
amplitude.add(FlutterLibraryPlugin(call.argument<String>("library")!!))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: !! could maybe throw an error? what about this instead?

Suggested change
amplitude.add(FlutterLibraryPlugin(call.argument<String>("library")!!))
amplitude.add(FlutterLibraryPlugin(call.argument<String>("library") ?? "amplitude-flutter/unknown"))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! Update both Kotlin and Swift at 4eb9b6f

@Mercy811 Mercy811 merged commit ecb59df into v4.x Mar 6, 2024
3 checks passed
@Mercy811 Mercy811 deleted the AMP-89313-update-ios-bridge branch March 6, 2024 21:32
Copy link

🎉 This PR is included in version 4.0.0-beta.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants