DeviceInfo.isHeadphonesConnected() always return false on Redmi 6
See original GitHub issueBug
I’m wondering if this is related to some kind of version incompatibility or just whether I can expect it to work - does it look like isHeadphonesConnected()
should return true
under these circumstances? Thanks very much!
Environment info
react-native info
output:
OS: macOS Mojave 10.14.5
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 26.63 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 12.3.1 - /usr/local/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.11.3 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
IDEs:
Android Studio: 3.4 AI-183.5429.30.34.5452501
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.4 => 0.61.4
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-rename: 2.4.1
Library version: 5.5.4
Steps To Reproduce
- Plug in wired headphones to Redmi 6 running Android 8
- run React Native application and log return value of
DeviceInfo.isHeadphonesConnected()
…
Describe what you expected to happen:
DeviceInfo.isHeadphonesConnected()
to returntrue
Reproducible sample code
import DeviceInfo from 'react-native-device-info';
areHeadphonesConnected();
export const areHeadphonesConnected = () => {
DeviceInfo.isHeadphonesConnected().then(enabled => {
// true or false
console.log('areHeadphonesConnected', enabled);
})
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
DeviceInfo.isHeadphonesConnected() always return false on ...
DeviceInfo.isHeadphonesConnected() always return false on Redmi 6 #1009 ... run React Native application and log return value of DeviceInfo.
Read more >react-native-device-info | Yarn - Package Manager
syncUniqueId(). This method is intended for iOS. This synchronizes uniqueId with IDFV or sets new a random string. On iOS it uses the...
Read more >react-native-device-info/CHANGELOG.md - UNPKG
270, - fix: iOS isTablet was always returning false. 271, - fix: hasSystemFeatureSync incorrectly returned Promise. 272. 273, ## 4.0.1-beta.6.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah i actaully have already played aroudn with a few of hte suggestions that I have found on stackoverflow and continue to get false with different objective-c API’s
But i’m going to keep playing around and I’ll create a PR if I end up figuring it out
No response from submitter