【问题标题】:Push Notification on Test Device在测试设备上推送通知
【发布时间】:2015-07-29 15:18:01
【问题描述】:

我已经为推送通知实现了 Urban Airship。正在通过 Urban Airship 仪表板识别 namedUser.identifier,但它说该设备未选择加入。

这可能是因为它是在测试设备(不是模拟器)上运行的,并且没有使用启用通知的有效证书进行签名(客户端对应用程序进行签名,因此无法访问)。

如果应用没有使用正确的证书签名,通知会一直被禁用吗?

【问题讨论】:

    标签: ios objective-c xcode notifications urbanairship.com


    【解决方案1】:

    是的,可能是证书相关的问题,但一定要检查一下:https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html

    因为您必须为应用注册远程通知,如果您还没有的话。例如,您可以这样做:

    UIUserNotificationType types = UIUserNotificationTypeBadge |
                 UIUserNotificationTypeSound | UIUserNotificationTypeAlert;
    
    UIUserNotificationSettings *mySettings =
                [UIUserNotificationSettings settingsForTypes:types categories:nil];
    
    [[UIApplication sharedApplication] registerUserNotificationSettings:mySettings];
    

    【讨论】:

    • 虽然这可能是答案,但您应该提供更具体的信息/说明/代码来解决用户问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-18
    • 1970-01-01
    相关资源
    最近更新 更多