ios遥控器有时默认为原生音乐播放器而不是我的应用程序

时间:2013-08-16 22:21:36

标签: iphone ios

我的应用程序(启动后)中大约有20次似乎没有'beginReceivingRemoteControlEvents',因此ios远程默认为本机音乐播放器。因为这个我的应用程序被拒绝(在更新,而不是初始版本),事情是我永远不会看到它发生在iPhone插入Mac和xcode只有在手机上运行应用程序时,下面是我的音频初始化常规。 希望有人可以帮忙,谢谢Mike。

-(void)viewDidAppear:(BOOL)animated
{

[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
[self becomeFirstResponder];

    [[AVAudioSession sharedInstance] setDelegate: self];
//Set the audio category of this app to playback.
NSError *setCategoryError = nil; [[AVAudioSession sharedInstance]
                                  setCategory: AVAudioSessionCategoryPlayback error: &setCategoryError];

if (setCategoryError)
{
    ShowMessageBox(@"Audio error", @"Category failed");
}

//Activate the audio session
NSError *activationError = nil;
[[AVAudioSession sharedInstance] setActive: YES error: &activationError];

if (activationError) {
    ShowMessageBox(@"Audio error", @"Activate failed");
}

}
// And also

- (BOOL)canBecomeFirstResponder
{
    return YES;
}

0 个答案:

没有答案