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

Airship initialization code stopping methodChannel of Flutter module #207

Open
gauravgupta188 opened this issue Jul 3, 2024 · 2 comments

Comments

@gauravgupta188
Copy link

gauravgupta188 commented Jul 3, 2024

Hi Team,

Effected Airship Version : 7.5.0

We are using Airship_Flutter with another method channel . After airship initialization code, one of my method channel stopped working. When we commented airship code , method channel started working.

Airship.takeOff(config);
Airship.push.android.setBackgroundPushReceivedHandler(backgroundMessageHandler);

These two lines are stopping method channel. On Click on one button, We are calling this line in Android.

ValidicPackagePlugin.methodChannel.invokeMethod("result",nativeData)

Same kind of issue was in Firebase Messaging . Kindly check this ticket

firebase/flutterfire#9689

Solution was available on this ticket.

firebase/flutterfire#9446 (comment)

They come with solutions that i tried on airship code too. It is not working with airship_flutter

@pragma('vm:entry-point')
Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
// handle message
}

I tried same with airship_flutter and it is not working.

@pragma('vm:entry-point')
Future backgroundMessageHandler(PushReceivedEvent event) async {
debugPrint("Background Push Received $event");
}

Any support will be highly appreciated.

@rlepinski
Copy link
Collaborator

That fix is if its always broken in release mode which we might need still. I think this might be a possible solution - la-haus/flutter-twilio-conversations#4

This might take us some time to figure out if its not just a mismatch of attach/detach calls

@gauravgupta188
Copy link
Author

Hi @rlepinski

Thanks for your response.

I checked this fix earlier and implemented in my case. But it was not working.

Currently I just comment out this line and my method channel is working fine.

Airship.push.android.setBackgroundPushReceivedHandler(backgroundMessageHandler);

This issue looks not related to onAttachedToEngine. Let me know , if you know more details. My code base is too big , so giving sample code is not feasible.

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

No branches or pull requests

2 participants