Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
incomingVC(groupID, rUID, rUName) {
console.log('Kumar push VCUTIL invc ', groupID, rUID, rUName);
this._gid = groupID;
this._remoteuid = rUID;
this._remoteName = rUName;
PushNotification.cancelAllLocalNotifications();
PushNotification.localNotificationSchedule({
message: `Video Calling ${this._remoteName}`, // (required)
playSound: false,
autoCancel: false,
vcData: {
groupID,
rUID,
},
date: new Date(Date.now()), // in 60 secs
// actions: '["Accept", "Reject"]',
});
// InCallManager.startRingtone('_BUNDLE_');
// InCallManager.turnScreenOn();
// if (!this._net) {
// this._net = new Network();
incomingVCDisconnect() {
PushNotification.cancelAllLocalNotifications();
// InCallManager.stopRingtone();
}
function* handlePush(state: Container.TypedState, action: PushGen.NotificationPayload) {
try {
const notification = action.payload.notification
logger.info('[Push]: ' + notification.type || 'unknown')
switch (notification.type) {
case 'chat.readmessage':
logger.info('[Push] read message')
if (notification.badges === 0) {
PushNotifications.cancelAllLocalNotifications()
}
break
case 'chat.newmessageSilent_2':
// entirely handled by go on ios and in onNotification on Android
break
case 'chat.newmessage':
yield* handleLoudMessage(notification)
break
case 'follow':
// We only care if the user clicked while in session
if (notification.userInteraction) {
const {username} = notification
logger.info('[Push] follower: ', username)
yield Saga.put(ProfileGen.createShowUserProfile({username}))
}
break
function* handlePush(_, action) {
try {
const notification = action.payload.notification
logger.info('[Push]: ' + notification.type || 'unknown')
switch (notification.type) {
case 'chat.readmessage':
logger.info('[Push] read message')
if (notification.badges === 0) {
PushNotifications.cancelAllLocalNotifications()
}
break
case 'chat.newmessageSilent_2':
// entirely handled by go on ios and in onNotification on Android
break
case 'chat.newmessage':
yield* handleLoudMessage(notification)
break
case 'follow':
// We only care if the user clicked while in session
if (notification.userInteraction) {
const {username} = notification
logger.info('[Push] follower: ', username)
yield Saga.put(ProfileGen.createShowUserProfile({username}))
}
break
notification.finish("UIBackgroundFetchResultNoData");
},
onRegister: (token) => {},
senderID: 'XXX',
popInitialNotification: false,
requestPermissions: true,
});
PushNotification.unregister();
PushNotification.localNotification = (details) => {};
PushNotification.localNotificationSchedule = (details) => {};
PushNotification.requestPermissions();
PushNotification.presentLocalNotification = (details) => {};
PushNotification.scheduleLocalNotification = (details) => {};
PushNotification.cancelLocalNotifications = (details) => {};
PushNotification.cancelAllLocalNotifications();
PushNotification.setApplicationIconBadgeNumber(1);
PushNotification.getApplicationIconBadgeNumber((badgeCount) => {});
PushNotification.popInitialNotification((notification) => {});
PushNotification.checkPermissions((checkPermissions) => {});
PushNotification.abandonPermissions();
PushNotification.registerNotificationActions(['Accept', 'Reject', 'Yes', 'No']);
PushNotification.clearAllNotifications();
android: data => {
if (this.notifications.enabled) {
PushNotification.cancelAllLocalNotifications();
PushNotification.localNotificationSchedule({
date: new Date(data.isostart),
message: `🚀 ${data.name} will launch in just ${
this.notifications.delay
} minutes!`
});
}
}
});
sharedNotificationActions(count => {
RNPN.setApplicationIconBadgeNumber(count)
if (count === 0) {
RNPN.cancelAllLocalNotifications()
}
})
}
cancelAll() {
PushNotification.cancelAllLocalNotifications();
}
}
const cancelAllNotifications = () => PushNotification.cancelAllLocalNotifications()
function clearAllNotifications() {
PushNotifications.cancelAllLocalNotifications()
}