revoke or close the current platform channel in flutter - flutter

I am trying to close or revoke the current channel between dart and native plugin all that happened is app crashing, I tried to call different channels with the same name to close the current one but it sees them the same channel and also crashed with exception "java.lang.IllegalStateException Reply already submitted"
Is there any solution for my problem ?

Related

Flutter Fetch API in background when App is terminated

I'm want to fetch API every 15min and check if anything changes. Then if it does send push notification to inform the user about changes. Now my problem is that I cannot get to run the check on IOS. Does anyone have a solution for this?
There is a tool: https://pub.dev/packages/background_fetch, but it's not the perfect Dart solution for iOS to schedule background tasks as android when the app terminates, so try using Alarm Manager and
Flutter WorkManager
Also, you can try native side implementation with BGTaskScheduler

Move flutter (dart) function to foreground service ANDROID

Im working on the app sends list of data to server one by one in foreground with progress indication via push notification to user. I need to send the data to server even the app is killed with the progress indication using the android service.
Is this possible? If not please suggest me any other solutions or techniques.

How can I delete a notification channel using flutter local notification?

I'm using flutter local notification plugin and I want the user to be able to customize the notification sound and vibration but the plugin's docs says:
For Android 8.0+, sounds and vibrations are associated with
notification channels and can only be configured when they are first
created. Showing/scheduling a notification will create a channel with
the specified id if it doesn't exist already. If another notification
specifies the same channel id but tries to specify another sound or
vibration pattern then nothing occurs.
so I looked up for deleting the channel just to create a new one with the new settings and the docs says that it's a feature in android but I couldn't find any reference on how to do that.
is there's a way to do that, or is there's any another solution?
thanks in advance.
I didn't find an answer or solution about deleting channels, but I tried making a channel for every sound just by using the sound name as an id for the channel, and it worked :).

Quickblox Flutter SDK Example WebRTC doesn't connect

I'm having trouble in the Flutter SDK Example project.
Specifically the WebRTC portion. I'm unable to get a video call connected.
I have the project deployed to two Android devices. One is physical, the other is an emulator.
I updated the credentials.dart to match my application information.
One device/app has user1. Other device/app has user2. With the opponents pointed to each other.
The steps I have performed are as follows:
Settings -> init
Auth -> Login
Chat -> Connect
WebRTC -> init
WebRTC -> Subscribe Events WebRTC
WebRTC -> Call WebRTC
I can see debug info in each app, after I click call, so it seems as though the 'chat' connection is working to deliver the messages.
When I try to 'accept' I get an error that 'id' is a required parameter.
Looking at the example source, it seem the 'sessionId' is only ever set when a call is placed. How would the receiving end ever get the sessionId?
Also, anything like 'enable video' or 'start rendering local' results in a null ref error being displayed in a dialog.
QuickBlox team has resolved this issue in an updated version of Flutter SDK.
Now the described logic is working correctly.
I can confirm the latest SDK (0.2.4-alpha) fixes the issue.
Also, be sure to grant the Camera and Microphone permissions.

Can a google chrome app be prevented from closing?

I can see nothing in google's documentation to indicate how to prevent a user from closing a chrome app. Has anyone come up with a way to accomplish this? I think there is clue in the documentation about the onSuspend event. It says - After receiving onSuspend no further events will be delivered to the app, unless the suspension is aborted for some reason.
How can the suspension be aborted?
Some events can trigger an onSuspendCancel. I found that making a new XMLHttpRequest to any URL will do the trick. You could also call chrome.runtime.reload and make the app start anew.
In general there should be no need to prevent the background page from suspending, because it can be woken up with either a persistent listening socket, or runtime message, or google cloud message, etc.
If you just want to prevent the user from closing an app window, there is no way to do this, apart from implementing your own custom app window frame and intercepting for example control-w. You need to just save your work or app state outside the window context (should not be too hard to do this) so that you can still have it even when the window is closed unexpectedly.