@imatis/react-native-notifications 4.3.3-imatis.7 → 4.3.3-imatis.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/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsModule.java +1 -1
- package/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsPackage.java +8 -3
- package/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/NotificationIntentAdapter.java +3 -11
- package/lib/android/app/src/reactNative59/java/com/wix/reactnativenotifications/NotificationManagerCompatFacade.java +2 -2
- package/package.json +1 -1
- package/android/app/src/reactNative59/reactNative59.iml +0 -11
- package/android/app/src/reactNative60/reactNative60.iml +0 -11
- package/lib/android/.gradle/6.1.1/executionHistory/executionHistory.lock +0 -0
- package/lib/android/.gradle/6.1.1/fileChanges/last-build.bin +0 -0
- package/lib/android/.gradle/6.1.1/fileHashes/fileHashes.bin +0 -0
- package/lib/android/.gradle/6.1.1/fileHashes/fileHashes.lock +0 -0
- package/lib/android/.gradle/6.1.1/gc.properties +0 -0
- package/lib/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/lib/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/lib/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/lib/android/.gradle/checksums/checksums.lock +0 -0
- package/lib/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/lib/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/lib/android/.gradle/vcs-1/gc.properties +0 -0
- package/lib/android/local.properties +0 -8
- package/lib/dist/DTO/Notification.d.ts +0 -11
- package/lib/dist/DTO/Notification.js +0 -28
- package/lib/dist/DTO/Notification.test.d.ts +0 -1
- package/lib/dist/DTO/Notification.test.js +0 -52
- package/lib/dist/DTO/NotificationAndroid.d.ts +0 -7
- package/lib/dist/DTO/NotificationAndroid.js +0 -20
- package/lib/dist/DTO/NotificationAndroid.test.d.ts +0 -1
- package/lib/dist/DTO/NotificationAndroid.test.js +0 -25
- package/lib/dist/DTO/NotificationFactory.d.ts +0 -4
- package/lib/dist/DTO/NotificationFactory.js +0 -18
- package/lib/dist/DTO/NotificationIOS.d.ts +0 -12
- package/lib/dist/DTO/NotificationIOS.js +0 -40
- package/lib/dist/DTO/NotificationIOS.test.d.ts +0 -1
- package/lib/dist/DTO/NotificationIOS.test.js +0 -58
- package/lib/dist/Notifications.d.ts +0 -65
- package/lib/dist/Notifications.js +0 -98
- package/lib/dist/NotificationsAndroid.d.ts +0 -14
- package/lib/dist/NotificationsAndroid.js +0 -32
- package/lib/dist/NotificationsIOS.d.ts +0 -51
- package/lib/dist/NotificationsIOS.js +0 -83
- package/lib/dist/adapters/CompletionCallbackWrapper.d.ts +0 -11
- package/lib/dist/adapters/CompletionCallbackWrapper.js +0 -44
- package/lib/dist/adapters/NativeCommandsSender.d.ts +0 -31
- package/lib/dist/adapters/NativeCommandsSender.js +0 -73
- package/lib/dist/adapters/NativeEventsReceiver.d.ts +0 -19
- package/lib/dist/adapters/NativeEventsReceiver.js +0 -47
- package/lib/dist/adapters/UniqueIdProvider.d.ts +0 -3
- package/lib/dist/adapters/UniqueIdProvider.js +0 -10
- package/lib/dist/commands/Commands.d.ts +0 -32
- package/lib/dist/commands/Commands.js +0 -79
- package/lib/dist/commands/Commands.test.d.ts +0 -1
- package/lib/dist/commands/Commands.test.js +0 -201
- package/lib/dist/events/EventsRegistry.d.ts +0 -18
- package/lib/dist/events/EventsRegistry.js +0 -28
- package/lib/dist/events/EventsRegistry.test.d.ts +0 -1
- package/lib/dist/events/EventsRegistry.test.js +0 -183
- package/lib/dist/events/EventsRegistryIOS.d.ts +0 -12
- package/lib/dist/events/EventsRegistryIOS.js +0 -19
- package/lib/dist/events/EventsRegistryIOS.test.d.ts +0 -1
- package/lib/dist/events/EventsRegistryIOS.test.js +0 -53
- package/lib/dist/index.d.ts +0 -7
- package/lib/dist/index.js +0 -12
- package/lib/dist/interfaces/EventSubscription.d.ts +0 -3
- package/lib/dist/interfaces/EventSubscription.js +0 -2
- package/lib/dist/interfaces/NotificationActionResponse.d.ts +0 -5
- package/lib/dist/interfaces/NotificationActionResponse.js +0 -10
- package/lib/dist/interfaces/NotificationCategory.d.ts +0 -18
- package/lib/dist/interfaces/NotificationCategory.js +0 -20
- package/lib/dist/interfaces/NotificationChannel.d.ts +0 -14
- package/lib/dist/interfaces/NotificationChannel.js +0 -2
- package/lib/dist/interfaces/NotificationCompletion.d.ts +0 -10
- package/lib/dist/interfaces/NotificationCompletion.js +0 -9
- package/lib/dist/interfaces/NotificationEvents.d.ts +0 -18
- package/lib/dist/interfaces/NotificationEvents.js +0 -2
- package/lib/dist/interfaces/NotificationPermissions.d.ts +0 -14
- package/lib/dist/interfaces/NotificationPermissions.js +0 -2
- package/lib/ios/RNNotifications.xcodeproj/project.xcworkspace/xcuserdata/troy.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotificationsAndroid = void 0;
|
|
4
|
-
const react_native_1 = require("react-native");
|
|
5
|
-
class NotificationsAndroid {
|
|
6
|
-
constructor(commands) {
|
|
7
|
-
this.commands = commands;
|
|
8
|
-
return new Proxy(this, {
|
|
9
|
-
get(target, name) {
|
|
10
|
-
if (react_native_1.Platform.OS === 'android') {
|
|
11
|
-
return target[name];
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
return () => { };
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Refresh FCM token
|
|
21
|
-
*/
|
|
22
|
-
registerRemoteNotifications() {
|
|
23
|
-
this.commands.refreshToken();
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* setNotificationChannel
|
|
27
|
-
*/
|
|
28
|
-
setNotificationChannel(notificationChannel) {
|
|
29
|
-
return this.commands.setNotificationChannel(notificationChannel);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.NotificationsAndroid = NotificationsAndroid;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Notification } from './DTO/Notification';
|
|
2
|
-
import { Commands } from './commands/Commands';
|
|
3
|
-
import { EventsRegistryIOS } from './events/EventsRegistryIOS';
|
|
4
|
-
import { NotificationPermissionOptions } from './interfaces/NotificationPermissions';
|
|
5
|
-
export declare class NotificationsIOS {
|
|
6
|
-
private readonly commands;
|
|
7
|
-
private readonly eventsRegistry;
|
|
8
|
-
constructor(commands: Commands, eventsRegistry: EventsRegistryIOS);
|
|
9
|
-
/**
|
|
10
|
-
* Request permissions to send remote notifications
|
|
11
|
-
*/
|
|
12
|
-
registerRemoteNotifications(options?: NotificationPermissionOptions): void;
|
|
13
|
-
/**
|
|
14
|
-
* Unregister for all remote notifications received via Apple Push Notification service
|
|
15
|
-
*/
|
|
16
|
-
abandonPermissions(): void;
|
|
17
|
-
/**
|
|
18
|
-
* registerPushKit
|
|
19
|
-
*/
|
|
20
|
-
registerPushKit(): void;
|
|
21
|
-
/**
|
|
22
|
-
* getBadgeCount
|
|
23
|
-
*/
|
|
24
|
-
getBadgeCount(): Promise<number>;
|
|
25
|
-
/**
|
|
26
|
-
* setBadgeCount
|
|
27
|
-
* @param count number of the new badge count
|
|
28
|
-
*/
|
|
29
|
-
setBadgeCount(count: number): void;
|
|
30
|
-
/**
|
|
31
|
-
* cancelAllLocalNotifications
|
|
32
|
-
*/
|
|
33
|
-
cancelAllLocalNotifications(): void;
|
|
34
|
-
/**
|
|
35
|
-
* checkPermissions
|
|
36
|
-
*/
|
|
37
|
-
checkPermissions(): Promise<import("./interfaces/NotificationPermissions").NotificationPermissions>;
|
|
38
|
-
/**
|
|
39
|
-
* removeDeliveredNotifications
|
|
40
|
-
* @param identifiers Array of notification identifiers
|
|
41
|
-
*/
|
|
42
|
-
removeDeliveredNotifications(identifiers: Array<string>): void;
|
|
43
|
-
/**
|
|
44
|
-
* getDeliveredNotifications
|
|
45
|
-
*/
|
|
46
|
-
getDeliveredNotifications(): Promise<Notification[]>;
|
|
47
|
-
/**
|
|
48
|
-
* Obtain the events registry instance
|
|
49
|
-
*/
|
|
50
|
-
events(): EventsRegistryIOS;
|
|
51
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotificationsIOS = void 0;
|
|
4
|
-
const react_native_1 = require("react-native");
|
|
5
|
-
class NotificationsIOS {
|
|
6
|
-
constructor(commands, eventsRegistry) {
|
|
7
|
-
this.commands = commands;
|
|
8
|
-
this.eventsRegistry = eventsRegistry;
|
|
9
|
-
return new Proxy(this, {
|
|
10
|
-
get(target, name) {
|
|
11
|
-
if (react_native_1.Platform.OS === 'ios') {
|
|
12
|
-
return target[name];
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
return () => { };
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Request permissions to send remote notifications
|
|
22
|
-
*/
|
|
23
|
-
registerRemoteNotifications(options) {
|
|
24
|
-
return this.commands.requestPermissions(options);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Unregister for all remote notifications received via Apple Push Notification service
|
|
28
|
-
*/
|
|
29
|
-
abandonPermissions() {
|
|
30
|
-
return this.commands.abandonPermissions();
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* registerPushKit
|
|
34
|
-
*/
|
|
35
|
-
registerPushKit() {
|
|
36
|
-
return this.commands.registerPushKit();
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* getBadgeCount
|
|
40
|
-
*/
|
|
41
|
-
getBadgeCount() {
|
|
42
|
-
return this.commands.getBadgeCount();
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* setBadgeCount
|
|
46
|
-
* @param count number of the new badge count
|
|
47
|
-
*/
|
|
48
|
-
setBadgeCount(count) {
|
|
49
|
-
return this.commands.setBadgeCount(count);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* cancelAllLocalNotifications
|
|
53
|
-
*/
|
|
54
|
-
cancelAllLocalNotifications() {
|
|
55
|
-
this.commands.cancelAllLocalNotifications();
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* checkPermissions
|
|
59
|
-
*/
|
|
60
|
-
checkPermissions() {
|
|
61
|
-
return this.commands.checkPermissions();
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* removeDeliveredNotifications
|
|
65
|
-
* @param identifiers Array of notification identifiers
|
|
66
|
-
*/
|
|
67
|
-
removeDeliveredNotifications(identifiers) {
|
|
68
|
-
return this.commands.removeDeliveredNotifications(identifiers);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* getDeliveredNotifications
|
|
72
|
-
*/
|
|
73
|
-
getDeliveredNotifications() {
|
|
74
|
-
return this.commands.getDeliveredNotifications();
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Obtain the events registry instance
|
|
78
|
-
*/
|
|
79
|
-
events() {
|
|
80
|
-
return this.eventsRegistry;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
exports.NotificationsIOS = NotificationsIOS;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { NativeCommandsSender } from './NativeCommandsSender';
|
|
2
|
-
import { Notification } from "..";
|
|
3
|
-
import { NotificationActionResponse } from '../interfaces/NotificationActionResponse';
|
|
4
|
-
export declare class CompletionCallbackWrapper {
|
|
5
|
-
private readonly nativeCommandsSender;
|
|
6
|
-
constructor(nativeCommandsSender: NativeCommandsSender);
|
|
7
|
-
wrapReceivedBackgroundCallback(callback: Function): (notification: Notification) => void;
|
|
8
|
-
wrapReceivedForegroundCallback(callback: Function): (notification: Notification) => void;
|
|
9
|
-
private wrapReceivedAndInvoke;
|
|
10
|
-
wrapOpenedCallback(callback: Function): (notification: object, actionResponse?: NotificationActionResponse) => void;
|
|
11
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CompletionCallbackWrapper = void 0;
|
|
4
|
-
const react_native_1 = require("react-native");
|
|
5
|
-
class CompletionCallbackWrapper {
|
|
6
|
-
constructor(nativeCommandsSender) {
|
|
7
|
-
this.nativeCommandsSender = nativeCommandsSender;
|
|
8
|
-
}
|
|
9
|
-
wrapReceivedBackgroundCallback(callback) {
|
|
10
|
-
return (notification) => {
|
|
11
|
-
this.wrapReceivedAndInvoke(callback, notification, true);
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
wrapReceivedForegroundCallback(callback) {
|
|
15
|
-
return (notification) => {
|
|
16
|
-
this.wrapReceivedAndInvoke(callback, notification, false);
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
wrapReceivedAndInvoke(callback, notification, background) {
|
|
20
|
-
const completion = (response) => {
|
|
21
|
-
if (react_native_1.Platform.OS === 'ios') {
|
|
22
|
-
const identifier = notification.identifier;
|
|
23
|
-
if (background) {
|
|
24
|
-
this.nativeCommandsSender.finishHandlingBackgroundAction(identifier, response);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
this.nativeCommandsSender.finishPresentingNotification(identifier, response);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
callback(notification, completion);
|
|
32
|
-
}
|
|
33
|
-
wrapOpenedCallback(callback) {
|
|
34
|
-
return (notification, actionResponse) => {
|
|
35
|
-
const completion = () => {
|
|
36
|
-
if (react_native_1.Platform.OS === 'ios') {
|
|
37
|
-
this.nativeCommandsSender.finishHandlingAction(notification.identifier);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
callback(notification, completion, actionResponse);
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.CompletionCallbackWrapper = CompletionCallbackWrapper;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Notification } from '../DTO/Notification';
|
|
2
|
-
import { NotificationCompletion } from '../interfaces/NotificationCompletion';
|
|
3
|
-
import { NotificationPermissions } from '../interfaces/NotificationPermissions';
|
|
4
|
-
import { NotificationCategory } from '../interfaces/NotificationCategory';
|
|
5
|
-
import { NotificationChannel } from '../interfaces/NotificationChannel';
|
|
6
|
-
import { NotificationPermissionOptions } from '../interfaces/NotificationPermissions';
|
|
7
|
-
export declare class NativeCommandsSender {
|
|
8
|
-
private readonly nativeCommandsModule;
|
|
9
|
-
constructor();
|
|
10
|
-
postLocalNotification(notification: Notification, id: number): void;
|
|
11
|
-
getInitialNotification(): Promise<Object>;
|
|
12
|
-
getLastAction(): Promise<Object>;
|
|
13
|
-
requestPermissions(options?: NotificationPermissionOptions): void;
|
|
14
|
-
abandonPermissions(): void;
|
|
15
|
-
refreshToken(): void;
|
|
16
|
-
registerPushKit(): void;
|
|
17
|
-
setCategories(categories: [NotificationCategory?]): void;
|
|
18
|
-
getBadgeCount(): Promise<number>;
|
|
19
|
-
setBadgeCount(count: number): void;
|
|
20
|
-
cancelLocalNotification(notificationId: number): void;
|
|
21
|
-
cancelAllLocalNotifications(): void;
|
|
22
|
-
isRegisteredForRemoteNotifications(): Promise<any>;
|
|
23
|
-
checkPermissions(): Promise<NotificationPermissions>;
|
|
24
|
-
removeAllDeliveredNotifications(): void;
|
|
25
|
-
removeDeliveredNotifications(identifiers: Array<string>): void;
|
|
26
|
-
getDeliveredNotifications(): Promise<Notification[]>;
|
|
27
|
-
finishPresentingNotification(notificationId: string, notificationCompletion: NotificationCompletion): void;
|
|
28
|
-
finishHandlingAction(notificationId: string): void;
|
|
29
|
-
setNotificationChannel(notificationChannel: NotificationChannel): void;
|
|
30
|
-
finishHandlingBackgroundAction(notificationId: string, backgroundFetchResult: string): void;
|
|
31
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NativeCommandsSender = void 0;
|
|
4
|
-
const react_native_1 = require("react-native");
|
|
5
|
-
class NativeCommandsSender {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.nativeCommandsModule = react_native_1.NativeModules.RNBridgeModule;
|
|
8
|
-
}
|
|
9
|
-
postLocalNotification(notification, id) {
|
|
10
|
-
return this.nativeCommandsModule.postLocalNotification(notification, id);
|
|
11
|
-
}
|
|
12
|
-
getInitialNotification() {
|
|
13
|
-
return this.nativeCommandsModule.getInitialNotification();
|
|
14
|
-
}
|
|
15
|
-
getLastAction() {
|
|
16
|
-
return this.nativeCommandsModule.getLastAction();
|
|
17
|
-
}
|
|
18
|
-
requestPermissions(options) {
|
|
19
|
-
return this.nativeCommandsModule.requestPermissions(options || {});
|
|
20
|
-
}
|
|
21
|
-
abandonPermissions() {
|
|
22
|
-
return this.nativeCommandsModule.abandonPermissions();
|
|
23
|
-
}
|
|
24
|
-
refreshToken() {
|
|
25
|
-
this.nativeCommandsModule.refreshToken();
|
|
26
|
-
}
|
|
27
|
-
registerPushKit() {
|
|
28
|
-
return this.nativeCommandsModule.registerPushKit();
|
|
29
|
-
}
|
|
30
|
-
setCategories(categories) {
|
|
31
|
-
this.nativeCommandsModule.setCategories(categories);
|
|
32
|
-
}
|
|
33
|
-
getBadgeCount() {
|
|
34
|
-
return this.nativeCommandsModule.getBadgeCount();
|
|
35
|
-
}
|
|
36
|
-
setBadgeCount(count) {
|
|
37
|
-
this.nativeCommandsModule.setBadgeCount(count);
|
|
38
|
-
}
|
|
39
|
-
cancelLocalNotification(notificationId) {
|
|
40
|
-
this.nativeCommandsModule.cancelLocalNotification(notificationId);
|
|
41
|
-
}
|
|
42
|
-
cancelAllLocalNotifications() {
|
|
43
|
-
this.nativeCommandsModule.cancelAllLocalNotifications();
|
|
44
|
-
}
|
|
45
|
-
isRegisteredForRemoteNotifications() {
|
|
46
|
-
return this.nativeCommandsModule.isRegisteredForRemoteNotifications();
|
|
47
|
-
}
|
|
48
|
-
checkPermissions() {
|
|
49
|
-
return this.nativeCommandsModule.checkPermissions();
|
|
50
|
-
}
|
|
51
|
-
removeAllDeliveredNotifications() {
|
|
52
|
-
return this.nativeCommandsModule.removeAllDeliveredNotifications();
|
|
53
|
-
}
|
|
54
|
-
removeDeliveredNotifications(identifiers) {
|
|
55
|
-
return this.nativeCommandsModule.removeDeliveredNotifications(identifiers);
|
|
56
|
-
}
|
|
57
|
-
getDeliveredNotifications() {
|
|
58
|
-
return this.nativeCommandsModule.getDeliveredNotifications();
|
|
59
|
-
}
|
|
60
|
-
finishPresentingNotification(notificationId, notificationCompletion) {
|
|
61
|
-
this.nativeCommandsModule.finishPresentingNotification(notificationId, notificationCompletion);
|
|
62
|
-
}
|
|
63
|
-
finishHandlingAction(notificationId) {
|
|
64
|
-
this.nativeCommandsModule.finishHandlingAction(notificationId);
|
|
65
|
-
}
|
|
66
|
-
setNotificationChannel(notificationChannel) {
|
|
67
|
-
this.nativeCommandsModule.setNotificationChannel(notificationChannel);
|
|
68
|
-
}
|
|
69
|
-
finishHandlingBackgroundAction(notificationId, backgroundFetchResult) {
|
|
70
|
-
this.nativeCommandsModule.finishHandlingBackgroundAction(notificationId, backgroundFetchResult);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
exports.NativeCommandsSender = NativeCommandsSender;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { EmitterSubscription } from 'react-native';
|
|
2
|
-
import { Registered, RegistrationError, RegisteredPushKit } from '../interfaces/NotificationEvents';
|
|
3
|
-
import { Notification } from '../DTO/Notification';
|
|
4
|
-
import { NotificationActionResponse } from '../interfaces/NotificationActionResponse';
|
|
5
|
-
import { NotificationFactory } from '../DTO/NotificationFactory';
|
|
6
|
-
export declare class NativeEventsReceiver {
|
|
7
|
-
private readonly notificationFactory;
|
|
8
|
-
private emitter;
|
|
9
|
-
constructor(notificationFactory?: NotificationFactory);
|
|
10
|
-
registerRemoteNotificationsRegistered(callback: (event: Registered) => void): EmitterSubscription;
|
|
11
|
-
appNotificationSettingsLinked(callback: () => void): EmitterSubscription;
|
|
12
|
-
registerPushKitRegistered(callback: (event: RegisteredPushKit) => void): EmitterSubscription;
|
|
13
|
-
registerNotificationReceived(callback: (notification: Notification) => void): EmitterSubscription;
|
|
14
|
-
registerNotificationReceivedBackground(callback: (notification: Notification) => void): EmitterSubscription;
|
|
15
|
-
registerPushKitNotificationReceived(callback: (event: object) => void): EmitterSubscription;
|
|
16
|
-
registerNotificationOpened(callback: (notification: Notification, actionResponse?: NotificationActionResponse) => void): EmitterSubscription;
|
|
17
|
-
registerRemoteNotificationsRegistrationFailed(callback: (event: RegistrationError) => void): EmitterSubscription;
|
|
18
|
-
registerRemoteNotificationsRegistrationDenied(callback: () => void): EmitterSubscription;
|
|
19
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NativeEventsReceiver = void 0;
|
|
4
|
-
const react_native_1 = require("react-native");
|
|
5
|
-
const NotificationActionResponse_1 = require("../interfaces/NotificationActionResponse");
|
|
6
|
-
const NotificationFactory_1 = require("../DTO/NotificationFactory");
|
|
7
|
-
class NativeEventsReceiver {
|
|
8
|
-
constructor(notificationFactory = new NotificationFactory_1.NotificationFactory()) {
|
|
9
|
-
this.notificationFactory = notificationFactory;
|
|
10
|
-
this.emitter = new react_native_1.NativeEventEmitter(react_native_1.NativeModules.RNEventEmitter);
|
|
11
|
-
}
|
|
12
|
-
registerRemoteNotificationsRegistered(callback) {
|
|
13
|
-
return this.emitter.addListener('remoteNotificationsRegistered', callback);
|
|
14
|
-
}
|
|
15
|
-
appNotificationSettingsLinked(callback) {
|
|
16
|
-
return this.emitter.addListener('appNotificationSettingsLinked', callback);
|
|
17
|
-
}
|
|
18
|
-
registerPushKitRegistered(callback) {
|
|
19
|
-
return this.emitter.addListener('pushKitRegistered', callback);
|
|
20
|
-
}
|
|
21
|
-
registerNotificationReceived(callback) {
|
|
22
|
-
return this.emitter.addListener('notificationReceived', (payload) => {
|
|
23
|
-
callback(this.notificationFactory.fromPayload(payload));
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
registerNotificationReceivedBackground(callback) {
|
|
27
|
-
return this.emitter.addListener('notificationReceivedBackground', (payload) => {
|
|
28
|
-
callback(this.notificationFactory.fromPayload(payload));
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
registerPushKitNotificationReceived(callback) {
|
|
32
|
-
return this.emitter.addListener('pushKitNotificationReceived', callback);
|
|
33
|
-
}
|
|
34
|
-
registerNotificationOpened(callback) {
|
|
35
|
-
return this.emitter.addListener('notificationOpened', (response) => {
|
|
36
|
-
const action = response.action ? new NotificationActionResponse_1.NotificationActionResponse(response.action) : undefined;
|
|
37
|
-
callback(this.notificationFactory.fromPayload(response.notification), action);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
registerRemoteNotificationsRegistrationFailed(callback) {
|
|
41
|
-
return this.emitter.addListener('remoteNotificationsRegistrationFailed', callback);
|
|
42
|
-
}
|
|
43
|
-
registerRemoteNotificationsRegistrationDenied(callback) {
|
|
44
|
-
return this.emitter.addListener('remoteNotificationsRegistrationDenied', callback);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.NativeEventsReceiver = NativeEventsReceiver;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UniqueIdProvider = void 0;
|
|
4
|
-
const _ = require("lodash");
|
|
5
|
-
class UniqueIdProvider {
|
|
6
|
-
generate() {
|
|
7
|
-
return parseInt(_.uniqueId());
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.UniqueIdProvider = UniqueIdProvider;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { NativeCommandsSender } from '../adapters/NativeCommandsSender';
|
|
2
|
-
import { Notification } from '../DTO/Notification';
|
|
3
|
-
import { NotificationCategory } from '../interfaces/NotificationCategory';
|
|
4
|
-
import { NotificationChannel } from '../interfaces/NotificationChannel';
|
|
5
|
-
import { NotificationPermissions } from '../interfaces/NotificationPermissions';
|
|
6
|
-
import { UniqueIdProvider } from '../adapters/UniqueIdProvider';
|
|
7
|
-
import { NotificationFactory } from '../DTO/NotificationFactory';
|
|
8
|
-
import { NotificationPermissionOptions } from '../interfaces/NotificationPermissions';
|
|
9
|
-
export declare class Commands {
|
|
10
|
-
private readonly nativeCommandsSender;
|
|
11
|
-
private readonly uniqueIdProvider;
|
|
12
|
-
private readonly notificationFactory;
|
|
13
|
-
constructor(nativeCommandsSender: NativeCommandsSender, uniqueIdProvider: UniqueIdProvider, notificationFactory: NotificationFactory);
|
|
14
|
-
postLocalNotification(notification: Notification, id?: number): number;
|
|
15
|
-
getInitialNotification(): Promise<Notification | undefined>;
|
|
16
|
-
getLastAction(): Promise<Notification | undefined>;
|
|
17
|
-
requestPermissions(options?: NotificationPermissionOptions): void;
|
|
18
|
-
abandonPermissions(): void;
|
|
19
|
-
registerPushKit(): void;
|
|
20
|
-
setCategories(categories: [NotificationCategory?]): void;
|
|
21
|
-
getBadgeCount(): Promise<number>;
|
|
22
|
-
setBadgeCount(count: number): void;
|
|
23
|
-
cancelLocalNotification(notificationId: number): void;
|
|
24
|
-
cancelAllLocalNotifications(): void;
|
|
25
|
-
isRegisteredForRemoteNotifications(): Promise<boolean>;
|
|
26
|
-
checkPermissions(): Promise<NotificationPermissions>;
|
|
27
|
-
removeAllDeliveredNotifications(): void;
|
|
28
|
-
removeDeliveredNotifications(identifiers: Array<string>): void;
|
|
29
|
-
getDeliveredNotifications(): Promise<Notification[]>;
|
|
30
|
-
refreshToken(): void;
|
|
31
|
-
setNotificationChannel(notificationChannel: NotificationChannel): void;
|
|
32
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Commands = void 0;
|
|
4
|
-
class Commands {
|
|
5
|
-
constructor(nativeCommandsSender, uniqueIdProvider, notificationFactory) {
|
|
6
|
-
this.nativeCommandsSender = nativeCommandsSender;
|
|
7
|
-
this.uniqueIdProvider = uniqueIdProvider;
|
|
8
|
-
this.notificationFactory = notificationFactory;
|
|
9
|
-
}
|
|
10
|
-
postLocalNotification(notification, id) {
|
|
11
|
-
const notificationId = id ? id : this.uniqueIdProvider.generate();
|
|
12
|
-
this.nativeCommandsSender.postLocalNotification(notification, notificationId);
|
|
13
|
-
return notificationId;
|
|
14
|
-
}
|
|
15
|
-
async getInitialNotification() {
|
|
16
|
-
return this.nativeCommandsSender.getInitialNotification().then((payload) => {
|
|
17
|
-
if (payload) {
|
|
18
|
-
return this.notificationFactory.fromPayload(payload);
|
|
19
|
-
}
|
|
20
|
-
return undefined;
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
async getLastAction() {
|
|
24
|
-
return this.nativeCommandsSender.getLastAction().then((payload) => {
|
|
25
|
-
if (payload) {
|
|
26
|
-
return this.notificationFactory.fromPayload(payload);
|
|
27
|
-
}
|
|
28
|
-
return undefined;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
requestPermissions(options) {
|
|
32
|
-
const result = this.nativeCommandsSender.requestPermissions(options);
|
|
33
|
-
return result;
|
|
34
|
-
}
|
|
35
|
-
abandonPermissions() {
|
|
36
|
-
const result = this.nativeCommandsSender.abandonPermissions();
|
|
37
|
-
return result;
|
|
38
|
-
}
|
|
39
|
-
registerPushKit() {
|
|
40
|
-
this.nativeCommandsSender.registerPushKit();
|
|
41
|
-
}
|
|
42
|
-
setCategories(categories) {
|
|
43
|
-
this.nativeCommandsSender.setCategories(categories);
|
|
44
|
-
}
|
|
45
|
-
getBadgeCount() {
|
|
46
|
-
return this.nativeCommandsSender.getBadgeCount();
|
|
47
|
-
}
|
|
48
|
-
setBadgeCount(count) {
|
|
49
|
-
this.nativeCommandsSender.setBadgeCount(count);
|
|
50
|
-
}
|
|
51
|
-
cancelLocalNotification(notificationId) {
|
|
52
|
-
this.nativeCommandsSender.cancelLocalNotification(notificationId);
|
|
53
|
-
}
|
|
54
|
-
cancelAllLocalNotifications() {
|
|
55
|
-
this.nativeCommandsSender.cancelAllLocalNotifications();
|
|
56
|
-
}
|
|
57
|
-
isRegisteredForRemoteNotifications() {
|
|
58
|
-
return this.nativeCommandsSender.isRegisteredForRemoteNotifications();
|
|
59
|
-
}
|
|
60
|
-
checkPermissions() {
|
|
61
|
-
return this.nativeCommandsSender.checkPermissions();
|
|
62
|
-
}
|
|
63
|
-
removeAllDeliveredNotifications() {
|
|
64
|
-
this.nativeCommandsSender.removeAllDeliveredNotifications();
|
|
65
|
-
}
|
|
66
|
-
removeDeliveredNotifications(identifiers) {
|
|
67
|
-
return this.nativeCommandsSender.removeDeliveredNotifications(identifiers);
|
|
68
|
-
}
|
|
69
|
-
getDeliveredNotifications() {
|
|
70
|
-
return this.nativeCommandsSender.getDeliveredNotifications();
|
|
71
|
-
}
|
|
72
|
-
refreshToken() {
|
|
73
|
-
this.nativeCommandsSender.refreshToken();
|
|
74
|
-
}
|
|
75
|
-
setNotificationChannel(notificationChannel) {
|
|
76
|
-
this.nativeCommandsSender.setNotificationChannel(notificationChannel);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
exports.Commands = Commands;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|