【发布时间】:2014-08-11 01:41:38
【问题描述】:
我正在尝试创建一个 PushNotification 应用程序,并且正在使用 PubNub。我已经完成了所有必要的步骤:
- 在我的工作区中包含 PubNub 库
- 为应用创建正确的配置文件
- 确保 PushNotification 在配置文件中
- 为应用创建正确的 SSL 证书
- 将证书添加到钥匙串访问中
- 创建正确的 .pem 文件
- 已将文件上传到 PubNub
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( NSDictionary *)launchOptions
{
// #2 Register client for push notifications
NSLog(@" Options set");
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
[PubNub setDelegate:self];
return YES;
}
在收到一些初始编译错误后,我能够在我的设备上运行该应用程序。当我在我的设备上运行该应用程序时,我没有收到我认为应该的“...希望发送 Yo Push Notifications”消息。我可以使用 PubNun 控制台发送消息,我看到消息是通过日志收到的,但我没有收到任何通知或横幅。我在didFinishLaunchingWithOptions 方法中放置了一个NSLog,我在日志中看到了显示。
之后,我从设备中删除了应用程序,从设备中删除了配置文件,重新声明了 Xcode,然后再次编译,结果相同。不知道接下来要尝试什么。
【问题讨论】:
标签: ios objective-c push alert pubnub