Skip to content

Commit b5d5f26

Browse files
authored
Merge pull request #8 from iamsidv/master
Fixes for iOS platform
2 parents bd80852 + 2437454 commit b5d5f26

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Assets/Plugins/DetectHeadset.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class DetectHeadset {
99

1010
static public bool Detect() {
1111

12-
#if UNITY_IOS
12+
#if UNITY_IOS && !UNITY_EDITOR
1313
return _Detect();
1414

1515
#elif UNITY_ANDROID && !UNITY_EDITOR

Assets/Plugins/iOS/DetectHeadset.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ bool _Detect() {
1111
return true;
1212
if ([[desc portType] isEqualToString:AVAudioSessionPortBluetoothHFP])
1313
return true;
14+
//It was displaying this route for bluetooth wireless headphones.
15+
//Tested with Unity 2019.1
16+
if ([[desc portType] isEqualToString:AVAudioSessionPortBluetoothA2DP])
17+
return true;
1418
}
1519

1620
return false;
1721

1822
}
1923

20-
}
24+
}

0 commit comments

Comments
 (0)