我正在处理推送通知.我编写了以下代码来获取设备令牌.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// Add the view controller's view to the window and display.
[self.window addSubview:viewController.view];
[self.window makeKeyAndVisible];
NSLog(@"Registering for push notifications...");
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
return YES;
}
- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
NSString *str = [NSString stringWithFormat:@"Device Token=%@",deviceToken];
NSLog(@"This is device token%@", deviceToken);
}
- (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err {
NSString *str = [NSString stringWithFormat: @"Error: %@", err];
NSLog(@"Error %@",err);
}
Run Code Online (Sandbox Code Playgroud)
我能够在设备上成功运行应用程序,但无法在控制台上获取设备ID.
我对认证和配置文件没有任何问题.
iphone push-notification apple-push-notifications ios appdelegate
有谁知道Apple的APN推送通知服务中的漏洞在哪里?
我们可以确保将我们的通知安全地发送给Apple,因此我们只需要知道它们是否可以从这一点被截获?
动机:我们已经构建了一个iOS消息传递应用程序,我们将其作为100%安全的解决方案,其中一些功能在安全性之前从未被利用过.
是否可以向特定设备发送iOS推送通知?我已经构建了一个论坛类型的应用程序,用户可以创建一个问题,其他人可以回答它.我需要向特定用户发送iOS推送通知,该用户询问问题,通知他们问题已得到解答.这可以通过PHP或其他方法完成吗?