sorry my english!
Is there a way to get the value of the storage saved object? What I mean is when I output it in the console it shows [object Promise]
but when I output in an alert it shows the string value. Is there a way to save that string value in the storage?
This is my code:
initializeApp() {
this.platform.ready().then(() => {
this.statusBar.styleDefault();
this.splashScreen.hide();
FCMPlugin.getToken(
(token) => {
this.saveToken(token);
},
(err) => {
console.log(err);
}
);
this.onNotification();
});
}
saveToken(token: string) {
this.storage.set('token', token);
}
This is the plugin code which returns the token
// GET TOKEN //
else if (action.equals("getToken")) {
cordova.getActivity().runOnUiThread(new Runnable() {
public void run() {
try {
String token = FirebaseInstanceId.getInstance().getToken();
callbackContext.success(FirebaseInstanceId.getInstance().getToken());
Log.d(TAG, "\tToken: " + token);
} catch (Exception e) {
Log.d(TAG, "\tError retrieving token");
}
}
});