JPush 环境一致,setAlias 返回 0,收不到推送

longdawei1988
2016-07-30 00:30 1.9k 0

情况是这样的。目前是IOS端。我集成了JMessage和JPush,按照文档说明,我只加了JMessage.framework这个框架,然后使用的是代码来设置appkey,我的开发和发布证书都是正常的,客户端setAlias也返回的0,初始化代码也用的JMessage那一套。

    - (void)initJPush:(NSDictionary *)launchOptions
    {
        [JMessage addDelegate:self withConversation:nil];
        [JMessage setupJMessage:launchOptions
                         appKey:JMESSAGE_APPKEY
                        channel:CHANNEL apsForProduction:NO
                       category:nil];

        [JPUSHService registerForRemoteNotificationTypes:(UIUserNotificationTypeBadge |
                                                          UIUserNotificationTypeSound |
                                                          UIUserNotificationTypeAlert)
                                              categories:nil];

        [self registerJPushStatusNotification];
    }

现在的问题是接收不到消息

{
  "platform":"all",
  "audience":{"alias" : [ "5e41111aa06b4ce7a8f59b29d921b8d1" ]},
  "notification":{

  "android":{
      "title":"管理员",
    "builder_id":1,
    "extras":{
        "date":"2015-12-31T08:57:45.5670651+08:00",
        "attach":0,
        "type":"message",
        "id":"1",
        "title":"管理员"
     },
    "alert":"测试消息推送"
  },

   "ios":{
        "sound":"default",
        "extras":{
            "date":"2015-12-31T08:57:45.5670651+08:00",
            "attach":0,
            "type":"message",
            "id":"1",
            "title":"管理员"
         },
         "alert":"测试消息推送"
    }
  },
    "options":{
        "time_to_live": 60,
        "apns_production": false
    }
}

2个回答

热门排序
  • 这里查到
    以及错误:paltform type invalid推送环境与用户环境不对应
    你的app是开发环境打包吗?

  • 你的情况是:显示推送成功,但是手机接收不到消息吗?你推送的是开发环境,有没有注意环境方面的统一? SDK 的启动代码、Xcode 中的证书、上传的证书、推送时的环境选择,都要统一Jush IOS SDK注意事项的7、8、9点http://c 展示全部