I successfully integrated pushwoosh into my app using the pushwoosh plugin and it is functioning flawlessly. However, I also have a mySQL server and I need to store the token after registering my device with pushwoosh. My goal is to save the token received from pushwoosh in local sqlite first. To achieve this, I am utilizing the built-in method provided by pushwoosh.
pushwoosh.getPushToken(
function(token) {
console.warn('push token: ' + token);
}
);
I need to extract this token from the mentioned JavaScript function above. Can anyone with expertise in JavaScript provide me with advice or suggest an alternative solution?
I have attempted the following code without success.
var _token;
pushwoosh.getPushToken(
function(token) {
_token = token;
console.warn('push token: ' + token);
}
);
console.log("Token: "+_token);
//output: Token: undefined