当邮件到达iOS时收到通知吗? [英] Being notified when mail arrives on iOS?

查看:107
本文介绍了当邮件到达iOS时收到通知吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以在标准邮件应用程序中收到邮件时通知应用程序?

is there a way for an application to be notified when a mail arrives in the standard mail app?

更准确地说,我想编写一个应用程序能够从标准邮件应用程序读取包含自定义.txt格式的新联系人或事件的传入电子邮件。然后,应用程序应将此新联系人/事件添加到ipad。反之亦然:如果用户修改了联系人,则应通知我的应用程序,并且该应用程序应该能够撰写包含已修改的联系人信息的新电子邮件,并将该电子邮件发送到后端。

To be more precise, I would like to write an app which is able to read an incoming email from the standard mail app containing a new contact or event in a custom .txt format. Then, the app should add this new contact/event to the ipad. And also viceversa: if a user modifies a contact, my app should be notified and it should be able to compose a new email containing the modified contact information and send this email to a back-end.

有没有办法做到这一点?特别是,我想知道当收到新电子邮件时是否可以通知我的应用程序。

Is there a way to achieve this? In particular, I would like to know if my app could be notified when new email arrives.

我在网络上进行了大量搜索,但似乎没有标准框架或通知机制来实现这一目标。

I did a lot of search on the web but it seems there is no standard framework or notification mechanism to achieve this.

推荐答案

您可以简单地使用拉机制来完成此操作,在您的应用程序中检查新以指定的时间间隔在服务器上发送电子邮件,如果收到一封新电子邮件,例如带有预定义的标题,则可以在应用程序中获取并处理它。不确定可用于iPad / iPhone开发的库,但应该可以。

You can simply do it with 'pull' mechanism, in your application check for new emails on the server with specified interval, if a new email arrives, say with predefined title you can fetch it and process it in your application. Not sure about the libraries available for the IPad/iPhone development but that should be possible.

这篇关于当邮件到达iOS时收到通知吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆