Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("must throw error when args aren't enough", () => {
// $ExpectError
OneSignal.sendTag();
// $ExpectError
OneSignal.sendTag('maybe tag');
});
it("must throw error when args aren't enough", () => {
// $ExpectError
OneSignal.sendTag();
// $ExpectError
OneSignal.sendTag("maybe tag");
});
try {
let userID = await idstore.getUserID();
if (!userID) {
userID = "user-" + uuidv4();
}
await idstore.storeUserID(userID);
// Identify in RevenueCat
Payments.alias(userID);
// Identify in OneSignal
OneSignal.init(ONESIGNAL_SECRET, {
kOSSettingsKeyAutoPrompt: false,
kOSSettingsKeyInFocusDisplayOption: 0,
});
OneSignal.sendTag("userID", userID);
// Identify in Segment
stats.identify(userID);
} catch (err) {
// Just capture the exception and continue, don't :rip:
Sentry.captureException(err);
}
}
it("must call sendTag with key,value arguments", () => {
OneSignal.sendTag("key", "value");
});
it('must call sendTag with key,value arguments', () => {
OneSignal.sendTag('key', 'value');
});
.then((user) => {
firebaseApp.database().ref('users').child(user.uid).once('value')
.then((snapshot) => {
this.props.appStore.post_count = parseInt(snapshot.val().post_count)
this.props.appStore.order_count = parseInt(snapshot.val().order_count)
this.props.appStore.chat_count = parseInt(snapshot.val().chat_count)
})
this.props.appStore.user = user
this.props.appStore.username = user.displayName
console.log("user displayName: " + user.displayName + " - " + user.uid)
OneSignal.sendTag("username", user.displayName)
OneSignal.sendTag("uid", user.uid)
Actions.home({ type: 'replace' })
})
.catch((error) => {
firebaseApp.database().ref('users/' + user.uid)
.set({
uid,
username,
post_count,
chat_count,
order_count,
email,
})
this.props.appStore.username = user.displayName
this.props.appStore.post_count = post_count
this.props.appStore.order_count = order_count
this.props.appStore.chat_count = chat_count
this.props.appStore.user = user
OneSignal.sendTag("username", user.displayName)
OneSignal.sendTag("uid", user.uid)
Actions.home({ type: 'replace' })
}, function(error) {
console.log(error);
export function subscribe(
channelName: NotificationChannelName,
): ChannelSubscribeAction {
OneSignal.sendTag(channelName, 'active')
return {type: CHANNEL_SUBSCRIBE, payload: channelName}
}
.then(() => {
this.props.appStore.username = this.props.appStore.user.displayName
OneSignal.sendTag("username", this.props.appStore.user.displayName)
this.setState({ errMsg: "Name succesfully saved!" })
})
.catch((error) => {