Ios GCM APN消息不是';t交付
我正在尝试使用GCM向设备发送消息。我将此JSON发送到客户端:Ios GCM APN消息不是';t交付,ios,swift,google-cloud-messaging,Ios,Swift,Google Cloud Messaging,我正在尝试使用GCM向设备发送消息。我将此JSON发送到客户端: { "to": "nzgmI.....smZq9tE_L6k4C6T", "data": { "message": "vale normal de menfdasfdsajes", } } 我可以在控制台上看到它,但是如果我想要一个标准的ios推送通知来获得一个对话框,我没有收到任何东西 { "to": "nzgmIZ764.....tE_L6k4C6T", "notification" : {
{
"to": "nzgmI.....smZq9tE_L6k4C6T",
"data": {
"message": "vale normal de menfdasfdsajes",
}
}
我可以在控制台上看到它,但是如果我想要一个标准的ios推送通知来获得一个对话框,我没有收到任何东西
{
"to": "nzgmIZ764.....tE_L6k4C6T",
"notification" : {
"body" : "I can't see this",
"title" : "Portugal vs. Denmark",
"icon" : "myicon"
}
}
我有一张打印在:
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
但只有使用第一个选项,我才能在控制台中看到一些东西,我希望实现常规推送通知,而不仅仅是消息。您可能需要在消息中添加
优先级
字段,即
{
"to": "nzgmIZ764.....tE_L6k4C6T",
"priority" : "high", // Add this
"notification" : {
"body" : "I can't see this",
"title" : "Portugal vs. Denmark",
"icon" : "myicon"
}
}
如果您收到来自GCM的
成功
响应,您应该会看到一个正常的通知被发送到您的应用程序。您可能需要将优先级
字段添加到您的消息中,即
{
"to": "nzgmIZ764.....tE_L6k4C6T",
"priority" : "high", // Add this
"notification" : {
"body" : "I can't see this",
"title" : "Portugal vs. Denmark",
"icon" : "myicon"
}
}
如果您从GCM收到成功的
响应,您应该会看到一个正常的通知发送到您的应用程序