iphone ios 3.0.1,设备无法获取设备令牌也无法报告错误?

发布于 2024-11-03 19:31:49 字数 713 浏览 1 评论 0原文

好的,我有一部 ios 3.0.1 的 iPhone 我已打开 wifi,但没有蜂窝网络。

我已经正确创建了我的配置文件和证书。为什么?...一会儿告诉你 无论如何,当我运行应用程序时,我已经放入了 NSLog,

- (void)application:(UIApplication *)app  didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken 

- (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err 

但是当我运行应用程序时,我没有得到任何东西,没有成功也没有错误。

无论如何,我尝试了相同的应用程序并在带有 ios 4.0 的 iphone 上运行它,它确实有效并且打印了设备令牌。 哦,他们都使用相同的 wifi 网络。

可能是设备的原因? ios?或者wifi连接的安全性? 在这种情况下至少不应该给我一个错误吗?

可能是缺少库文件造成的,

warning: Unable to read symbols for "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found).

谢谢

ok i have an iphone with ios 3.0.1
i have wifi turned on, no cellular network.

I have created my provisioning profile, my certificate correctly. why?... gonna tell you in a while
anyway, when i run the application, i have put NSLog in

- (void)application:(UIApplication *)app  didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken 

- (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err 

but when i run the application i don't get anything, no success nor error.

anyway i tried the SAME APPLICATION and run it on iphone with ios 4.0 and it did work and it printed the device token.
Oh and they are both using the same wifi network.

could it be the device? the ios ? or the security of the wifi connection?
and shouldn't at least give me an error in that case?

could that be caused by the missing library file

warning: Unable to read symbols for "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found).

thank you

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

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

发布评论

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

评论(1

み格子的夏天 2024-11-10 19:31:49

根据 Apple 文档

无委托回调

当第一个具有推送功能的应用程序安装在设备上时,iOS 会尝试
与推送服务建立持久网络连接
将由设备上所有具有推送功能的应用程序共享。

如果委托都没有回调
应用程序:didRegisterForRemoteNotificationsWithDeviceToken:
也不
应用程序:didFailToRegisterForRemoteNotificationsWithError:
被称为,这意味着这
尚未建立连接
成立。

这不一定是错误
健康)状况。该设备可能没有
根本无法连接互联网,因为
它超出了任何手机信号塔的范围
或 Wi-Fi 接入点,或者可能是
在飞行模式下。而不是治疗
这是一个错误,您的应用程序应该
正常继续,仅禁用该
依赖推送的功能
通知。

请记住网络可用性
可以经常改变。一旦
与推送的持久连接
服务成功,其中之一
前面提到的应用程序
将调用委托方法。

推送通知使用蜂窝网络
尽可能使用数据网络,甚至
如果设备当前正在使用 Wi-Fi
用于其他网络活动,例如网络
浏览或发送电子邮件。然而,推
如果出现以下情况,服务将退回到 Wi-Fi:
蜂窝数据服务不可用。

如果您的设备能够使用
蜂窝数据网络,检查它
有有效的蜂窝数据计划。转动
在“设置”中关闭 Wi-Fi,看看是否可以
仍然可以使用 Safari 浏览网页,
例如。另一方面,如果
推送服务使用Wi-Fi,任何
您的设备和设备之间的防火墙
Internet 必须允许 TCP 流量到达和
来自端口 5223。

注意:有一个单独的持久性
连接到推送服务
每个环境。 iOS 建立了一个
与沙箱的持久连接
发展环境建设;广告
临时和分发版本连接到
生产环境。

关于你问题的第二部分,MobileSubstrate 不是罪魁祸首,这是一条正常的日志消息......来自越狱的 iPhone :)

According to Apple Documentation :

No Delegate Callbacks

When the first push-capable app is installed on a device, iOS attempts to
establish a persistent network connection to the push service that
will be shared by all push-capable apps on the device.

If neither delegate callback
application:didRegisterForRemoteNotificationsWithDeviceToken:
nor
application:didFailToRegisterForRemoteNotificationsWithError:
is called, that means that this
connection has not yet been
established.

This is not necessarily an error
condition. The device may not have
Internet connectivity at all because
it is out of range of any cell towers
or Wi-Fi access points, or it may be
in airplane mode. Instead of treating
this as an error, your app should
continue normally, disabling only that
functionality that relies on push
notifications.

Keep in mind that network availability
can change frequently. Once the
persistent connection to the push
service succeeds, one of the
previously-mentioned application
delegate methods will be called.

Push notifications use the cellular
data network whenever possible, even
if the device is currently using Wi-Fi
for other network activity such as web
browsing or email. However, the push
service will fall back to Wi-Fi if
cellular data service isn't available.

If your device is capable of using the
cellular data network, check that it
has an active cellular data plan. Turn
off Wi-Fi in Settings and see if you
can still browse the web with Safari,
for example. On the other hand, if the
push service is using Wi-Fi, any
firewalls between your device and the
Internet must allow TCP traffic to and
from port 5223.

NOTE: There is a separate persistent
connection to the push service for
each environment. iOS establishes a
persistent connection to the sandbox
environment for development builds; ad
hoc and distribution builds connect to
the production environment.

About second part of your question, MobileSubstrate is not the culprit, this is a normal log message... from a jailbroken iPhone :)

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