Closed LiliaRud closed 7 months ago
@LiliaRud pls check this doc,if you add this permission?and Capabilities Access Wi-Fi Information https://developer.tuya.com/en/docs/app-development/ble?id=Ka5vcxzbglphd#title-1-Permissions
@taojingGino yes, all permissions and Capabilities Access Wi-Fi Information are added
Also, just saw this warning. Maybe, it could be connected too?
API MISUSE: <CBCentralManager: 0x2801e4a00> has no restore identifier but the delegate implements the centralManager:willRestoreState: method. Restoring will not be supported
Full logs like this:
[blekit] -- start scan Scantype:1 cacheStatu:1
Bluetooth Background Permission is not enabled in the current application
ThingBLEScan ==> BLE Device Start Listening : discoverServiceUUID
service (
)
options {
}
API MISUSE: <CBCentralManager: 0x2812952c0> has no restore identifier but the delegate implements the centralManager:willRestoreState: method. Restoring will not be supported
CBCentralManagerStatePoweredOn
ThingBLEScan ==> BLE Device Start Listening : discoverServiceUUID
service (
)
options {
}
This application is for testing only, but not for commercial use. If the number of registered users reaches the limit, new users cannot be registered.
[blekit] start connect system (null) <__NSMallocBlock__: 0x282df09f0>
ble stop scan clearCache:1
Also, noticed Bluetooth Background Permission is not enabled in the current application but all needed permissions are there
Ok, so I added another permission (which wasn't mentioned in any documentation) and it fixed warnings mentioned above, but it still can't find the device and doesn't trigger didDiscoveryDeviceWithDeviceInfo
<key>UIBackgroundModes</key>
<array>
<string>bluetooth-central</string>
</array>
Logs:
[blekit] -- start scan Scantype:1 cacheStatu:1
ThingBLEScan ==> BLE Device Start Listening : discoverServiceUUID
service (
A201,
FD50
)
options {
kCBScanOptionAllowDuplicates = 0;
}
CBCentralManagerStatePoweredOn
ThingBLEScan ==> BLE Device Start Listening : discoverServiceUUID
service (
A201,
FD50
)
options {
kCBScanOptionAllowDuplicates = 0;
}
[blekit] start connect system (null) <__NSMallocBlock__: 0x280dd2460>
This application is for testing only, but not for commercial use. If the number of registered users reaches the limit, new users cannot be registered.
This application is for testing only, but not for commercial use. If the number of registered users reaches the limit, new users cannot be registered.
This application is for testing only, but not for commercial use. If the number of registered users reaches the limit, new users cannot be registered.
Connection 1: cleaning up
Connection 3: cleaning up
Connection 1: done
Connection 3: done
ble stop scan clearCache:1
pls check this permission
Unable to scan Bluetooth devices, it is highly likely that these two permissions were not added @LiliaRud
@taojingGino all permissions are set
<key>NSBluetoothAlwaysUsageDescription</key>
<string>For Bluetooth scan</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>For Bluetooth scan</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>For Bluetooth scan</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>For Bluetooth scan</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>For Bluetooth scan</string>
<key>UIBackgroundModes</key>
<array>
<string>bluetooth-central</string>
</array>
Everything that needs to be added looks have been added, Can you try another Bluetooth device for testing? We have run our official demo here and can find Bluetooth devices @LiliaRud
@taojingGino as it turned out, I was provided with wrong information and device is Bluetooth Mesh as I figured out by myself. But when I was trying different connection methods from this app, I wasn't able to test SIG Mesh scan as there wasn't implemented createSIGMeshWithHomeId method, so I added it and then was able to find the device.
Hi! I'm developing an app using SDK to control Ambiance Light device. I've cloned this example and wasn't able to find my device through Bluetooth. While with Smart Life app I can find, connect and control it.
Seems like didDiscoveryDeviceWithDeviceInfo doesn't call at all.
I'm adding screen records from both this app and Smart Life app, also adding logs.
My env: iPhone 13 Pro iOS 17.1.2 Xcode 15.2
Logs:
https://github.com/tuya/tuya-home-ios-sdk-sample-objc/assets/17880913/c709bb3c-f3b5-4ccc-aa25-0d60bbbb289e
https://github.com/tuya/tuya-home-ios-sdk-sample-objc/assets/17880913/27458c5f-6e33-4422-b82e-2dd0c6649bf6
All permissions are granted to app:
Thank you for any help!