Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
// for once, and listener will invoke afterwards.
OneSignal.requestPermissions({ alert: true, sound: true, badge: true });
// Setup notification intervals
this.fetchNotifications();
this.notificationInterval = setInterval(this.fetchNotifications, NOTIFICATION_FETCH_INTERVAL);
}
it('must call requestPermissions with Permissions', () => {
OneSignal.requestPermissions({
alert: true,
badge: true,
sound: true,
});
OneSignal.requestPermissions({
alert: false,
badge: false,
});
OneSignal.requestPermissions({
alert: false,
});
OneSignal.requestPermissions();
});
it("must call requestPermissions with Permissions", () => {
OneSignal.requestPermissions({
alert: true,
badge: true,
sound: true
});
OneSignal.requestPermissions({
alert: false,
badge: false
});
OneSignal.requestPermissions({
alert: false
});
OneSignal.requestPermissions();
});
componentDidMount() {
OneSignal.requestPermissions({ alert: true, sound: true, badge: true });
store.dispatch(fetchAlgoliaKeys());
}
handleActionBtnPress = () => {
if (Platform.OS === 'ios') {
OneSignal.requestPermissions({ alert: true, sound: true, badge: true });
}
};