问题描述
我有一个游戏应用程序,它使用蓝牙在两个 iOS 设备之间来回发送移动。一个人可以发出邀请让其他玩家玩,然后如果他们想玩,他们可以肯定地回应。
我目前正在使用 UIAlertController 当前显示邀请和响应,但它仅在应用程序处于前台时才有效。我想这样做,当应用程序在后台时,它仍然在侦听邀请,并在有人到达时显示邀请,即使在后台也是如此。
if ([region.identifier isEqualToString:@"com.checkers.bluetooth"]) {
[UIView animateWithDuration:1 delay:0 options:UIViewAnimationoptionCurveEaseIn animations:^{
} completion:^ (BOOL completed) {} ];
AlertView = [UIAlertController
alertControllerWithTitle:NSLocalizedString(@"PLAYGAME",nil)
message: NSLocalizedString(@"PLAYCHECKERS",nil)
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* okButton = [UIAlertAction
actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
Do things
}];
UIAlertAction* cancelButton = [UIAlertAction
actionWithTitle:@"CANCEL"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
do other things
}];
[AlertView addAction:okButton];
[AlertView addAction:cancelButton];
[self presentViewController:AlertView animated:YES completion:nil];
有人可以帮我解决这个问题吗?我让它与 UIlocalnotifications 一起工作,但已被弃用。所以我被卡住了。
我将不胜感激教程或示例。我正在使用objective-c。
谢谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)