Skip to content

给reg id发送成功但是无法收到消息 #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jiajunhuang opened this issue Dec 11, 2019 · 0 comments
Open

给reg id发送成功但是无法收到消息 #50

jiajunhuang opened this issue Dec 11, 2019 · 0 comments

Comments

@jiajunhuang
Copy link

日志:

DEBUG:jpush:Making POST request to https://api.jpush.cn/v3/push. Headers:
        user-agent: jpush-api-python-client
        connection: keep-alive
        content-type: application/json;charset:utf-8
Body:
        {"audience": {"registration_id": ["abcdabcd"]}, "platform": "all", "message": {"msg_content": "by_reg_id", "title": "helloworld"}}
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.jpush.cn:443
DEBUG:urllib3.connectionpool:https://api.jpush.cn:443 "POST /v3/push HTTP/1.1" 200 43
DEBUG:jpush:Received 200 response. Headers:
        Server: nginx
        Date: Wed, 11 Dec 2019 14:04:53 GMT
        Content-Type: application/json
        Content-Length: 43
        Connection: keep-alive
        X-Rate-Limit-Limit: 600
        X-Rate-Limit-Remaining: 599
        X-Rate-Limit-Reset: 60
        X-Jpush-Timestamp: 1576073093486
Body:
        b'{"sendno":"0","msg_id":"47287830529285706"}'

但是用web界面根据reg id发送却能收到。

代码:

def __push_notify_by_reg_id(message, reg_id):
    try:
        push = jp.create_push()
        push.audience = jpush.audience(jpush.registration_id(reg_id))
        push.message = jpush.message(message.brief, message.title)
        push.platform = jpush.all_

        push.send()
    except Exception:
        logging.exception("failed to push message(%d)", message.id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant