Skip to content

fix: fixing AudioManger so it builds#4

Open
mortocks wants to merge 1 commit intoChristopherGabba:mainfrom
audeara:fix/ios-audio-manager-builds
Open

fix: fixing AudioManger so it builds#4
mortocks wants to merge 1 commit intoChristopherGabba:mainfrom
audeara:fix/ios-audio-manager-builds

Conversation

@mortocks
Copy link
Copy Markdown

@mortocks mortocks commented Mar 9, 2026

  • removed trailing commas from function calls which makes builds fail
  • fixed option enums

- removed trailing commas from function calls
- fixed option enums
@mortocks
Copy link
Copy Markdown
Author

mortocks commented Mar 9, 2026

More context provided. When building for iOS you get the errors below. This seems to just be mostly trailing commas. It appears that XCode UI doesn't show these errors due to the editor using SourceKit which doesn't recognise the invalid swift...who knew.

[RUN_FASTLANE]
❌ (node_modules/react-native-nitro-audio-manager/ios/AudioManager.swift:181:5)

179 | type: type,
180 | reason: reason,

181 | )
| ^ unexpected ',' separator
182 |
183 | interruptionListeners.forEach { $0.callback(interruptionChangeInfo) }
184 | }

[RUN_FASTLANE]
❌ (node_modules/react-native-nitro-audio-manager/ios/AudioManager.swift:208:5)

206 | currentRoute: currentRouteDescription,
207 | reason: reason,

208 | )
| ^ unexpected ',' separator
209 |
210 | routeChangeListeners.forEach { $0.callback(routeChangeInfo) }
211 | }

[RUN_FASTLANE]
❌ (node_modules/react-native-nitro-audio-manager/ios/AudioManager.swift:571:25)

569 | )
570 | }

571 | options.insert(.allowBluetoothHFP)
| ^ type 'AVAudioSession.CategoryOptions.Element' has no member 'allowBluetoothHFP'
572 | case "AllowBluetoothA2DP":
573 | if category == .playAndRecord {
574 | options.insert(.allowBluetoothA2DP)

[RUN_FASTLANE]
❌ (node_modules/react-native-nitro-audio-manager/ios/AudioManager.swift:955:26)

953 | result.append(.duckothers)
954 | }

955 | if options.contains(.allowBluetoothHFP) {
| ^ type 'AVAudioSession.CategoryOptions' has no member 'allowBluetoothHFP'
956 | result.append(.allowbluetoothhfp)
957 | }
958 | if options.contains(.allowBluetoothA2DP) {

Comment thread ios/AudioManager.swift
)
}
options.insert(.allowBluetoothHFP)
options.insert(.allowBluetooth)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allow Bluetooth is depcrecated:
https://developer.apple.com/documentation/avfaudio/avaudiosession/categoryoptions-swift.struct

What version of xcode and swift are you building with?

@ChristopherGabba
Copy link
Copy Markdown
Owner

@mortocks can you share what Xcode and swift version you are building with? I don't have any compilation errors here and you replaced BluetoothHFP with bluetooth and bluetooth has been deprecated:
https://developer.apple.com/documentation/avfaudio/avaudiosession/categoryoptions-swift.struct

I suspect you are using an older version of xcode or swift, but I'm not positive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants