使用pyfcm进行通知的Firebase消息传递

时间:2018-11-17 07:38:07

标签: python django pyfcm

    print(dietitian.dtoken)    # recieving registration id here.
    push_service = FCMNotification(api_key="API-KEY")
    # registration_id = (dietitian.dtoken)
    registration_id = json.dumps(dietitian.dtoken)    
    message_title = "xyz"
    message_body = "Hi "
    result = push_service.notify_single_device(registration_id=registration_id, message_title=message_title,
                                               message_body=message_body)
    print(result)

为此,我正在获得InvalidRegistration

{'multicast_ids': [6833421978764843449], 'success': 0, 'failure': 1, 'canonical_ids': 0, 'results': [{'error': 'InvalidRegistration'}], 'topic_message_id': None}

我想知道我是否正确发送了RegistrationId。 我正在从用户的Firebase中保存idToken,是registrationid还是其他?

0 个答案:

没有答案