如何向报亭应用发送标准推送通知?当我说“标准”时,我指的是弹出消息的典型警报框。
我正在使用Urban Airship,让“内容可用”的推动工作正常:
{"aps":
{
"content-available": 1
},
"device_tokens": ["1234ABCDKKGGOGOGG85986598750870870875708ASD"]
}
但是当我尝试发送标准推送时,警报永远不会弹出,我的代表
application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
未被调用:
{"aps":
{
"alert": "Hi, from Urban Airship!"
},
"device_tokens": ["1234ABCDKKGGOGOGG85986598750870870875708ASD"]
}
答案 0 :(得分:2)
忘记注册警告(标准)推送,通过添加常量 UIRemoteNotificationTypeAlert
来设置[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeAlert];