la-haus / flutter-segment

Segment.io library for flutter
MIT License
22 stars 139 forks source link

FlutterSegmentPlugin.java uses or overrides a deprecated API. #32

Closed danielgomezrico closed 2 years ago

danielgomezrico commented 2 years ago

We have a deprecated implementation for the plugin on android:

There's a warning running the project:

android/src/main/java/com/example/flutter_segment/FlutterSegmentPlugin.java uses or overrides a deprecated API.
vbuberen commented 2 years ago

This is caused by https://github.com/la-haus/flutter-segment/blob/master/android/src/main/java/com/example/flutter_segment/FlutterSegmentPlugin.java#L97 since middleware() is deprecated and should be replaced with useSourceMiddleware()

Screenshot 2022-06-09 at 22 06 52
ariefwijaya commented 2 years ago

@vbuberen could you create a PR for it?

vbuberen commented 2 years ago

Yes, that is the plan. Waited for Android updates PR to be merged first.

vbuberen commented 2 years ago

Looked once again and found more of deprecated things - method from Flutter V1 embedding, which is not used anymore. https://github.com/la-haus/flutter-segment/blob/master/android/src/main/java/com/example/flutter_segment/FlutterSegmentPlugin.java#L42

We were removing such things from Plus Plugins last November as well. Will also address it in my PR.