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 call init with id and oprtions for IOS", () => {
var IOSSettings = {};
OneSignal.init("id");
OneSignal.init("id", IOSSettings);
// $ExpectError
OneSignal.init();
});
it("must call init with id and oprtions for IOS", () => {
var IOSSettings = {};
OneSignal.init("id");
OneSignal.init("id", IOSSettings);
// $ExpectError
OneSignal.init();
});
it("must call init with id and oprtions for IOS", () => {
var IOSSettings = {};
OneSignal.init("id");
OneSignal.init("id", IOSSettings);
// $ExpectError
OneSignal.init();
});
it('must call init with id and oprtions for IOS', () => {
var IOSSettings = {};
OneSignal.init('id');
OneSignal.init('id', IOSSettings);
// $ExpectError
OneSignal.init();
});
constructor() {
super();
i18n.locale = "tr"; // manually set language
EStyleSheet.build({
...colors,
...fonts
});
OneSignal.init("98036549-9d8f-40fd-abdf-05fc18d89f2c");
OneSignal.addEventListener("received", this.onReceived);
OneSignal.addEventListener("opened", this.onOpened);
OneSignal.addEventListener("ids", this.onIds);
OneSignal.configure(); // triggers the ids event
}
componentWillUnmount() {
export async function identify() {
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);
}
}
initPushNotifications(){
console.log('setting up PushNotifications OneSignal SDK');
OneSignal.init(config.ONE_SIGNAL_APP_ID,{kOSSettingsKeyAutoPrompt : true});
OneSignal.inFocusDisplaying(0);
OneSignal.setLocationShared(false);
OneSignal.setExternalUserId(AnalyticsService.uniqueClientId);
}
bindNotificationListeners(){
async componentDidMount() {
OneSignal.init(ONESIGNAL_SECRET, {
kOSSettingsKeyAutoPrompt: false,
kOSSettingsKeyInFocusDisplayOption: 0,
});
await this.refresh();
}
componentDidMount() {
OneSignal.init(ONESIGNAL_SECRET, {
kOSSettingsKeyAutoPrompt: false,
kOSSettingsKeyInFocusDisplayOption: 0,
});
}
constructor(props) {
super(props);
OneSignal.init(global.oneSignalAppId, {kOSSettingsKeyAutoPrompt: false});
this.state = {
uri: site,
promptToConnect: false,
skipLogin: false,
appLoading: true,
username: '',
password: '',
authError: '',
keyboardVisible: false,
landscapeLayout: false,
appState: AppState.currentState,
pushAuth: false,
};
this._Manager = new Manager();