in-app-payments-flutter-plugin
in-app-payments-flutter-plugin copied to clipboard
refactor(android): remove v1 embedding APIs and update to FlutterActi…
…vity
Summary
Migrate plugin to Android V2 embedding and remove deprecated registerWith() usage
Related issues
Related Issues
- related to deprecated Android plugin API usage
- Improves compatibility with modern Flutter projects
- Prepares plugin for future-proof integration
Fix #
- Deprecated registerWith() method removed
- Introduced FlutterPlugin lifecycle (onAttachedToEngine / onDetachedFromEngine)
- Added optional ActivityAware for activity access if needed
Changelog
- Removed deprecated registerWith() method
- Implemented FlutterPlugin for proper registration
- Added ActivityAware support for activity-based operations
- Ensured backward compatibility and proper cleanup in onDetachedFromEngine
- message This commit upgrades the Android side of the plugin to use the Flutter V2 plugin API. The deprecated registerWith() method has been removed and replaced with the recommended onAttachedToEngine() lifecycle method. ActivityAware was also implemented to manage activity context when needed. This aligns with Flutter's current standards and avoids runtime warnings in apps using this plugin.
Test Plan
- Run flutter build apk to ensure no compile-time errors
- Verified plugin registration in both debug and release builds
- Tested method channel communication between Dart and native
- Confirmed activity-based features (if used) are functioning correctly
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
Building still complains about error: cannot find symbol for io.flutter.plugin.common.PluginRegistry.Registrar in CardEntryModule.java, GooglePayModule.java and SquareInAppPaymentsFlutterPlugin.java.
I think the fix is simply removing unused private constructors for those three java files. Can you please update those files?
you should resolve this issue very quickly lots of our Square client are having issue with new release. @CLAassistant @plinio-square
Any updates on when this will be merged?