当didUpdateToLocation发生时,iphone在后台发送邮件 [英] iphone send mail in background when didUpdateToLocation occurs
问题描述
我开始工作了skpsmtpmessage( http://code.google.com/p/skpsmtpmessage/ )。
所以我可以在前台发送邮件。
I get working skpsmtpmessage(http://code.google.com/p/skpsmtpmessage/). So I can send mail in foreground.
现在我希望在发生didUpdateLocation时发送skpsmtpmessage在后台发送邮件。
Now I wish to send send a mail by skpsmtpmessage in background when didUpdateLocation occurs.
它在后台工作,我得到纬度和经度,但是当发送邮件开始它在第一步停止:
C:尝试连接到服务器:smtp.gmail.com:
It works in background, I get latitude and longitude, but when send mail starts It stops at first step: "C: Attempting to connect to server at: smtp.gmail.com:"
在后台进行网络连接是不可能的吗?
Is it impossible do a networks connection in background?
推荐答案
我解决了。
投入申请信息属性列表此条目:
I solve it. Put into application information property list this entry:
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
这篇关于当didUpdateToLocation发生时,iphone在后台发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!