I am devolping a website using ionic framework.This is my code:
$rootScope.$on('$cordovaPush:tokenReceived', function(event, data) {
storageService.save("deviceToken", data.token);
});
var devicetoken =JSON.parse(storageService.get("deviceToken"));
HomeOwners.Create(devicetoken).then(function(response) {
console.log(response.user_id);
})
alert(devicetoken);
But this alert null.When I refresh page the i t alret me device token value.
Please Help
storageServicecode?