iOS Corebluetooth:用于后台通知的自定义警报

时间:2014-10-22 00:46:22

标签: ios core-bluetooth

我认为你可以覆盖iOS"' XXXX'配件想打开“应用程序”""在我的应用代理中使用以下提醒:

 - (void)application:(UIApplication *)application didReceiveLocalNotification:    (UILocalNotification *)notification
 {
if([[UIApplication sharedApplication] applicationState] != UIApplicationStateBackground)
 {
     AudioServicesPlayAlertSound(1002);
 }
     AudioServicesPlayAlertSound(1002);

 NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
 UIAlertView *view = [[UIAlertView alloc] initWithTitle:appName  message:[notification alertBody] delegate:nil cancelButtonTitle:nil otherButtonTitles:[notification alertAction], nil];
 view.delegate = self;
 [view show];

  }

但这似乎并不适合我。

(只是为了澄清:我确实在后台运行样板警报,但我想自定义它们。)

任何指示赞赏!

0 个答案:

没有答案