J'essaie d'utiliser le service de notification push fourni par Apple, mais je ne suis pas en mesure d'obtenir le jeton d'appareil requis pour pousser la notification. J'utilise le code suivant pour récupérer le jeton dispositifComment obtenir devicetoken de iphone pour la notification push?
- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken
{
const void *devTokenBytes = [devToken bytes];
NSLog(@"devToken=%@",devTokenBytes);
//[self alertNotice:@"" withMSG:[NSString stringWithFormat:@"devToken=%@",devToken] cancleButtonTitle:NSLocalizedString(@"OK",@"") otherButtonTitle:@""];
//self.registered = YES;
//[self sendProviderDeviceToken:devTokenBytes]; // custom method
}
- (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err
{
NSLog(@"Error in registration. Error: %@", err);
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
for (id key in userInfo)
{
NSLog(@"key: %@, value: %@", key, [userInfo objectForKey:key]);
}
}
Je me inscris à la notification à distance en utilisant le code suivant
[[UIApplication sharedApplication]
registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeAlert |
UIRemoteNotificationTypeBadge |
UIRemoteNotificationTypeSound)];
Quelqu'un peut-il me aider ...
I J'ai le message d'avertissement suivant dans la fenêtre de la console
warning: Unable to read symbols for "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found).
Est-ce à faire quelque chose avec l'iphone jailbreaké ...
Thanx à l'avance ...
avez-vous été en mesure de résoudre son problème, car je suis également en train de tester mon application sur iphone jailbreaké et aucune des méthodes de délégué ne sont appelées lorsque j'essaie d'obtenir un jeton d'appareil Apple. Aussi, j'ai le même avertissement. –