simple_beacons_flutter
simple_beacons_flutter copied to clipboard
version 1.0.16 - setMethodCallHandler is never been called
version 1.0.16 - setMethodCallHandler is never been called.
never been called
I've got the same problem - did you find a solution?
In my testing, I found out that the method is called when I move the app to the background. When entering it again, the beacon scanner stops monitoring again.
Me too, I found same problem on some android device, but ios no problem.
version 1.0.20 - setMethodCallHandler is never been called too. but for iOS is working fine.
Same problem. Any solution?
@baranacikgoz which platform do you use?
@baranacikgoz which platform do you use?
` if (Platform.isAndroid) {
//Prominent disclosure
await BeaconsPlugin.setDisclosureDialogMessage(
title: "Need Location Permission",
message: "This app collects location data to work with beacons.");
//Only in case, you want the dialog to be shown again. By Default, dialog will never be shown if permissions are granted.
await BeaconsPlugin.clearDisclosureDialogShowFlag(false);
}
BeaconsPlugin.channel.setMethodCallHandler((call) async {
if (call.method == 'isPermissionDialogShown') {
//Do something here
}
});
`
solved by writing this code
My code used to work like this, but it doesn't work now because it never run the setMethodCallHandler function. @umair13adil maybe you can look that.
print('HELLO');
if (Platform.isAndroid) {
//Prominent disclosure
print('HELLO ANDROID');
await BeaconsPlugin.setDisclosureDialogMessage(
title: "Arka Plan İzni",
message:
"MyMessage")
.then((value) {
print('HELLO ANDROID 2');
});
await BeaconsPlugin.clearDisclosureDialogShowFlag(false);
BeaconsPlugin.channel.setMethodCallHandler((call) async {
print("Method: ${call.method}");
if (call.method == 'scannerReady') {
await BeaconsPlugin.startMonitoring();
}
});
} else if (Platform.isIOS) {
await BeaconsPlugin.startMonitoring();
}
and that's my prints
I/flutter (22731): HELLO I/flutter (22731): HELLO ANDROID I/flutter (22731): HELLO ANDROID 2