I recently got a project from another team and I'm working on fixing the integration of your service in an ionic framework application, using the urbanairship-cordova plugin, for my company.
I did some troubleshooting and saw on our back-end that no user got an "urban_airship_channel_id" and an "urban_airship_platform".
I stopped the troubleshooting at this function in our client side application:
document.addEventListener('urbanairship.registration', (function(event) {
var user;
if (event.error) {
$rootScope.$broadcast('notification:register:error', event.error);
} else {
user = {
urban_airship_channel_id: event.channelID,
urban_airship_platform: $cordovaDevice.getDevice().platform.toLowerCase()
};
console.log(user);
DeviceAPI.update({
user: user,
locale: localization.getLocale()
}, function(success) {
return $rootScope.$broadcast('notification:register:success', event.deviceToken);
}, function(failure) {
return console.log(failure);
});
}
}), false);
The parent function of this listener is executed, but this event is never triggered and the user doesn't get the values.
I don't receive any kind of exception.
Can you please help me understand how the urbanairship.registration event is suppose to be triggered?
Comments
1 comment