Giter Club home page Giter Club logo

Comments (14)

lanceli avatar lanceli commented on May 18, 2024

恩 看jpush后台你设备没注册上 你退出下 再登陆

from cnodejs-ionic.

alsotang avatar alsotang commented on May 18, 2024

重新登录果然就好了。像我这种已经登录的老用户,有什么办法可以让极光自动注册我的设备吗?

from cnodejs-ionic.

alsotang avatar alsotang commented on May 18, 2024

我这里报错长这样:

cnode-0 (out): Push URL :https://api.jpush.cn/v3/push
cnode-0 (out): Body :{"options":{"sendno":2439555405,"apns_production":true},"notification":{"android":{"alert":"alsotang 回复了你的主题","extras":{"topicId":"54d5d35731288f104a80fe58"}},"ios":{"alert":"alsotang 回复了你的主题","sound":"","badge":2,"extras":{"topicId":"54d5d35731288f104a80fe58"}},"alert":"alsotang 回复了你的主题"},"audience":{"alias":["54009f5ccd66f2eb37190485"]},"platform":"all"}
cnode-0 (out): Headers :{"User-Agent":"JPush-API-NodeJS-Client","Connection":"Keep-Alive","Charset":"UTF-8","Content-Type":"application/json"}
cnode-0 (out): Method :POST
cnode-0 (out): Times/MaxTryTimes : 1/3
cnode-0 (out): Push Fail, HttpStatusCode: 400 result: {"msg_id": 730914997, "error": {"message": "cannot find user by this audience", "code": 1011}}
cnode-0 (out): Push URL :https://api.jpush.cn/v3/push
cnode-0 (out): Body :{"options":{"sendno":2320566186,"apns_production":true},"notification":{"android":{"alert":"alsotang 回复了你的主题","extras":{"topicId":"54d5c9dbeef4ca19212633ad"}},"ios":{"alert":"alsotang 回复了你的主题","sound":"","badge":3,"extras":{"topicId":"54d5c9dbeef4ca19212633ad"}},"alert":"alsotang 回复了你的主题"},"audience":{"alias":["54009f5ccd66f2eb37190485"]},"platform":"all"}
cnode-0 (out): Headers :{"User-Agent":"JPush-API-NodeJS-Client","Connection":"Keep-Alive","Charset":"UTF-8","Content-Type":"application/json"}
cnode-0 (out): Method :POST
cnode-0 (out): Times/MaxTryTimes : 1/3
cnode-0 (out): Push Fail, HttpStatusCode: 400 result: {"msg_id": 399888137, "error": {"message": "cannot find user by this audience", "code": 1011}}
cnode-0 (out): Push URL :https://api.jpush.cn/v3/push
cnode-0 (out): Body :{"options":{"sendno":848321656,"apns_production":true},"notification":{"android":{"alert":"alsotang 回复了你的主题","extras":{"topicId":"54d5c9dbeef4ca19212633ad"}},"ios":{"alert":"alsotang 回复了你的主题","sound":"","badge":4,"extras":{"topicId":"54d5c9dbeef4ca19212633ad"}},"alert":"alsotang 回复了你的主题"},"audience":{"alias":["54009f5ccd66f2eb37190485"]},"platform":"all"}
cnode-0 (out): Headers :{"User-Agent":"JPush-API-NodeJS-Client","Connection":"Keep-Alive","Charset":"UTF-8","Content-Type":"application/json"}
cnode-0 (out): Method :POST
cnode-0 (out): Times/MaxTryTimes : 1/3
cnode-0 (out): Push Fail, HttpStatusCode: 400 result: {"msg_id": 1670938158, "error": {"message": "cannot find user by this audience", "code": 1011}}

打印的日志中。

关键信息应该是这个:

Push Fail, HttpStatusCode: 400 result: {"msg_id": 1670938158, "error": {"message": "cannot find user by this audience", "code": 1011}}

from cnodejs-ionic.

lanceli avatar lanceli commented on May 18, 2024

有的 其实1.2.1我对老用户有自动注册,但漏掉了注册失败的情况。(jpush官方插件太烂 ,成功失败的callback都没有)
我现在改成每次启动都自动注册一遍

另外,现在jpush后台可以做到:

  • 全平台统一推送(刚测试了下21个iOS注册设备,以后可以发通知,比如活动之类的)
  • 指定user._id推送
  • 推送的信息带上topic id,打开通知后自动打开相应的topic

from cnodejs-ionic.

alsotang avatar alsotang commented on May 18, 2024

还有个疑问,如果用户只用 cnode 的网页版,但是不装 app 的话。是不是说,我这里就会收到很多类似的
"message": "cannot find user by this audience" 报错?

from cnodejs-ionic.

lanceli avatar lanceli commented on May 18, 2024

报错是所有的回复和@都会根据user._id请求jpush
如果这个user注册过jpush就会收到通知,没注册过就会返回上面的错误。
也就是cnode并不知道这个用户是否是注册过jpush的app用户。

from cnodejs-ionic.

lanceli avatar lanceli commented on May 18, 2024

这个之前考虑过,可以记录哪些用户是注册过jpush的app用户。但是我觉得无所谓,cnode无需管理哪些用户时有效的push用户哪些不是。

from cnodejs-ionic.

alsotang avatar alsotang commented on May 18, 2024
lib/JPush/JPush.js
107:            console.log("Push Fail, HttpStatusCode: " + res.statusCode + " result: " + body.toString());

lib/JPush/JPushError.js
19:    var message = "Push Fail, HttpStatusCode: " + httpCode + " result: " + response.toString();

果然是 jpush 自己打印出来的,服了

from cnodejs-ionic.

alsotang avatar alsotang commented on May 18, 2024

卧槽,jpush 里面一大堆的 console.log 无法关掉。。。服了。。不管了

from cnodejs-ionic.

alsotang avatar alsotang commented on May 18, 2024

呃。。。好吧。我怀疑这个错误不是我们 cnode 打印出来的,而是 jpush 里面打印出来的。那就让它打好了。

在 2015年2月7日,17:52,Lance Li <[email protected] mailto:[email protected]> 写道:

报错是所有的回复和@都会根据user._id请求jpush
如果这个user注册过jpush就会收到通知,没注册过就会返回上面的错误。
也就是cnode并不知道这个用户是否是注册过jpush的app用户。


Reply to this email directly or view it on GitHub #10 (comment).

from cnodejs-ionic.

lanceli avatar lanceli commented on May 18, 2024

哈哈 话说国内第三方推送服务还就jpush有phonegap插件 百度腾讯的都没有

from cnodejs-ionic.

lanceli avatar lanceli commented on May 18, 2024

jpush这个我自己还改了不少

from cnodejs-ionic.

alsotang avatar alsotang commented on May 18, 2024

你还改了?有合并到他们的 master 吗

在 2015年2月7日,18:07,Lance Li <[email protected] mailto:[email protected]> 写道:

jpush这个我自己还改了不少


Reply to this email directly or view it on GitHub #10 (comment).

from cnodejs-ionic.

lanceli avatar lanceli commented on May 18, 2024

改的是phonegap插件 还没提交pr

from cnodejs-ionic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.