question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bluetooth is not supported in ios

See original GitHub issue

When I start device scan by calling the method startDevcieScan(), most of the time “bluetooth is not supported” alert comes. This happens only in ios. I am unable to figure out why its happening.

Below is the code snippet:

` let that = this; let deviceList = []; let count = 0;

    that.manager.startDeviceScan(["1802"], null, (error, device) => {
        if (error) {
            try {
                alert(`${error.message}`);
                Log.info(`BLE scan error: ${error.message}`);
            } catch (e) {
                Log.info(`BLE scan error: ${error}`);
            }
            return;
        }


        let localDeviceList = deviceList;
        let exists = false;

        localDeviceList.map((d) => {
            if (d.id == device.id) {
                exists = true;
            }
        });

        if (!exists) {
            deviceList.push(device);
            this.homeScreen.setState({listBLEDevices: deviceList});
            let arr = this.homeScreen.state.availableDevices;
            arr.push({id: device.id, name: device.name, connected: false});
            this.homeScreen.setState({availableDevices: arr});
        }
    });
};`

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
iosscommented, Aug 22, 2018

Maybe a bit late, but did you check first, if the state is ‘PoweredOn’? (you can request the current state, and also listen to state changes) How soon after your app started is the above code run?

0reactions
stale[bot]commented, Mar 16, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

If you can't connect a Bluetooth accessory to your iPhone or iPad
Try these steps first · Make sure that your Bluetooth accessory and iOS or iPadOS device are close to each other. · Turn...
Read more >
6 ways to fix an iPhone that won't connect to Bluetooth
6 ways to fix an iPhone that won't connect to Bluetooth ; Turn on Bluetooth · Tap on the toggle for "Bluetooth." ;...
Read more >
How To Fix iPhone Bluetooth Pairing Not Working In iOS 13 ...
First solution: Restart both your devices · Second solution: Turn Bluetooth off and on again · Third solution: Use the Airplane Mode ·...
Read more >
How to Fix Bluetooth iPhone, iPad, or iPod Touch - Support.com
On your iOS device, go to Settings then Bluetooth and make sure that Bluetooth is on. If you can't turn on Bluetooth or...
Read more >
iPhone Bluetooth Not Working After Upgrade - How-To Fix
Tap on Settings > Bluetooth and turn off your Bluetooth. Next, Switch off your device and turn it back on followed by enabling...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found