HMS-Core / hms-react-native-plugin

This repo contains all of React-Native HMS plugins.
https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1
Apache License 2.0
240 stars 68 forks source link

Error when trying to subscribe topics #163

Closed nolife08021 closed 2 years ago

nolife08021 commented 2 years ago

Description Error 907122047 push server error.

Expected behavior subscribe successful

Current behavior Error when try to subscribe topic

Screenshots IMG-3578

Environment

Code

let HMSPush = require('@hmscore/react-native-hms-push');
let HMSAvail = require('@hmscore/react-native-hms-availability');

        HMSAvail.default.isHuaweiMobileServicesAvailable()
            .then((res) => {

              if(res === 0) {
                HMSPush.HmsPushMessaging.subscribe(topic)
                    .then((result) => {
                      console.log("subscribe", result);
                    })
                    .catch((err) => {
                      alert("[subscribe] Error/Exception: " + JSON.stringify(err));
                    });
              }
            })
            .catch((err) => console.log(err));