Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initalizePushNotifications() {
UrbanAirship.setUserNotificationsEnabled(true)
UrbanAirship.addListener("register", (event) => {
console.log('Channel registration updated: ', event.channelId);
console.log('Registration token: ', event.registrationToken);
});
UrbanAirship.addListener("pushReceived", (notification) => {
console.log('Received push: ', JSON.stringify(notification));
});
UrbanAirship.setForegroundPresentationOptions({
alert: true,
sound: true,
badge: true
});
}
const { type, user } = actions
if(type === 'NewPendingCredit') {
const { route, pendingTransaction, pendingSettlement } = this.props.getPendingFromFriend(user)
if(pendingTransaction !== undefined || pendingSettlement !== undefined) {
navigation.navigate(route, { pendingTransaction, pendingSettlement })
}
} else if(type === 'RequestPayPal') {
const friend = this.props.getFriendFromNick(user)
navigation.navigate('Settlement', { friend, settlementType: 'paypal' })
} else {
navigation.navigate('Activity')
}
} catch(e) {}
})
UrbanAirship.setForegroundPresentationOptions({
alert: true,
sound: true,
badge: true
})
}