Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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() {
// console.log('setting idle timer disabled to true, notifications.ios.js line 49');
IdleTimerManager.setIdleTimerDisabled(true);
} else {
// console.log('timer is on');
// console.log('screen will dim');
// console.log('setting idle timer disabled to false, notifications.ios.js line 43');
IdleTimerManager.setIdleTimerDisabled(false);
}
this.dispatch(updateSilentSwitchState(silent));
}
});
// Push Notifications Configure
OneSignal.addEventListener('ids', this.onIds.bind(this));
OneSignal.addEventListener('received', this.onPushNotificationReceived.bind(this));
OneSignal.configure();
// Local Notifications Configure
NotificationsIOS.addEventListener('notificationReceivedForeground', this.onNotificationReceivedForeground.bind(this));
NotificationsIOS.addEventListener('notificationReceivedBackground', this.onNotificationReceivedBackground.bind(this));
NotificationsIOS.addEventListener('notificationOpened', this.onNotificationOpened.bind(this));
this.snoozeAction = new NotificationAction({
activationMode: 'background',
title: 'Snooze',
identifier: 'SNOOZE_ACTION',
}, (action, completed) => {
this.dispatch(snoozeAlarm(action.notification.getData().alarmUUID));
completed();
});
this.stopAction = new NotificationAction({
constructor(props) {
super(props);
this.deviceID = ''
OneSignal.init("df4cae47-cd9d-4dd5-b97f-5f63593f39fb")
OneSignal.inFocusDisplaying(2)
OneSignal.addEventListener('received', this.onReceived);
OneSignal.addEventListener('opened', this.onOpened);
OneSignal.addEventListener('ids', device => {
this.deviceID = device.userId
});
OneSignal.configure();
this.state = {
checked: false,
count: 0,
isLoading: false,
data: [
{
id: '1',
seller: 'grosir.outdoor.shop',
description: '1 KG 1 Roll Wallpaper 10 meter X 45 cm wallpaper dinding Motif hellokitty doraemon dll',
image: 'https://cf.shopee.co.id/file/webp/6e060dc67897556a6065a1e93750521d_tn',
price: 'Rp 25.000'
},
{
id: '2',
seller: 'Shopeefy',
componentWillMount() {
OneSignal.init('22fcdd38-fb1c-43ce-8619-947d613c84d4', {
kOSSettingsKeyAutoPrompt: true,
});
OneSignal.configure();
OneSignal.addEventListener('ids', this.onIds);
this.subscription = this.props.client
.watchQuery({ query: commonQueries.userInformation })
.subscribe(({ data: updatedResult }) => {
this.setState({ cartLength: updatedResult.me.cart.length });
});
}
constructor(props) {
super(props);
OneSignal.init("df4cae47-cd9d-4dd5-b97f-5f63593f39fb");
OneSignal.addEventListener('received', this.onReceived);
OneSignal.addEventListener('opened', this.onOpened);
OneSignal.addEventListener('ids', this.onIds);
OneSignal.configure();
}
componentWillUnmount() {
componentDidMount() {
console.log("-------xxxx------ App - componentDidMount ------xxxx-------")
OneSignal.inFocusDisplaying(0)
OneSignal.configure({
onNotificationReceived: function(notification) {
//console.log('NOTIFICATION RECEIVED: ', notification)
if (notification.payload.additionalData.new_message && appStore.current_puid != notification.payload.additionalData.puid) {
console.log(" appStore.new_messages + 1 : " + appStore.current_puid)
appStore.new_messages = appStore.new_messages + 1
}
},
onNotificationOpened: function(openResult) {
console.log(openResult);
console.log('MESSAGE: ', openResult.notification.payload.body)
console.log('CURRENT PUID:' + appStore.current_pui)
console.log('ISACTIVE: ', openResult.notification.isAppInFocus)
console.log('DATA: ', openResult.notification.payload.additionalData)
if (!openResult.notification.isAppInFocus) {
if (openResult.notification.payload.additionalData) {
if (appStore.current_puid != openResult.notification.payload.additionalData.puid) {