我必須解決在Objective-C以下問題:Objective-C的補充電話
- 背景
- 應用對於事件,我需要調用的特定電話號碼iPhone,但它仍然在後臺
當我看到我的日誌,電話的方法將被調用,但電話號碼不是由iOS撥號。
以下是操作方法:
// ---------------------------------- -------------- //
- (IBAction)actionCall:(id)sender
{
id<ICallModel> _AutoCall = [self retrieveAutoCall];
if(_AutoCall != nil)
{
DDLogDebug(@"RESCUE CALL: %@",_AutoCall.PhoneNumber);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",_AutoCall.PhoneNumber]]];
}
[self actionCancel:nil];
}
// ------------------------- ----------------------- //
如果應用程序處於活動狀態,那麼它可以很好地工作。 我已經添加了適當的背景模式。
是否有可能通過某種方式實現此流程?
感謝, 湯姆
我注意到它也適用於應用程序處於活動狀態時鎖定手機之前。 – Chris