简体   繁体   中英

iphone ios 3.0.1, device is not being able to get a device token nor reporting an error?

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

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:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM