我試圖改變科爾多瓦插件,這樣我就可以改變從iOS音樂類別JavaScript,但我得到的科爾多瓦警告生成日誌更改科爾多瓦,nativeaudio插件
任何想法,我是錯我的代碼?第一個參數是工作,但第二個不
audio.setCategory('AVAudioSessionCategoryAmbient',
'AVAudioSessionCategoryOptionMixWithOthers')
和iOS節:
- (void) setCategory:(CDVInvokedUrlCommand *)command {
NSArray* arguments = command.arguments;
NSString *category = [arguments objectAtIndex:0];
NSString *options = [arguments objectAtIndex:1];
[[AVAudioSession sharedInstance] setCategory:category withOptions:options error:nil];
[self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK] callbackId:command.callbackId];
}
我收到以下警告
/project/koeriersapp/Plugins/cordova-plugin-nativeaudio/NativeAudio.m:67:71: warning: incompatible pointer to integer conversion sending 'NSString *__strong' to parameter of type 'AVAudioSessionCategoryOptions' (aka 'enum AVAudioSessionCategoryOptions') [-Wint-conversion] [[AVAudioSession sharedInstance] setCategory:category withOptions:options error:nil]; ^~~~~~~~~~~~ In module 'AVFoundation' imported from /project/koeriersapp/Plugins/cordova-plugin-nativeaudio/NativeAudio.h:11: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h:364:85: note: passing argument to parameter 'options' here - (BOOL)setCategory:(NSString *)category withOptions:(AVAudioSessionCategoryOptions)options error:(NSError **)outError NS_AVAILABLE_IOS(6_0); ^
僅供參考,phongap已過時,使用'cordova'名 –