pusher / push-notifications-flutter

Official Pusher Beams Flutter client plugin (iOS, Android and Web), receive notifications easily on your Flutter application with Pusher Beams.
https://pub.dev/packages/pusher_beams
MIT License
11 stars 30 forks source link

PusherBeamsPlugin.kt onNewIntent has incorrect argument type for overridden func #27

Closed cameronhejazifar closed 2 years ago

cameronhejazifar commented 2 years ago

I am getting the following error when trying to build my application with the latest version of the pusher_beams flutter plugin (1.1.0). The errors I'm receiving are:

e: ./pub-cache/hosted/pub.dartlang.org/pusher_beams_android-1.1.0/android/src/main/kotlin/com/pusher/pusher_beams/PusherBeamsPlugin.kt: (23, 1): Class 'PusherBeamsPlugin' is not abstract and does not implement abstract member public abstract fun onNewIntent(p0: Intent): Boolean defined in io.flutter.plugin.common.PluginRegistry.NewIntentListener

e: ./pub-cache/hosted/pub.dartlang.org/pusher_beams_android-1.1.0/android/src/main/kotlin/com/pusher/pusher_beams/PusherBeamsPlugin.kt: (45, 5): 'onNewIntent' overrides nothing

It appears that the onNewIntent function in the PusherBeamsPlugin.kt file should not have a nullable Intent argument. Making this change in my local .pub-cache file allows me to successfully build and run the application using the new version.

override fun onNewIntent(intent: Intent): Boolean {
    handleIntent(context, intent)
    return false
}
fbenevides commented 2 years ago

Hi, @cameronhejazifar, our team is investigating this issue. Could you please provide us what is the Android version are you using?

Thanks for the report.

niglng commented 2 years ago

Am facing same for the past 4-days now. Thinking it was my code or declaration. Below is my configuration

Flutter (Channel stable, 3.0.4, on Microsoft Windows [Version 10.0.19044.1826]) Android toolchain - develop for Android devices (Android SDK version 33.0.0) Android Studio (version 2021.1)

environment: sdk: ">=2.17.1 <3.0.0" flutter: ">=3.0.1"

I had to drop it to environment: sdk: ">=2.15.1 <3.0.0"

YET, the error continues.

luisfelipeas5 commented 2 years ago

Same issue here. The issue is related to Flutter 3, because downgrading to Flutter 2.10.6, it works

benjamin-tang-pusher commented 2 years ago

Fixed by https://github.com/pusher/push-notifications-flutter/pull/32