Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async initializePushNotifications() {
const { navigation } = this.props
UrbanAirship.getChannelId().then(channelId => {
if (channelId) {
this.props.registerChannelID(channelId, Platform.OS)
}
})
const { notificationsEnabled } = this.props.state
UrbanAirship.setUserNotificationsEnabled(notificationsEnabled)
UrbanAirship.addListener("pushReceived", async(notification) => {
const actions = JSON.parse(notification.extras['com.urbanairship.actions'])
const { type } = actions
if(type === 'NewPendingCredit') {
loadingPending.wrap(this.props.getPending())
} else if(type === 'NewFriendRequest') {
loadingFriends.wrap(this.props.getFriends())
componentDidMount() {
UrbanAirship.getChannelId().then((channelId) => {
this.setState({channelId:channelId})
});
}
componentDidMount() {
UrbanAirship.getChannelId().then((channelId) => {
this.setState({channelId:channelId})
});
}