Home:ALL Converter>Fetch data from socket always in background and use the data to show as a push notification in FLUTTER APP(FCM should not be used)

Fetch data from socket always in background and use the data to show as a push notification in FLUTTER APP(FCM should not be used)

Ask Time:2020-05-31T20:26:43         Author:Shariar Saimon

Json Formatter

First of all I am completely a beginner in android native code, I started with flutter app development. My problem is with the implementation of push notification. I want to Fetch data from the socket API continuously in the background and use the data to show as push notification when my FLUTTER APP(NOT ANDROID APP) is in the background/foreground/killed.

If I am not wrong I know I have to code in native android but the thing is I am unable to find an example connecting the native java code with the flutter app(NOT android app) for push notification service. I am not searching for an FCM solution. Can anyone give me an example using plugins like the work manager, that works in the background? Moreover, in my flutter app, I want to navigate to another page when the notification is pressed.The task is like whenever the socket sends a message there will be a push notification (no matter the app is running or not), on clicking the notification the user can go to a specific page of the flutter app.

Author:Shariar Saimon,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/62116203/fetch-data-from-socket-always-in-background-and-use-the-data-to-show-as-a-push-n
yy