belos is my code Next step how to send Push notification to specific mobile device.
INFO (i AM REFEREING) this site (native) : https://ionicframework.com/docs/native/firebase/
/* Get Firebase token /
this.firebase.getToken()
.then(token => {
this.token_id = token;
this.ls.setToken(token);
})
.catch(error => console.error(‘Error getting token’, error));
this.firebase.onTokenRefresh()
.subscribe((token: string) => console.log(Got a new token ${token}
));
/ get localstorage user id /
this.ls.getUserid().then((user_id)=> {
/ Check User is login or not /
this.data.Islogin(user_id).subscribe(
data => {
this.results = data;
if(this.results[‘response’]==“yes”) {
/ check token */
this.data.fireToken(user_id,this.token_id).subscribe(
data => {
},
err => {
console.log(err);
},
() => console.log(‘Firebase call’));
this.rootPage = Mycontact;
}
if (this.results[‘response’]==‘no’) {
this.rootPage = Login;
}
},
err => {
console.log(err);
},
() => console.log(‘Login Form Complete’));
});
}