我在创建用户到firebase之后需要token-id但是代码不能正常工作
//here i am registering to firebase
onRegisterTap() {
console.log("firebase1");
firebase.createUser({
email: this.userRegister.email,
password: this.userRegister.password
}).then(
(result) => {
// this callback function is not trigering..help me please and i am not gettting token id
firebase.addOnPushTokenReceivedCallback((token) => {
console.log("Firebase push token: " + token);
this.firebaseToken = token;
console.log("firebase", JSON.stringify(this.firebaseToken));
}
);
sending verification mail
firebase.sendEmailVerification().then(
function () {
console.log("Email verification sent");
},
function (error) {
console.log("Error sending email verification: " + error);
}
);
console.log("firebase", result.key);
},
(errorMessage) => {
this.globals.setIsLoading(false);
alert({
title: "Registartion Failed",
message: errorMessage,
okButtonText: "OK"
})
}
);
}
//why firebase.addOnPushTokenReceivedCallback method is not triggering?