decord/source/lib/pushnotification/PushNotification.tsx

298 lines
9 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 10632
// Function ID: 82837
2026-07-20 16:05:17 +00:00
// Name: createNotification
2026-07-27 11:26:19 +00:00
// Dependencies: [27, 477, 10633, 10290, 10634, 2]
2026-07-23 10:11:24 +00:00
2026-07-27 11:26:19 +00:00
// Module 10632 (createNotification)
2026-07-23 10:11:24 +00:00
import get_ActivityIndicator from "get ActivityIndicator";
2026-07-20 16:05:17 +00:00
function createNotification(arg0) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
2026-07-20 16:05:17 +00:00
let tmp = null;
if (null != arg0) {
2026-07-23 10:11:24 +00:00
let obj = {
2026-07-20 16:05:17 +00:00
getData() {
const obj = {};
2026-07-23 10:11:24 +00:00
const merged = Object.assign(closure_0);
2026-07-20 16:05:17 +00:00
let parsed = null;
2026-07-23 10:11:24 +00:00
if (null != closure_0.message) {
2026-07-20 16:05:17 +00:00
const _JSON = JSON;
2026-07-23 10:11:24 +00:00
parsed = JSON.parse(closure_0.message);
2026-07-20 16:05:17 +00:00
}
obj["message"] = parsed;
return obj;
},
getMessage() {
const error = new Error("TODO: Implement on Android");
throw error;
},
getSound() {
const error = new Error("TODO: Implement on Android");
throw error;
},
getCategory() {
const error = new Error("TODO: Implement on Android");
throw error;
},
getAlert() {
const error = new Error("TODO: Implement on Android");
throw error;
},
getContentAvailable() {
const error = new Error("TODO: Implement on Android");
throw error;
},
getBadgeCount() {
const error = new Error("TODO: Implement on Android");
throw error;
},
finish(arg0) {
const error = new Error("Not implemented on Android: " + arg0);
throw error;
}
};
tmp = obj;
}
return tmp;
}
2026-07-23 10:11:24 +00:00
const NativeModules = get_ActivityIndicator.NativeModules;
const NativeEventEmitter = get_ActivityIndicator.NativeEventEmitter;
2026-07-20 16:05:17 +00:00
const PushNotificationAndroid = NativeModules.PushNotificationAndroid;
let nativeEventEmitter = null;
if (null != PushNotificationAndroid) {
2026-07-23 10:11:24 +00:00
let prototype = NativeEventEmitter.prototype;
2026-07-20 16:05:17 +00:00
nativeEventEmitter = new NativeEventEmitter(NativeModules.PushNotificationAndroid);
}
2026-07-23 10:11:24 +00:00
let result = require("RNCPushNotificationIOS").fileFinishedImporting("lib/pushnotification/PushNotification.tsx");
2026-07-20 16:05:17 +00:00
export default {
getInitialNotification() {
if (obj.isAndroid()) {
let initialNotification = new Promise((arg0) => {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
const initialNotification = outer1_4.getInitialNotification();
2026-07-20 16:05:17 +00:00
initialNotification.then((arg0) => {
2026-07-23 10:11:24 +00:00
callback(outer2_6(arg0));
2026-07-20 16:05:17 +00:00
});
});
} else {
2026-07-27 11:26:19 +00:00
initialNotification = importDefault(10633).getInitialNotification();
const obj2 = importDefault(10633);
2026-07-20 16:05:17 +00:00
}
return initialNotification;
},
setCurrentUser(username, id) {
if (obj.isAndroid()) {
PushNotificationAndroid.setCurrentUser(username, id);
}
},
setMultiAccountUsers(arg0) {
const json = JSON.stringify(arg0);
if (obj.isAndroid()) {
let tmp8 = null == PushNotificationAndroid;
if (!tmp8) {
tmp8 = null == PushNotificationAndroid.setMultiAccountUsernames;
}
if (!tmp8) {
const result = PushNotificationAndroid.setMultiAccountUsernames(json);
}
} else {
const NSUserDefaultsBridge = NativeModules.NSUserDefaultsBridge;
if (!tmp4) {
const result1 = NSUserDefaultsBridge.setMultiAccountUsersJSONString(json);
}
2026-07-23 10:11:24 +00:00
tmp4 = null == NSUserDefaultsBridge || null == NSUserDefaultsBridge.setMultiAccountUsersJSONString;
2026-07-20 16:05:17 +00:00
}
},
clearPushNotificationLogs() {
if (obj.isAndroid()) {
2026-07-27 11:26:19 +00:00
require(10290) /* enforcing */.default.clearLogs();
const _default = require(10290) /* enforcing */.default;
2026-07-20 16:05:17 +00:00
}
},
setApplicationIconBadgeNumber(arg0) {
if (!obj.isAndroid()) {
2026-07-27 11:26:19 +00:00
const result = importDefault(10633).setApplicationIconBadgeNumber(arg0);
const obj2 = importDefault(10633);
2026-07-20 16:05:17 +00:00
}
},
clearAllNotifications() {
if (obj.isAndroid()) {
const result = PushNotificationAndroid.clearAllNotifications();
} else {
2026-07-27 11:26:19 +00:00
const result1 = importDefault(10633).setApplicationIconBadgeNumber(0);
const obj2 = importDefault(10633);
2026-07-20 16:05:17 +00:00
}
},
presentLocalNotification(arg0) {
if (obj.isAndroid()) {
const result = PushNotificationAndroid.presentLocalNotification(arg0);
} else {
2026-07-27 11:26:19 +00:00
const result1 = importDefault(10633).presentLocalNotification(arg0);
const obj2 = importDefault(10633);
2026-07-20 16:05:17 +00:00
}
},
getDeliveredNotifications() {
if (obj.isAndroid()) {
let resolveResult = _Promise.resolve([]);
} else {
const prototype = _Promise.prototype;
resolveResult = new _Promise((arg0) => {
2026-07-23 10:11:24 +00:00
const deliveredNotifications = outer1_1(outer1_2[2]).getDeliveredNotifications(arg0);
2026-07-20 16:05:17 +00:00
});
}
return resolveResult;
},
removeDeliveredNotifications(arg0) {
if (!obj.isAndroid()) {
2026-07-27 11:26:19 +00:00
const result = importDefault(10633).removeDeliveredNotifications(arg0);
const obj2 = importDefault(10633);
2026-07-20 16:05:17 +00:00
}
},
scheduleLocalNotification(arg0) {
if (!obj.isAndroid()) {
2026-07-27 11:26:19 +00:00
const result = importDefault(10633).scheduleLocalNotification(arg0);
const obj2 = importDefault(10633);
2026-07-20 16:05:17 +00:00
}
},
getScheduledLocalNotifications(arg0) {
if (!obj.isAndroid()) {
2026-07-27 11:26:19 +00:00
const scheduledLocalNotifications = importDefault(10633).getScheduledLocalNotifications(arg0);
const obj2 = importDefault(10633);
2026-07-20 16:05:17 +00:00
}
},
cancelLocalNotifications(arg0) {
if (!obj.isAndroid()) {
2026-07-27 11:26:19 +00:00
const result = importDefault(10633).cancelLocalNotifications(arg0);
const obj2 = importDefault(10633);
2026-07-20 16:05:17 +00:00
}
},
cancelAllLocalNotifications() {
if (!obj.isAndroid()) {
2026-07-27 11:26:19 +00:00
const result = importDefault(10633).cancelAllLocalNotifications();
const obj2 = importDefault(10633);
2026-07-20 16:05:17 +00:00
}
},
checkPermissions(arg0) {
if (obj.isAndroid()) {
arg0({});
} else {
2026-07-27 11:26:19 +00:00
importDefault(10633).checkPermissions(arg0);
const obj2 = importDefault(10633);
2026-07-20 16:05:17 +00:00
}
},
requestPermissions(arg0) {
if (obj.isAndroid()) {
let permissions = new Promise((arg0) => arg0({}));
} else {
2026-07-27 11:26:19 +00:00
permissions = importDefault(10633).requestPermissions(arg0);
const obj2 = importDefault(10633);
2026-07-20 16:05:17 +00:00
}
return permissions;
},
openNotificationSettings() {
2026-07-27 11:26:19 +00:00
importDefault(10634)();
2026-07-20 16:05:17 +00:00
},
addNotificationEventListener(localNotification, handleLocalNotification) {
2026-07-23 10:11:24 +00:00
const _require = handleLocalNotification;
2026-07-20 16:05:17 +00:00
if (obj.isAndroid()) {
if ("notification" === localNotification) {
nativeEventEmitter.addListener("notification", (arg0) => {
2026-07-23 10:11:24 +00:00
const tmp = outer1_6(arg0);
2026-07-20 16:05:17 +00:00
if (null != tmp) {
2026-07-23 10:11:24 +00:00
handleLocalNotification(tmp);
2026-07-20 16:05:17 +00:00
}
});
}
if ("localNotification" === localNotification) {
nativeEventEmitter.addListener("localNotification", (arg0) => {
2026-07-23 10:11:24 +00:00
const tmp = outer1_6(arg0);
2026-07-20 16:05:17 +00:00
if (null != tmp) {
2026-07-23 10:11:24 +00:00
handleLocalNotification(tmp);
2026-07-20 16:05:17 +00:00
}
});
}
const result = PushNotificationAndroid.registerEventListener(localNotification);
} else {
2026-07-27 11:26:19 +00:00
const listener = importDefault(10633).addEventListener(localNotification, handleLocalNotification);
const obj2 = importDefault(10633);
2026-07-20 16:05:17 +00:00
}
},
addRegisterEventListener(handleToken) {
2026-07-23 10:11:24 +00:00
const _require = handleToken;
2026-07-20 16:05:17 +00:00
if (obj.isAndroid()) {
nativeEventEmitter.addListener("register", (token) => {
2026-07-23 10:11:24 +00:00
handleToken(token.token);
2026-07-20 16:05:17 +00:00
});
const result = PushNotificationAndroid.registerEventListener("register");
} else {
2026-07-27 11:26:19 +00:00
const listener = importDefault(10633).addEventListener("register", handleToken);
const obj2 = importDefault(10633);
2026-07-20 16:05:17 +00:00
}
},
getSoundsEnabled() {
return new Promise((arg0) => {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
2026-07-20 16:05:17 +00:00
if (obj.isAndroid()) {
2026-07-23 10:11:24 +00:00
const soundsEnabled = outer1_4.getSoundsEnabled();
soundsEnabled.then((arg0) => callback(arg0));
2026-07-20 16:05:17 +00:00
} else {
arg0(false);
}
});
},
getVibrationsEnabled() {
return new Promise((arg0) => {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
2026-07-20 16:05:17 +00:00
if (obj.isAndroid()) {
2026-07-23 10:11:24 +00:00
const vibrationsEnabled = outer1_4.getVibrationsEnabled();
vibrationsEnabled.then((arg0) => callback(arg0));
2026-07-20 16:05:17 +00:00
} else {
arg0(false);
}
});
},
getLightsEnabled() {
return new Promise((arg0) => {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
2026-07-20 16:05:17 +00:00
if (obj.isAndroid()) {
2026-07-23 10:11:24 +00:00
const lightsEnabled = outer1_4.getLightsEnabled();
lightsEnabled.then((arg0) => callback(arg0));
2026-07-20 16:05:17 +00:00
} else {
arg0(false);
}
});
},
setSoundsEnabled(arg0) {
if (obj.isAndroid()) {
PushNotificationAndroid.setSoundsEnabled(arg0);
}
},
setVibrationsEnabled(arg0) {
if (obj.isAndroid()) {
PushNotificationAndroid.setVibrationsEnabled(arg0);
}
},
setLightsEnabled(arg0) {
if (obj.isAndroid()) {
PushNotificationAndroid.setLightsEnabled(arg0);
}
},
setAndroidNotifyEveryTime(arg0) {
if (obj.isAndroid()) {
PushNotificationAndroid.setNotifyEveryTime(arg0);
}
},
shouldAndroidNotifyEveryTime() {
return new Promise((arg0) => {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
2026-07-20 16:05:17 +00:00
if (obj.isAndroid()) {
2026-07-23 10:11:24 +00:00
const result = outer1_4.shouldNotifyEveryTime();
result.then((arg0) => callback(arg0));
2026-07-20 16:05:17 +00:00
} else {
arg0(false);
}
});
}
};