Comments (9)
flutterHotRestart
is called during any fbp launch, not just hot restart.
edit: just now, in this commit (29561d5) i renamed it to flutterRestart
from flutter_blue_plus.
did you look here: https://github.com/boskokg/flutter_blue_plus?tab=readme-ov-file#missingpluginexceptionno-implementation-found-for-method-xxxx-
MissingPluginException(No implementation found for method XXXX ...)
If you just added flutter_blue_plus to your pubspec.yaml, a hot reload / hot restart is not enough.
You need to fully stop your app and run again so that the native plugins are loaded.
Also try flutter clean.
from flutter_blue_plus.
Yes Sir, I did. Actually, this is happening because the invoke method is unable to perform a hot restart since the app is is in background.
Why my app is in background?
Because I am using home screen widget flutter and starting the BLE scan from there.
Log:
MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:332:7)
No implementation found for method flutterHotRestart
from flutter_blue_plus.
Is there any way we can scan and connect nearby BLE devices with iOS devices while the app is in background.
from flutter_blue_plus.
yes. implement this PR: #846
from flutter_blue_plus.
I cannot reproduce this problem btw. Starting from home screen works for me.
from flutter_blue_plus.
This is how I am doing this. The app is background/killed. A user can quickly connect with BT device from the widget outside without opening the app.
Using the home_widget package.
Code on button clicks.
@pragma('vm:entry-point') Future<void> interactiveCallback(Uri? uri) async { // Set AppGroup Id. This is needed for iOS Apps to talk to their WidgetExtensions await HomeWidget.setAppGroupId(Constants.appGroupId); print("interactiveCallback ${uri?.host}"); // We check the host of the uri to determine which action should be triggered. if (uri?.host == 'increment') { await connectBTDevice(); } else if (uri?.host == 'unlock') { await unlockDevice(); } }
`connectBTDevice(){
FlutterBluePlus.startScan(
timeout: const Duration(seconds: 3),
);
for (var btDevice in scanResults) {
if (btDevice.advertisementData.advName.split('-').last ==
tempDeviceId) {
await btDevice.connect();
}
}
`
from flutter_blue_plus.
Ah, I did not understand what you meant by Home Screen Widget. Thank you for the screenshot.
This is not something I know how to fix. Sorry. If you fix it, please open PR.
My guess is that the problem must be fixed in the home_widget
package, not fbp
from flutter_blue_plus.
No i have not been able to fix this yet.
Thanks for your replies and the quick support.
from flutter_blue_plus.
Related Issues (20)
- [Feature]: iOS Core Bluetooth Background Processing support HOT 1
- [Help]: Initializing BluetoothAdapter throws exception HOT 4
- [Help]: Turning off write in service change. HOT 1
- [Help]: Android: SCAN_FAILED_ALREADY_STARTED after turning Bluetooth Off then On HOT 27
- [Help]: iOS: Permission.bluetooth.status is denied HOT 1
- [Help]: Huawei phones cannot search for Bluetooth devices HOT 2
- [Help]: mtu request with 133 error code HOT 2
- [Help]: "scanResults can't be accessed through an instance." HOT 2
- Crashing on Android 14+ due to java "UUID string too large" error HOT 2
- [Help]: 订阅蓝牙连接状态结果返回太久 HOT 1
- [Help]: Can't connect again after call device.disconnect. (FlutterBluePlusException | requestMtu | fbp-code: 1 | Timed out after 15s) HOT 6
- [Help]: Parsing characteristic data HOT 1
- [Help]: How to use write indicate HOT 2
- [Help]: Not able to perform indicate and writeWithoutResponse operation on IOS, working fine on Android HOT 7
- [Help]: Can't print even when char write is true HOT 1
- [Help]: How to use write indicate HOT 2
- [Issue]: discoverServices: GATT_ATTR_NOT_FOUND (10) HOT 2
- [Help]: device name doesnt update HOT 3
- [Help]: Slow data transmission with Phomemo thermal printer HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_blue_plus.