cordova-plugin-nativeaudio
cordova-plugin-nativeaudio copied to clipboard
Cordova 6.0.0: AudioSessionInitialize deprecated
I've upgraded cordova to version 6.0.0. When I add the cordova-plugin-nativeaudio plugin to my project, and build it (cordova build ios), the following warning appears:
/Users/arjan/Development/cordova/Test.dev/platforms/ios/Test/Plugins/cordova-plugin-nativeaudio/NativeAudio.m:32:5: warning:
'AudioSessionInitialize' is deprecated: first deprecated in iOS 7.0
[-Wdeprecated-declarations]
AudioSessionInitialize(NULL, NULL, nil , nil);
^
In module 'AudioToolbox' imported from /Users/arjan/Development/cordova/Test.dev/platforms/ios/Test/Plugins/cordova-plugin-nativeaudio/NativeAudio.h:12:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioSession.h:649:2: note:
'AudioSessionInitialize' has been explicitly marked deprecated here
AudioSessionInitialize( CFRunLoopRef inRunLoop,
^
1 warning generated.
Is there anything I can do to fix this? Workarounds?
At first audio was working fine but now i'm experiencing the same issue. Any help would be appreciated.
Same here - any help on how to fix would be much apriciated
Seems to fix it:
AudioSessionInitialize( NULL, NULL, interruptionCallback, self );
replace with
[[AVAudioSession sharedInstance] setActive:YES error:nil];
Found here: http://stackoverflow.com/questions/19710046/a-fix-for-audiosessioninitialize-deprecated
THis make the drumPad example work, but it only plays the looping background sound not the drums. I am testing with ios version 9.2.1 , cordova 6.2.0
Same here, when building in XCode, I get:
../platforms/ios/Urges/Plugins/cordova-plugin-nativeaudio/NativeAudio.m:32:5: 'AudioSessionInitialize' is deprecated: first deprecated in iOS 7.0