iPhone的Devicetoken用于推送通知?

发布于 2024-08-19 19:27:04 字数 382 浏览 2 评论 0原文

我尝试过 PushMeBaby 作为服务器。我面临的问题是,当应用程序启动时,推送通知被激活,它提示我连接到 itunes 以获得推送通知,但既没有

didRegisterForRemoteNotificationsWithDeviceToken

didFailToRegisterForRemoteNotificationsWithError

没有被调用。因此,我无法获取设备令牌以从 PushMeBaby mac 服务器将通知推送到我的设备进行测试。我有一个越狱的 iphone 2g,运行 iPhone OS 3.1.2

任何人都可以帮我解决这个问题...

提前谢谢...

I have tried PushMeBaby as server. The problem which I am facing is that the Push notification gets activated as when the app launches it prompts me to connect to itunes for push notification, but neither the

didRegisterForRemoteNotificationsWithDeviceToken

nor

didFailToRegisterForRemoteNotificationsWithError

get called. So I am not able to get the device token to push the notification to my device from PushMeBaby mac server for testing. I am having a jailbroken iphone 2g with iPhone OS 3.1.2

Can anyone help me with this...

Thanx in advance...

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

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

发布评论

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

评论(2

弥繁 2024-08-26 19:27:05

这里的问题是您使用的是越狱的 iPhone。根据我的经验,APNS 不为“被黑”的设备提供服务,第一个症状是它们不发送回复。您可以借用设备来验证这一点。

The problem here is that you are using Jailbroken iPhone. According to my experience APNS does not serve 'hacked' devices and the first symptom is that they do not send a reply. You can borrow a device to verify this.

烧了回忆取暖 2024-08-26 19:27:05
- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)dToken { 

    NSString *strToken = [NSString 
                     stringWithFormat:@"%@",dToken];

    NSLog(@"deviceToken is : %@",strToken);

    strToken = [strToken stringByReplacingOccurrencesOfString:@" " withString:@""];
    strToken = [strToken stringByReplacingOccurrencesOfString:@"<" withString:@""];
    strToken = [strToken stringByReplacingOccurrencesOfString:@">" withString:@""];

    NSLog(@"deviceToken is : %@",strToken);
}
- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)dToken { 

    NSString *strToken = [NSString 
                     stringWithFormat:@"%@",dToken];

    NSLog(@"deviceToken is : %@",strToken);

    strToken = [strToken stringByReplacingOccurrencesOfString:@" " withString:@""];
    strToken = [strToken stringByReplacingOccurrencesOfString:@"<" withString:@""];
    strToken = [strToken stringByReplacingOccurrencesOfString:@">" withString:@""];

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