如何使用 Objective-C 在 iPhone 中查看未接来电?

发布于 2024-08-20 03:41:38 字数 41 浏览 5 评论 0原文

如何使用 Objective-C 在 iPhone 中查看未接来电?

How can I check missed call in iPhone using Objective-C?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

半透明的墙 2024-08-27 03:41:38

第三方软件无法访问 iPhone 手机。幸运的是。

There is no access to the iPhone phone from third party software. Luckily.

夏见 2024-08-27 03:41:38

沙箱可防止第三方应用程序访问手机功能。因此无法检测未接来电。

The sandbox prevents access to the phone functions from third-party apps. Thus there is no way to detect missed calls.

掩于岁月 2024-08-27 03:41:38

使用核心电话框架,检测呼叫状态变化。
监听来电。现在,当有来电时,您的应用程序将收到通知。

此后,当弹出警报时,将调用applicationWillResignActive

  1. 如果用户接受调用,则会调用 applicationDidEnterBackground ,然后当用户切换回您的应用程序时 applicationDidBecomeActive 将被调用。
  2. 如果用户拒绝呼叫或呼叫者在接受/拒绝之前结束呼叫,则将调用 applicationDidBecomeActive

第二种情况表示未接来电。

Using Core Telephony framework, detect for call state changes.
Listen for incoming calls. Now your application will be notified when there is an incoming call.

After this, when the alert pops up, applicationWillResignActive is called.

  1. If the user accepts the call, applicationDidEnterBackground is called, and then when user switches back to your application applicationDidBecomeActive will be called.
  2. If the user rejects the call or the calling person ends the call before accept/reject, applicationDidBecomeActive will be called.

The second case indicates a missed call.

森林迷了鹿 2024-08-27 03:41:38

当您有来电时,

- (void)applicationWillResignActive:(UIApplication *)application;

将调用该函数,如果错过来电,应用程序将再次激活并

- (void)applicationDidBecomeActive:(UIApplication *)application;

调用该函数。

这样,您就可以检测未接来电。据我所知,没有其他方法可以做到这一点。

唯一的缺点是,当您的应用程序处于活动状态时锁定/解锁设备时也会调用这些方法,因此您将无法知道是未接来电还是用户锁定了设备。

When you have an incoming call, the function

- (void)applicationWillResignActive:(UIApplication *)application;

is called and if the call gets missed, the application will be active again and the function

- (void)applicationDidBecomeActive:(UIApplication *)application;

is called.

This way, you can detect missed calls. There is no other method to do this that i am aware of.

The only drawback is that these methods are also called when you Lock/Unlock the device when your application is active so you will not be able to know whether it was a missed call or the user locked the device.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文