react-native-notify-kit 9.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +44 -0
- package/README.md +212 -0
- package/RNNotifee.podspec +37 -0
- package/RNNotifeeCore.podspec +32 -0
- package/android/.editorconfig +10 -0
- package/android/build.gradle +117 -0
- package/android/gradle.properties +1 -0
- package/android/libs/app/notifee/core/202108261754/core-202108261754.aar +0 -0
- package/android/libs/app/notifee/core/202108261754/core-202108261754.aar.md5 +1 -0
- package/android/libs/app/notifee/core/202108261754/core-202108261754.aar.sha1 +1 -0
- package/android/libs/app/notifee/core/202108261754/core-202108261754.aar.sha256 +1 -0
- package/android/libs/app/notifee/core/202108261754/core-202108261754.aar.sha512 +1 -0
- package/android/libs/app/notifee/core/202108261754/core-202108261754.pom +9 -0
- package/android/libs/app/notifee/core/202108261754/core-202108261754.pom.md5 +1 -0
- package/android/libs/app/notifee/core/202108261754/core-202108261754.pom.sha1 +1 -0
- package/android/libs/app/notifee/core/202108261754/core-202108261754.pom.sha256 +1 -0
- package/android/libs/app/notifee/core/202108261754/core-202108261754.pom.sha512 +1 -0
- package/android/libs/app/notifee/core/maven-metadata.xml +13 -0
- package/android/libs/app/notifee/core/maven-metadata.xml.md5 +1 -0
- package/android/libs/app/notifee/core/maven-metadata.xml.sha1 +1 -0
- package/android/libs/app/notifee/core/maven-metadata.xml.sha256 +1 -0
- package/android/libs/app/notifee/core/maven-metadata.xml.sha512 +1 -0
- package/android/lint.xml +5 -0
- package/android/proguard-rules.pro +82 -0
- package/android/settings.gradle +1 -0
- package/android/src/main/AndroidManifest.xml +12 -0
- package/android/src/main/kotlin/io/invertase/notifee/HeadlessTask.kt +257 -0
- package/android/src/main/kotlin/io/invertase/notifee/NotifeeApiModule.kt +392 -0
- package/android/src/main/kotlin/io/invertase/notifee/NotifeeEventSubscriber.kt +117 -0
- package/android/src/main/kotlin/io/invertase/notifee/NotifeeInitProvider.kt +43 -0
- package/android/src/main/kotlin/io/invertase/notifee/NotifeePackage.kt +37 -0
- package/android/src/main/kotlin/io/invertase/notifee/NotifeeReactUtils.kt +118 -0
- package/dist/NotifeeApiModule.d.ts +53 -0
- package/dist/NotifeeApiModule.js +593 -0
- package/dist/NotifeeApiModule.js.map +1 -0
- package/dist/NotifeeJSEventEmitter.d.ts +3 -0
- package/dist/NotifeeJSEventEmitter.js +9 -0
- package/dist/NotifeeJSEventEmitter.js.map +1 -0
- package/dist/NotifeeNativeError.d.ts +15 -0
- package/dist/NotifeeNativeError.js +56 -0
- package/dist/NotifeeNativeError.js.map +1 -0
- package/dist/NotifeeNativeModule.d.ts +13 -0
- package/dist/NotifeeNativeModule.js +27 -0
- package/dist/NotifeeNativeModule.js.map +1 -0
- package/dist/NotifeeNativeModule.web.d.ts +12 -0
- package/dist/NotifeeNativeModule.web.js +15 -0
- package/dist/NotifeeNativeModule.web.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/specs/NativeNotifeeModule.d.ts +53 -0
- package/dist/specs/NativeNotifeeModule.js +6 -0
- package/dist/specs/NativeNotifeeModule.js.map +1 -0
- package/dist/types/Library.d.ts +21 -0
- package/dist/types/Library.js +5 -0
- package/dist/types/Library.js.map +1 -0
- package/dist/types/Module.d.ts +576 -0
- package/dist/types/Module.js +5 -0
- package/dist/types/Module.js.map +1 -0
- package/dist/types/Notification.d.ts +462 -0
- package/dist/types/Notification.js +108 -0
- package/dist/types/Notification.js.map +1 -0
- package/dist/types/NotificationAndroid.d.ts +1311 -0
- package/dist/types/NotificationAndroid.js +406 -0
- package/dist/types/NotificationAndroid.js.map +1 -0
- package/dist/types/NotificationIOS.d.ts +539 -0
- package/dist/types/NotificationIOS.js +89 -0
- package/dist/types/NotificationIOS.js.map +1 -0
- package/dist/types/NotificationWeb.d.ts +5 -0
- package/dist/types/NotificationWeb.js +5 -0
- package/dist/types/NotificationWeb.js.map +1 -0
- package/dist/types/PowerManagerInfo.d.ts +36 -0
- package/dist/types/PowerManagerInfo.js +5 -0
- package/dist/types/PowerManagerInfo.js.map +1 -0
- package/dist/types/Trigger.d.ts +124 -0
- package/dist/types/Trigger.js +48 -0
- package/dist/types/Trigger.js.map +1 -0
- package/dist/utils/id.d.ts +1 -0
- package/dist/utils/id.js +12 -0
- package/dist/utils/id.js.map +1 -0
- package/dist/utils/index.d.ts +16 -0
- package/dist/utils/index.js +31 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/validate.d.ts +15 -0
- package/dist/utils/validate.js +75 -0
- package/dist/utils/validate.js.map +1 -0
- package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfo.d.ts +2 -0
- package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfo.js +45 -0
- package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfo.js.map +1 -0
- package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.d.ts +2 -0
- package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.js +24 -0
- package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.js.map +1 -0
- package/dist/validators/validate.d.ts +25 -0
- package/dist/validators/validate.js +68 -0
- package/dist/validators/validate.js.map +1 -0
- package/dist/validators/validateAndroidAction.d.ts +2 -0
- package/dist/validators/validateAndroidAction.js +46 -0
- package/dist/validators/validateAndroidAction.js.map +1 -0
- package/dist/validators/validateAndroidChannel.d.ts +2 -0
- package/dist/validators/validateAndroidChannel.js +152 -0
- package/dist/validators/validateAndroidChannel.js.map +1 -0
- package/dist/validators/validateAndroidChannelGroup.d.ts +2 -0
- package/dist/validators/validateAndroidChannelGroup.js +39 -0
- package/dist/validators/validateAndroidChannelGroup.js.map +1 -0
- package/dist/validators/validateAndroidFullScreenAction.d.ts +2 -0
- package/dist/validators/validateAndroidFullScreenAction.js +47 -0
- package/dist/validators/validateAndroidFullScreenAction.js.map +1 -0
- package/dist/validators/validateAndroidInput.d.ts +2 -0
- package/dist/validators/validateAndroidInput.js +51 -0
- package/dist/validators/validateAndroidInput.js.map +1 -0
- package/dist/validators/validateAndroidNotification.d.ts +2 -0
- package/dist/validators/validateAndroidNotification.js +541 -0
- package/dist/validators/validateAndroidNotification.js.map +1 -0
- package/dist/validators/validateAndroidPressAction.d.ts +2 -0
- package/dist/validators/validateAndroidPressAction.js +47 -0
- package/dist/validators/validateAndroidPressAction.js.map +1 -0
- package/dist/validators/validateAndroidStyle.d.ts +22 -0
- package/dist/validators/validateAndroidStyle.js +222 -0
- package/dist/validators/validateAndroidStyle.js.map +1 -0
- package/dist/validators/validateIOSAttachment.d.ts +6 -0
- package/dist/validators/validateIOSAttachment.js +96 -0
- package/dist/validators/validateIOSAttachment.js.map +1 -0
- package/dist/validators/validateIOSCategory.d.ts +2 -0
- package/dist/validators/validateIOSCategory.js +118 -0
- package/dist/validators/validateIOSCategory.js.map +1 -0
- package/dist/validators/validateIOSCategoryAction.d.ts +2 -0
- package/dist/validators/validateIOSCategoryAction.js +53 -0
- package/dist/validators/validateIOSCategoryAction.js.map +1 -0
- package/dist/validators/validateIOSInput.d.ts +2 -0
- package/dist/validators/validateIOSInput.js +29 -0
- package/dist/validators/validateIOSInput.js.map +1 -0
- package/dist/validators/validateIOSNotification.d.ts +2 -0
- package/dist/validators/validateIOSNotification.js +205 -0
- package/dist/validators/validateIOSNotification.js.map +1 -0
- package/dist/validators/validateIOSPermissions.d.ts +2 -0
- package/dist/validators/validateIOSPermissions.js +59 -0
- package/dist/validators/validateIOSPermissions.js.map +1 -0
- package/dist/validators/validateNotification.d.ts +11 -0
- package/dist/validators/validateNotification.js +121 -0
- package/dist/validators/validateNotification.js.map +1 -0
- package/dist/validators/validateTrigger.d.ts +2 -0
- package/dist/validators/validateTrigger.js +107 -0
- package/dist/validators/validateTrigger.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/ios/NotifeeCore/Info.plist +22 -0
- package/ios/NotifeeCore/NotifeeCore+NSNotificationCenter.h +28 -0
- package/ios/NotifeeCore/NotifeeCore+NSNotificationCenter.m +76 -0
- package/ios/NotifeeCore/NotifeeCore+NSURLSession.h +25 -0
- package/ios/NotifeeCore/NotifeeCore+NSURLSession.m +55 -0
- package/ios/NotifeeCore/NotifeeCore+UNUserNotificationCenter.h +44 -0
- package/ios/NotifeeCore/NotifeeCore+UNUserNotificationCenter.m +270 -0
- package/ios/NotifeeCore/NotifeeCore.h +118 -0
- package/ios/NotifeeCore/NotifeeCore.m +843 -0
- package/ios/NotifeeCore/NotifeeCoreDelegateHolder.h +34 -0
- package/ios/NotifeeCore/NotifeeCoreDelegateHolder.m +70 -0
- package/ios/NotifeeCore/NotifeeCoreDownloadDelegate.h +39 -0
- package/ios/NotifeeCore/NotifeeCoreDownloadDelegate.m +68 -0
- package/ios/NotifeeCore/NotifeeCoreExtensionHelper.h +38 -0
- package/ios/NotifeeCore/NotifeeCoreExtensionHelper.m +224 -0
- package/ios/NotifeeCore/NotifeeCoreUtil.h +81 -0
- package/ios/NotifeeCore/NotifeeCoreUtil.m +834 -0
- package/ios/RNNotifee/NotifeeApiModule.h +25 -0
- package/ios/RNNotifee/NotifeeApiModule.mm +421 -0
- package/ios/RNNotifee/NotifeeExtensionHelper.h +37 -0
- package/ios/RNNotifee/NotifeeExtensionHelper.m +37 -0
- package/ios/RNNotifee.xcodeproj/project.pbxproj +318 -0
- package/ios/RNNotifee.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RNNotifee.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/jest-mock.js +162 -0
- package/package.json +85 -0
- package/react-native.config.js +11 -0
- package/src/NotifeeApiModule.ts +823 -0
- package/src/NotifeeJSEventEmitter.ts +10 -0
- package/src/NotifeeNativeError.ts +68 -0
- package/src/NotifeeNativeModule.ts +39 -0
- package/src/NotifeeNativeModule.web.ts +25 -0
- package/src/index.ts +33 -0
- package/src/specs/NativeNotifeeModule.ts +71 -0
- package/src/types/Library.ts +28 -0
- package/src/types/Module.ts +629 -0
- package/src/types/Notification.ts +518 -0
- package/src/types/NotificationAndroid.ts +1478 -0
- package/src/types/NotificationIOS.ts +683 -0
- package/src/types/NotificationWeb.ts +5 -0
- package/src/types/PowerManagerInfo.ts +43 -0
- package/src/types/Trigger.ts +136 -0
- package/src/utils/id.ts +13 -0
- package/src/utils/index.ts +46 -0
- package/src/utils/validate.ts +90 -0
- package/src/validators/iosCommunicationInfo/validateIOSCommunicationInfo.ts +61 -0
- package/src/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.ts +33 -0
- package/src/validators/validate.ts +85 -0
- package/src/validators/validateAndroidAction.ts +54 -0
- package/src/validators/validateAndroidChannel.ts +188 -0
- package/src/validators/validateAndroidChannelGroup.ts +49 -0
- package/src/validators/validateAndroidFullScreenAction.ts +65 -0
- package/src/validators/validateAndroidInput.ts +67 -0
- package/src/validators/validateAndroidNotification.ts +734 -0
- package/src/validators/validateAndroidPressAction.ts +65 -0
- package/src/validators/validateAndroidStyle.ts +315 -0
- package/src/validators/validateIOSAttachment.ts +135 -0
- package/src/validators/validateIOSCategory.ts +150 -0
- package/src/validators/validateIOSCategoryAction.ts +65 -0
- package/src/validators/validateIOSInput.ts +38 -0
- package/src/validators/validateIOSNotification.ts +296 -0
- package/src/validators/validateIOSPermissions.ts +78 -0
- package/src/validators/validateNotification.ts +156 -0
- package/src/validators/validateTrigger.ts +142 -0
- package/src/version.ts +2 -0
- package/tsconfig.json +27 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016-present Invertase Limited
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
import EventEmitter from 'react-native/Libraries/vendor/emitter/EventEmitter';
|
|
7
|
+
|
|
8
|
+
// @ts-ignore See https://github.com/facebook/react-native/pull/36462
|
|
9
|
+
const emitter = new EventEmitter();
|
|
10
|
+
export default emitter;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016-present Invertase Limited
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { NativeError } from './types/Library';
|
|
6
|
+
|
|
7
|
+
export default class NotifeeNativeError extends Error implements NativeError {
|
|
8
|
+
public readonly code: string;
|
|
9
|
+
public readonly nativeErrorCode: string;
|
|
10
|
+
public readonly nativeErrorMessage: string;
|
|
11
|
+
private readonly jsStack: string;
|
|
12
|
+
|
|
13
|
+
// TODO native error type
|
|
14
|
+
constructor(nativeError: any, jsStack = '') {
|
|
15
|
+
super();
|
|
16
|
+
const { userInfo } = nativeError;
|
|
17
|
+
|
|
18
|
+
this.code = `${userInfo.code || 'unknown'}`;
|
|
19
|
+
Object.defineProperty(this, 'code', {
|
|
20
|
+
enumerable: false,
|
|
21
|
+
value: `${userInfo.code || 'unknown'}`,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
this.jsStack = jsStack;
|
|
25
|
+
Object.defineProperty(this, 'jsStack', {
|
|
26
|
+
enumerable: false,
|
|
27
|
+
value: jsStack,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
Object.defineProperty(this, 'message', {
|
|
31
|
+
enumerable: false,
|
|
32
|
+
value: `[${this.code}] ${userInfo.message || nativeError.message}`,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
Object.defineProperty(this, 'userInfo', {
|
|
36
|
+
enumerable: false,
|
|
37
|
+
value: userInfo,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
this.nativeErrorCode = userInfo.nativeErrorCode || null;
|
|
41
|
+
Object.defineProperty(this, 'nativeErrorCode', {
|
|
42
|
+
enumerable: false,
|
|
43
|
+
value: userInfo.nativeErrorCode || null,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
this.nativeErrorMessage = userInfo.nativeErrorMessage || null;
|
|
47
|
+
Object.defineProperty(this, 'nativeErrorMessage', {
|
|
48
|
+
enumerable: false,
|
|
49
|
+
value: userInfo.nativeErrorMessage || null,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
this.stack = this.getStackWithMessage(`NativeError: ${this.message}`);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// todo errorEvent type
|
|
56
|
+
static fromEvent(errorEvent: any, stack?: string): NotifeeNativeError {
|
|
57
|
+
return new NotifeeNativeError({ userInfo: errorEvent }, stack || new Error().stack);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Build a stack trace that includes JS stack prior to calling the native method.
|
|
62
|
+
*
|
|
63
|
+
* @returns {string}
|
|
64
|
+
*/
|
|
65
|
+
getStackWithMessage(message: string): string {
|
|
66
|
+
return [message, ...this.jsStack.split('\n').slice(2, 13)].join('\n');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016-present Invertase Limited
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import NotifeeJSEventEmitter from './NotifeeJSEventEmitter';
|
|
6
|
+
import { EventSubscription, NativeEventEmitter, TurboModuleRegistry } from 'react-native';
|
|
7
|
+
import type { Spec } from './specs/NativeNotifeeModule';
|
|
8
|
+
|
|
9
|
+
export interface NativeModuleConfig {
|
|
10
|
+
version: string;
|
|
11
|
+
nativeModuleName: string;
|
|
12
|
+
nativeEvents: string[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default class NotifeeNativeModule {
|
|
16
|
+
private _nativeModule: Spec;
|
|
17
|
+
private _nativeEmitter: NativeEventEmitter;
|
|
18
|
+
|
|
19
|
+
public constructor(config: NativeModuleConfig) {
|
|
20
|
+
this._nativeModule = TurboModuleRegistry.getEnforcing<Spec>(config.nativeModuleName);
|
|
21
|
+
|
|
22
|
+
// @ts-ignore - change here needs resolution https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49560/files
|
|
23
|
+
this._nativeEmitter = new NativeEventEmitter(this.native as EventSubscription['subscriber']);
|
|
24
|
+
for (let i = 0; i < config.nativeEvents.length; i++) {
|
|
25
|
+
const eventName = config.nativeEvents[i];
|
|
26
|
+
this._nativeEmitter.addListener(eventName, (payload: any) => {
|
|
27
|
+
this.emitter.emit(eventName, payload);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public get emitter() {
|
|
33
|
+
return NotifeeJSEventEmitter;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public get native(): Spec {
|
|
37
|
+
return this._nativeModule;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NativeModulesStatic } from 'react-native';
|
|
2
|
+
import NotifeeJSEventEmitter from './NotifeeJSEventEmitter';
|
|
3
|
+
|
|
4
|
+
export interface NativeModuleConfig {
|
|
5
|
+
version: string;
|
|
6
|
+
nativeModuleName: string;
|
|
7
|
+
nativeEvents: string[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default class NotifeeNativeModule {
|
|
11
|
+
// @ts-ignore unused value
|
|
12
|
+
private readonly _moduleConfig: NativeModuleConfig;
|
|
13
|
+
|
|
14
|
+
public constructor(config: NativeModuleConfig) {
|
|
15
|
+
this._moduleConfig = Object.assign({}, config);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public get emitter() {
|
|
19
|
+
return NotifeeJSEventEmitter;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public get native(): NativeModulesStatic {
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016-present Invertase Limited
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import NotifeeApiModule from './NotifeeApiModule';
|
|
6
|
+
import { ModuleStatics, ModuleWithStatics } from './types/Module';
|
|
7
|
+
import { version as SDK_VERSION } from './version';
|
|
8
|
+
import {
|
|
9
|
+
isIOS,
|
|
10
|
+
kReactNativeNotifeeNotificationBackgroundEvent,
|
|
11
|
+
kReactNativeNotifeeNotificationEvent,
|
|
12
|
+
} from './utils';
|
|
13
|
+
|
|
14
|
+
const apiModule = new NotifeeApiModule({
|
|
15
|
+
version: SDK_VERSION,
|
|
16
|
+
nativeModuleName: 'NotifeeApiModule',
|
|
17
|
+
nativeEvents: isIOS
|
|
18
|
+
? [kReactNativeNotifeeNotificationEvent, kReactNativeNotifeeNotificationBackgroundEvent]
|
|
19
|
+
: [kReactNativeNotifeeNotificationEvent],
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const statics: ModuleStatics = {
|
|
23
|
+
SDK_VERSION,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const defaultExports: ModuleWithStatics = Object.assign(apiModule, statics);
|
|
27
|
+
export default defaultExports;
|
|
28
|
+
|
|
29
|
+
export * from './types/Library';
|
|
30
|
+
export * from './types/Notification';
|
|
31
|
+
export * from './types/Trigger';
|
|
32
|
+
export * from './types/NotificationIOS';
|
|
33
|
+
export * from './types/NotificationAndroid';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016-present Invertase Limited
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { TurboModule } from 'react-native';
|
|
6
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
7
|
+
|
|
8
|
+
export interface Spec extends TurboModule {
|
|
9
|
+
// Constants (Android only; iOS returns 0)
|
|
10
|
+
getConstants(): { ANDROID_API_LEVEL: number };
|
|
11
|
+
|
|
12
|
+
// ─── Shared ───────────────────────────────────────────────────────────────
|
|
13
|
+
|
|
14
|
+
cancelAllNotifications(): Promise<void>;
|
|
15
|
+
cancelDisplayedNotifications(): Promise<void>;
|
|
16
|
+
cancelTriggerNotifications(): Promise<void>;
|
|
17
|
+
cancelAllNotificationsWithIds(
|
|
18
|
+
ids: Array<string>,
|
|
19
|
+
notificationType: number,
|
|
20
|
+
tag: string | null,
|
|
21
|
+
): Promise<void>;
|
|
22
|
+
getDisplayedNotifications(): Promise<Array<Object>>;
|
|
23
|
+
getTriggerNotifications(): Promise<Array<Object>>;
|
|
24
|
+
getTriggerNotificationIds(): Promise<Array<string>>;
|
|
25
|
+
displayNotification(notification: Object): Promise<void>;
|
|
26
|
+
createTriggerNotification(notification: Object, trigger: Object): Promise<void>;
|
|
27
|
+
requestPermission(permissions: Object): Promise<Object>;
|
|
28
|
+
getNotificationSettings(): Promise<Object>;
|
|
29
|
+
getInitialNotification(): Promise<Object | null>;
|
|
30
|
+
|
|
31
|
+
// ─── Android-only ─────────────────────────────────────────────────────────
|
|
32
|
+
|
|
33
|
+
createChannel(channelMap: Object): Promise<void>;
|
|
34
|
+
createChannels(channelsArray: Array<Object>): Promise<void>;
|
|
35
|
+
createChannelGroup(channelGroupMap: Object): Promise<void>;
|
|
36
|
+
createChannelGroups(channelGroupsArray: Array<Object>): Promise<void>;
|
|
37
|
+
deleteChannel(channelId: string): Promise<void>;
|
|
38
|
+
deleteChannelGroup(channelGroupId: string): Promise<void>;
|
|
39
|
+
getChannel(channelId: string): Promise<Object | null>;
|
|
40
|
+
getChannels(): Promise<Array<Object>>;
|
|
41
|
+
getChannelGroup(channelGroupId: string): Promise<Object | null>;
|
|
42
|
+
getChannelGroups(): Promise<Array<Object>>;
|
|
43
|
+
isChannelCreated(channelId: string): Promise<boolean>;
|
|
44
|
+
isChannelBlocked(channelId: string): Promise<boolean>;
|
|
45
|
+
openAlarmPermissionSettings(): Promise<void>;
|
|
46
|
+
openNotificationSettings(channelId: string | null): Promise<void>;
|
|
47
|
+
openBatteryOptimizationSettings(): Promise<void>;
|
|
48
|
+
isBatteryOptimizationEnabled(): Promise<boolean>;
|
|
49
|
+
getPowerManagerInfo(): Promise<Object>;
|
|
50
|
+
openPowerManagerSettings(): Promise<void>;
|
|
51
|
+
stopForegroundService(): Promise<void>;
|
|
52
|
+
hideNotificationDrawer(): void;
|
|
53
|
+
addListener(eventName: string): void;
|
|
54
|
+
removeListeners(count: number): void;
|
|
55
|
+
|
|
56
|
+
// ─── iOS-only ─────────────────────────────────────────────────────────────
|
|
57
|
+
|
|
58
|
+
cancelNotification(notificationId: string): Promise<void>;
|
|
59
|
+
cancelDisplayedNotification(notificationId: string): Promise<void>;
|
|
60
|
+
cancelTriggerNotification(notificationId: string): Promise<void>;
|
|
61
|
+
cancelDisplayedNotificationsWithIds(ids: Array<string>): Promise<void>;
|
|
62
|
+
cancelTriggerNotificationsWithIds(ids: Array<string>): Promise<void>;
|
|
63
|
+
getNotificationCategories(): Promise<Array<Object>>;
|
|
64
|
+
setNotificationCategories(categories: Array<Object>): Promise<void>;
|
|
65
|
+
setBadgeCount(count: number): Promise<void>;
|
|
66
|
+
getBadgeCount(): Promise<number>;
|
|
67
|
+
incrementBadgeCount(incrementBy: number): Promise<void>;
|
|
68
|
+
decrementBadgeCount(decrementBy: number): Promise<void>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('NotifeeApiModule');
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016-present Invertase Limited
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* An Error that has occurred in native Android or iOS code converted into a JavaScript Error.
|
|
7
|
+
*/
|
|
8
|
+
export interface NativeError extends Error {
|
|
9
|
+
/**
|
|
10
|
+
* Error code, e.g. `invalid-parameter`
|
|
11
|
+
*/
|
|
12
|
+
readonly code: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Error message
|
|
16
|
+
*/
|
|
17
|
+
readonly message: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The native returned error code, different per platform
|
|
21
|
+
*/
|
|
22
|
+
readonly nativeErrorCode: string | number;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The native returned error message, different per platform
|
|
26
|
+
*/
|
|
27
|
+
readonly nativeErrorMessage: string;
|
|
28
|
+
}
|