Bluetooth web API not detecting bluetooth in Iphone chrome browser

0
Hello Experts, Use case: I have a Mendix web application/PWA that uses Bluetooth web API to connect to BLE devices. I have deployed it on  Mendix free cloud to run it over HTTPS. This application is working fine on android devices however on the iOS device the application is not able to detect Bluetooth.   I checked on this https://docs.mendix.com/refguide/mobile/introduction-to-mobile-technologies/progressive-web-app/   link and found which features are compatible, where they have mentioned that Bluetooth is accessible over HTTPS in the chrome browser.   I am using the following code to test bluetooth connectivity export async function JSA_Scan_BT_Devices() { // BEGIN USER CODE if(!navigator.bluetooth){ alert("This device does not support bluetooth") return; } let deviceDetails = {name:String, id:String , connected:Boolean , batteryStatus:String}; var DeviceName = 'Xsens DOT' //services: ['15173000-4947-11e9-8646-d663bd873d93'] to check the battery status let options = {filters:[{name: DeviceName },{services: ['15173000-4947-11e9-8646-d663bd873d93']}]} // options.acceptAllDevices = true; //Connect to the sensor const device = await navigator.bluetooth.requestDevice(options) const server = await device.gatt.connect(); const service = await server.getPrimaryService('15173000-4947-11e9-8646-d663bd873d93'); //battery status console.log(server); console.log(service); // Get Battery Levels const characteristic = await service.getCharacteristic('15173001-4947-11e9-8646-d663bd873d93'); const value = await characteristic.readValue(); let chargingStatus ; //0 = not charging, 1= charging if (parseInt(value.getUint8(1)) === 1) chargingStatus = 'Charging'; else chargingStatus = 'Not Charging'; //Add to JSON deviceDetails.name = device.name; deviceDetails.id = device.id; deviceDetails.connected=device.gatt.connected deviceDetails.batteryStatus = value.getUint8(0) + '% ( ' +chargingStatus +' )' //Return JSON as String return JSON.stringify(deviceDetails); // END USER CODE }   Also in  one of the mendix blogs : https://www.mendix.com/blog/native-vs-web-vs-hybrid-vs-pwas/ I found in this table below that bluetooth functionality is not avaliable for PWA   Conclusion: As per Mendix blog Post: We can not use device features like Bluetooth in PWA(both Android and iOS). Mendix PWA documentation: We can access Bluetooth over HTTPS in the chrome browser(both iOS and android). As per testing done by me: I am able to access Bluetooth on android devices using the Bluetooth web APIs but fails for iOS.   Is there a need to raise a bug for this?  
asked
1 answers
2

I don’t believe web bluetooth is available for iOS devices. The browsers all use webkit on iOS (even Chrome), and it’s webkit that doesn’t support bluebooth.

https://caniuse.com/web-bluetooth

Hope this helps.

 

answered