@aws-amplify/rtn-push-notification 1.2.1-console-preview.be08038.0 → 1.2.1-console-preview.d745d43.0
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/apis/addMessageEventListener.d.ts +1 -1
- package/lib/apis/addMessageEventListener.js +4 -2
- package/lib/apis/addMessageEventListener.js.map +1 -1
- package/lib/apis/addTokenEventListener.js +3 -1
- package/lib/apis/addTokenEventListener.js.map +1 -1
- package/lib/apis/completeNotification.js +3 -1
- package/lib/apis/completeNotification.js.map +1 -1
- package/lib/apis/getBadgeCount.js +3 -1
- package/lib/apis/getBadgeCount.js.map +1 -1
- package/lib/apis/getConstants.js +3 -1
- package/lib/apis/getConstants.js.map +1 -1
- package/lib/apis/getLaunchNotification.js +3 -1
- package/lib/apis/getLaunchNotification.js.map +1 -1
- package/lib/apis/getPermissionStatus.js +3 -1
- package/lib/apis/getPermissionStatus.js.map +1 -1
- package/lib/apis/index.js +11 -10
- package/lib/apis/index.js.map +1 -1
- package/lib/apis/registerHeadlessTask.js +5 -3
- package/lib/apis/registerHeadlessTask.js.map +1 -1
- package/lib/apis/requestPermissions.js +3 -1
- package/lib/apis/requestPermissions.js.map +1 -1
- package/lib/apis/setBadgeCount.js +3 -1
- package/lib/apis/setBadgeCount.js.map +1 -1
- package/lib/constants.js +1 -0
- package/lib/constants.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/nativeModule.js +1 -0
- package/lib/nativeModule.js.map +1 -1
- package/lib/types/index.js +16 -0
- package/lib/types/index.js.map +1 -1
- package/lib/types/module.d.ts +1 -1
- package/lib/types/native.d.ts +8 -8
- package/lib/utils/index.js +3 -2
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/normalizeNativeMessage.d.ts +2 -6
- package/lib/utils/normalizeNativeMessage.js +5 -3
- package/lib/utils/normalizeNativeMessage.js.map +1 -1
- package/lib/utils/normalizeNativePermissionStatus.js +3 -1
- package/lib/utils/normalizeNativePermissionStatus.js.map +1 -1
- package/lib-esm/apis/addMessageEventListener.d.ts +1 -1
- package/lib-esm/index.d.ts +1 -1
- package/lib-esm/types/index.js +2 -0
- package/lib-esm/types/index.js.map +1 -1
- package/lib-esm/types/module.d.ts +1 -1
- package/lib-esm/types/module.js +1 -0
- package/lib-esm/types/native.d.ts +8 -8
- package/lib-esm/types/native.js +1 -0
- package/lib-esm/utils/normalizeNativeMessage.d.ts +2 -6
- package/package.json +4 -3
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EmitterSubscription } from 'react-native';
|
|
2
2
|
import { PushNotificationMessage } from '../types';
|
|
3
|
-
export declare const addMessageEventListener: (event: string, listener: (message: PushNotificationMessage | null, completionHandlerId?: string
|
|
3
|
+
export declare const addMessageEventListener: (event: string, listener: (message: PushNotificationMessage | null, completionHandlerId?: string) => void) => EmitterSubscription;
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.addMessageEventListener = void 0;
|
|
5
6
|
const nativeModule_1 = require("../nativeModule");
|
|
6
7
|
const utils_1 = require("../utils");
|
|
7
|
-
|
|
8
|
-
listener(utils_1.normalizeNativeMessage(nativeMessage), nativeMessage.completionHandlerId);
|
|
8
|
+
const addMessageEventListener = (event, listener) => nativeModule_1.nativeEventEmitter.addListener(event, (nativeMessage) => {
|
|
9
|
+
listener((0, utils_1.normalizeNativeMessage)(nativeMessage), nativeMessage.completionHandlerId);
|
|
9
10
|
});
|
|
11
|
+
exports.addMessageEventListener = addMessageEventListener;
|
|
10
12
|
//# sourceMappingURL=addMessageEventListener.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addMessageEventListener.js","sourceRoot":"","sources":["../../src/apis/addMessageEventListener.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"addMessageEventListener.js","sourceRoot":"","sources":["../../src/apis/addMessageEventListener.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAGtC,kDAAqD;AAErD,oCAAkD;AAE3C,MAAM,uBAAuB,GAAG,CACtC,KAAa,EACb,QAGS,EACa,EAAE,CACxB,iCAAkB,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,aAA4B,EAAE,EAAE;IACtE,QAAQ,CACP,IAAA,8BAAsB,EAAC,aAAa,CAAC,EACrC,aAAa,CAAC,mBAAmB,CACjC,CAAC;AACH,CAAC,CAAC,CAAC;AAZS,QAAA,uBAAuB,2BAYhC"}
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.addTokenEventListener = void 0;
|
|
5
6
|
const nativeModule_1 = require("../nativeModule");
|
|
6
|
-
|
|
7
|
+
const addTokenEventListener = (event, listener) => nativeModule_1.nativeEventEmitter.addListener(event, ({ token }) => {
|
|
7
8
|
listener(token);
|
|
8
9
|
});
|
|
10
|
+
exports.addTokenEventListener = addTokenEventListener;
|
|
9
11
|
//# sourceMappingURL=addTokenEventListener.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addTokenEventListener.js","sourceRoot":"","sources":["../../src/apis/addTokenEventListener.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"addTokenEventListener.js","sourceRoot":"","sources":["../../src/apis/addTokenEventListener.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAGtC,kDAAqD;AAG9C,MAAM,qBAAqB,GAAG,CACpC,KAAa,EACb,QAAiC,EACX,EAAE,CACxB,iCAAkB,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAgB,EAAE,EAAE;IACjE,QAAQ,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC;AANS,QAAA,qBAAqB,yBAM9B"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.completeNotification = void 0;
|
|
5
6
|
const nativeModule_1 = require("../nativeModule");
|
|
6
|
-
|
|
7
|
+
const completeNotification = (completionHandlerId) => nativeModule_1.nativeModule.completeNotification?.(completionHandlerId);
|
|
8
|
+
exports.completeNotification = completeNotification;
|
|
7
9
|
//# sourceMappingURL=completeNotification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completeNotification.js","sourceRoot":"","sources":["../../src/apis/completeNotification.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"completeNotification.js","sourceRoot":"","sources":["../../src/apis/completeNotification.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,kDAA+C;AAExC,MAAM,oBAAoB,GAAG,CAAC,mBAA2B,EAAQ,EAAE,CACzE,2BAAY,CAAC,oBAAoB,EAAE,CAAC,mBAAmB,CAAC,CAAC;AAD7C,QAAA,oBAAoB,wBACyB"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getBadgeCount = void 0;
|
|
5
6
|
const nativeModule_1 = require("../nativeModule");
|
|
6
|
-
|
|
7
|
+
const getBadgeCount = () => nativeModule_1.nativeModule.getBadgeCount?.();
|
|
8
|
+
exports.getBadgeCount = getBadgeCount;
|
|
7
9
|
//# sourceMappingURL=getBadgeCount.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBadgeCount.js","sourceRoot":"","sources":["../../src/apis/getBadgeCount.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"getBadgeCount.js","sourceRoot":"","sources":["../../src/apis/getBadgeCount.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,kDAA+C;AAExC,MAAM,aAAa,GAAG,GAAkC,EAAE,CAChE,2BAAY,CAAC,aAAa,EAAE,EAAE,CAAC;AADnB,QAAA,aAAa,iBACM"}
|
package/lib/apis/getConstants.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getConstants = void 0;
|
|
5
6
|
const nativeModule_1 = require("../nativeModule");
|
|
6
|
-
|
|
7
|
+
const getConstants = () => nativeModule_1.nativeModule.getConstants();
|
|
8
|
+
exports.getConstants = getConstants;
|
|
7
9
|
//# sourceMappingURL=getConstants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConstants.js","sourceRoot":"","sources":["../../src/apis/getConstants.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"getConstants.js","sourceRoot":"","sources":["../../src/apis/getConstants.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,kDAA+C;AAExC,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,2BAAY,CAAC,YAAY,EAAE,CAAC;AAAjD,QAAA,YAAY,gBAAqC"}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getLaunchNotification = void 0;
|
|
5
6
|
const nativeModule_1 = require("../nativeModule");
|
|
6
7
|
const utils_1 = require("../utils");
|
|
7
|
-
|
|
8
|
+
const getLaunchNotification = async () => (0, utils_1.normalizeNativeMessage)((await nativeModule_1.nativeModule.getLaunchNotification()) ?? undefined);
|
|
9
|
+
exports.getLaunchNotification = getLaunchNotification;
|
|
8
10
|
//# sourceMappingURL=getLaunchNotification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLaunchNotification.js","sourceRoot":"","sources":["../../src/apis/getLaunchNotification.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"getLaunchNotification.js","sourceRoot":"","sources":["../../src/apis/getLaunchNotification.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,kDAA+C;AAE/C,oCAAkD;AAE3C,MAAM,qBAAqB,GACjC,KAAK,IAA6C,EAAE,CACnD,IAAA,8BAAsB,EACrB,CAAC,MAAM,2BAAY,CAAC,qBAAqB,EAAE,CAAC,IAAI,SAAS,CACzD,CAAC;AAJS,QAAA,qBAAqB,yBAI9B"}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getPermissionStatus = void 0;
|
|
5
6
|
const nativeModule_1 = require("../nativeModule");
|
|
6
7
|
const utils_1 = require("../utils");
|
|
7
|
-
|
|
8
|
+
const getPermissionStatus = async () => (0, utils_1.normalizeNativePermissionStatus)(await nativeModule_1.nativeModule.getPermissionStatus());
|
|
9
|
+
exports.getPermissionStatus = getPermissionStatus;
|
|
8
10
|
//# sourceMappingURL=getPermissionStatus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPermissionStatus.js","sourceRoot":"","sources":["../../src/apis/getPermissionStatus.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"getPermissionStatus.js","sourceRoot":"","sources":["../../src/apis/getPermissionStatus.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,kDAA+C;AAE/C,oCAA2D;AAEpD,MAAM,mBAAmB,GAC/B,KAAK,IAA+C,EAAE,CACrD,IAAA,uCAA+B,EAAC,MAAM,2BAAY,CAAC,mBAAmB,EAAE,CAAC,CAAC;AAF/D,QAAA,mBAAmB,uBAE4C"}
|
package/lib/apis/index.js
CHANGED
|
@@ -2,24 +2,25 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.setBadgeCount = exports.requestPermissions = exports.registerHeadlessTask = exports.getPermissionStatus = exports.getLaunchNotification = exports.getConstants = exports.getBadgeCount = exports.completeNotification = exports.addTokenEventListener = exports.addMessageEventListener = void 0;
|
|
5
6
|
var addMessageEventListener_1 = require("./addMessageEventListener");
|
|
6
|
-
exports
|
|
7
|
+
Object.defineProperty(exports, "addMessageEventListener", { enumerable: true, get: function () { return addMessageEventListener_1.addMessageEventListener; } });
|
|
7
8
|
var addTokenEventListener_1 = require("./addTokenEventListener");
|
|
8
|
-
exports
|
|
9
|
+
Object.defineProperty(exports, "addTokenEventListener", { enumerable: true, get: function () { return addTokenEventListener_1.addTokenEventListener; } });
|
|
9
10
|
var completeNotification_1 = require("./completeNotification");
|
|
10
|
-
exports
|
|
11
|
+
Object.defineProperty(exports, "completeNotification", { enumerable: true, get: function () { return completeNotification_1.completeNotification; } });
|
|
11
12
|
var getBadgeCount_1 = require("./getBadgeCount");
|
|
12
|
-
exports
|
|
13
|
+
Object.defineProperty(exports, "getBadgeCount", { enumerable: true, get: function () { return getBadgeCount_1.getBadgeCount; } });
|
|
13
14
|
var getConstants_1 = require("./getConstants");
|
|
14
|
-
exports
|
|
15
|
+
Object.defineProperty(exports, "getConstants", { enumerable: true, get: function () { return getConstants_1.getConstants; } });
|
|
15
16
|
var getLaunchNotification_1 = require("./getLaunchNotification");
|
|
16
|
-
exports
|
|
17
|
+
Object.defineProperty(exports, "getLaunchNotification", { enumerable: true, get: function () { return getLaunchNotification_1.getLaunchNotification; } });
|
|
17
18
|
var getPermissionStatus_1 = require("./getPermissionStatus");
|
|
18
|
-
exports
|
|
19
|
+
Object.defineProperty(exports, "getPermissionStatus", { enumerable: true, get: function () { return getPermissionStatus_1.getPermissionStatus; } });
|
|
19
20
|
var registerHeadlessTask_1 = require("./registerHeadlessTask");
|
|
20
|
-
exports
|
|
21
|
+
Object.defineProperty(exports, "registerHeadlessTask", { enumerable: true, get: function () { return registerHeadlessTask_1.registerHeadlessTask; } });
|
|
21
22
|
var requestPermissions_1 = require("./requestPermissions");
|
|
22
|
-
exports
|
|
23
|
+
Object.defineProperty(exports, "requestPermissions", { enumerable: true, get: function () { return requestPermissions_1.requestPermissions; } });
|
|
23
24
|
var setBadgeCount_1 = require("./setBadgeCount");
|
|
24
|
-
exports
|
|
25
|
+
Object.defineProperty(exports, "setBadgeCount", { enumerable: true, get: function () { return setBadgeCount_1.setBadgeCount; } });
|
|
25
26
|
//# sourceMappingURL=index.js.map
|
package/lib/apis/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B,iDAAgD;AAAvC,8GAAA,aAAa,OAAA"}
|
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.registerHeadlessTask = void 0;
|
|
5
6
|
const react_native_1 = require("react-native");
|
|
6
7
|
const getConstants_1 = require("./getConstants");
|
|
7
8
|
const utils_1 = require("../utils");
|
|
8
|
-
|
|
9
|
-
const { NativeHeadlessTaskKey } = getConstants_1.getConstants();
|
|
9
|
+
const registerHeadlessTask = (task) => {
|
|
10
|
+
const { NativeHeadlessTaskKey } = (0, getConstants_1.getConstants)();
|
|
10
11
|
if (NativeHeadlessTaskKey) {
|
|
11
12
|
react_native_1.AppRegistry.registerHeadlessTask(NativeHeadlessTaskKey, () => async (nativeMessage) => {
|
|
12
|
-
await task(utils_1.normalizeNativeMessage(nativeMessage));
|
|
13
|
+
await task((0, utils_1.normalizeNativeMessage)(nativeMessage));
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
16
|
};
|
|
17
|
+
exports.registerHeadlessTask = registerHeadlessTask;
|
|
16
18
|
//# sourceMappingURL=registerHeadlessTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerHeadlessTask.js","sourceRoot":"","sources":["../../src/apis/registerHeadlessTask.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"registerHeadlessTask.js","sourceRoot":"","sources":["../../src/apis/registerHeadlessTask.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,+CAA2C;AAC3C,iDAA8C;AAE9C,oCAAkD;AAE3C,MAAM,oBAAoB,GAAG,CACnC,IAAgE,EACzD,EAAE;IACT,MAAM,EAAE,qBAAqB,EAAE,GAAG,IAAA,2BAAY,GAAE,CAAC;IACjD,IAAI,qBAAqB,EAAE;QAC1B,0BAAW,CAAC,oBAAoB,CAC/B,qBAAqB,EACrB,GAAG,EAAE,CAAC,KAAK,EAAE,aAA4B,EAAE,EAAE;YAC5C,MAAM,IAAI,CAAC,IAAA,8BAAsB,EAAC,aAAa,CAAC,CAAC,CAAC;QACnD,CAAC,CACD,CAAC;KACF;AACF,CAAC,CAAC;AAZW,QAAA,oBAAoB,wBAY/B"}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.requestPermissions = void 0;
|
|
5
6
|
const nativeModule_1 = require("../nativeModule");
|
|
6
|
-
|
|
7
|
+
const requestPermissions = async (permissions = {
|
|
7
8
|
alert: true,
|
|
8
9
|
badge: true,
|
|
9
10
|
sound: true,
|
|
10
11
|
}) => nativeModule_1.nativeModule.requestPermissions(permissions);
|
|
12
|
+
exports.requestPermissions = requestPermissions;
|
|
11
13
|
//# sourceMappingURL=requestPermissions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestPermissions.js","sourceRoot":"","sources":["../../src/apis/requestPermissions.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"requestPermissions.js","sourceRoot":"","sources":["../../src/apis/requestPermissions.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,kDAA+C;AAGxC,MAAM,kBAAkB,GAAG,KAAK,EACtC,cAA2C;IAC1C,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;CACX,EACkB,EAAE,CAAC,2BAAY,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;AANvD,QAAA,kBAAkB,sBAMqC"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.setBadgeCount = void 0;
|
|
5
6
|
const nativeModule_1 = require("../nativeModule");
|
|
6
|
-
|
|
7
|
+
const setBadgeCount = (count) => nativeModule_1.nativeModule.setBadgeCount?.(count);
|
|
8
|
+
exports.setBadgeCount = setBadgeCount;
|
|
7
9
|
//# sourceMappingURL=setBadgeCount.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setBadgeCount.js","sourceRoot":"","sources":["../../src/apis/setBadgeCount.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"setBadgeCount.js","sourceRoot":"","sources":["../../src/apis/setBadgeCount.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,kDAA+C;AAExC,MAAM,aAAa,GAAG,CAAC,KAAa,EAAQ,EAAE,CACpD,2BAAY,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,CAAC;AADxB,QAAA,aAAa,iBACW"}
|
package/lib/constants.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LINKING_ERROR = exports.PACKAGE_NAME = void 0;
|
|
3
4
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
5
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
6
|
const react_native_1 = require("react-native");
|
package/lib/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,+CAAwC;AAExC,UAAU;AACG,QAAA,YAAY,GAAG,oCAAoC,CAAC;AACpD,QAAA,aAAa,GACzB,OAAO,oBAAY,qDAAqD;IACxE,uBAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,gCAAgC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACvE,sDAAsD;IACtD,+BAA+B,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -20,5 +20,5 @@ declare const module: {
|
|
|
20
20
|
requestPermissions: (permissions?: import("./types").PushNotificationPermissions) => Promise<boolean>;
|
|
21
21
|
setBadgeCount: (count: number) => void;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export type PushNotificationModule = typeof module;
|
|
24
24
|
export { module };
|
package/lib/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.module = void 0;
|
|
5
6
|
const apis_1 = require("./apis");
|
|
6
7
|
const module = {
|
|
7
8
|
addMessageEventListener: apis_1.addMessageEventListener,
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,iCAWgB;AAOhB,MAAM,MAAM,GAAG;IACd,uBAAuB,EAAvB,8BAAuB;IACvB,qBAAqB,EAArB,4BAAqB;IACrB,oBAAoB,EAApB,2BAAoB;IACpB,aAAa,EAAb,oBAAa;IACb,YAAY,EAAZ,mBAAY;IACZ,qBAAqB,EAArB,4BAAqB;IACrB,mBAAmB,EAAnB,0BAAmB;IACnB,oBAAoB,EAApB,2BAAoB;IACpB,kBAAkB,EAAlB,yBAAkB;IAClB,aAAa,EAAb,oBAAa;CACb,CAAC;AAGO,wBAAM"}
|
package/lib/nativeModule.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.nativeEventEmitter = exports.nativeModule = void 0;
|
|
5
6
|
const react_native_1 = require("react-native");
|
|
6
7
|
const constants_1 = require("./constants");
|
|
7
8
|
exports.nativeModule = react_native_1.NativeModules.AmplifyRTNPushNotification
|
package/lib/nativeModule.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeModule.js","sourceRoot":"","sources":["../src/nativeModule.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"nativeModule.js","sourceRoot":"","sources":["../src/nativeModule.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,+CAAiE;AACjE,2CAA4C;AAG/B,QAAA,YAAY,GACxB,4BAAa,CAAC,0BAA0B;IACvC,CAAC,CAAC,4BAAa,CAAC,0BAA0B;IAC1C,CAAC,CAAC,IAAI,KAAK,CACT,EAAE,EACF;QACC,GAAG;YACF,MAAM,IAAI,KAAK,CAAC,yBAAa,CAAC,CAAC;QAChC,CAAC;KACD,CACA,CAAC;AAEO,QAAA,kBAAkB,GAAG,IAAI,iCAAkB,CAAC,oBAAY,CAAC,CAAC"}
|
package/lib/types/index.js
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
|
+
};
|
|
4
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
__exportStar(require("./module"), exports);
|
|
20
|
+
__exportStar(require("./native"), exports);
|
|
5
21
|
//# sourceMappingURL=index.js.map
|
package/lib/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;;;;;;;;;;;;;;AAEtC,2CAAyB;AACzB,2CAAyB"}
|
package/lib/types/module.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface PushNotificationMessage {
|
|
|
13
13
|
apnsOptions?: ApnsPlatformOptions;
|
|
14
14
|
data?: Record<string, unknown>;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type PushNotificationPermissionStatus = 'denied' | 'granted' | 'shouldRequest' | 'shouldExplainThenRequest';
|
|
17
17
|
interface ApnsPlatformOptions {
|
|
18
18
|
subtitle?: string;
|
|
19
19
|
}
|
package/lib/types/native.d.ts
CHANGED
|
@@ -18,14 +18,14 @@ export interface PushNotificationNativeModule extends NativeModule {
|
|
|
18
18
|
getPermissionStatus: () => Promise<NativePermissionStatus>;
|
|
19
19
|
requestPermissions: (permissions: PushNotificationPermissions) => Promise<boolean>;
|
|
20
20
|
}
|
|
21
|
-
export
|
|
21
|
+
export type NativeAction = {
|
|
22
22
|
deeplink?: string;
|
|
23
23
|
url?: string;
|
|
24
24
|
};
|
|
25
|
-
export
|
|
25
|
+
export type NativeMessage = (ApnsMessage | FcmMessage) & {
|
|
26
26
|
token?: never;
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type NativePermissionStatus = AndroidPermissionStatus | IosPermissionStatus;
|
|
29
29
|
export interface NormalizedValues {
|
|
30
30
|
body?: string;
|
|
31
31
|
imageUrl?: string;
|
|
@@ -34,7 +34,7 @@ export interface NormalizedValues {
|
|
|
34
34
|
options?: Pick<PushNotificationMessage, 'apnsOptions' | 'fcmOptions'>;
|
|
35
35
|
data?: Record<string, unknown>;
|
|
36
36
|
}
|
|
37
|
-
export
|
|
37
|
+
export type ApnsMessage = {
|
|
38
38
|
aps: {
|
|
39
39
|
alert?: {
|
|
40
40
|
body?: string;
|
|
@@ -49,8 +49,8 @@ export declare type ApnsMessage = {
|
|
|
49
49
|
rawData?: never;
|
|
50
50
|
completionHandlerId?: string;
|
|
51
51
|
};
|
|
52
|
-
export
|
|
53
|
-
export
|
|
52
|
+
export type IosPermissionStatus = 'NotDetermined' | 'Authorized' | 'Denied';
|
|
53
|
+
export type FcmMessage = {
|
|
54
54
|
action?: NativeAction;
|
|
55
55
|
aps?: never;
|
|
56
56
|
body?: string;
|
|
@@ -63,7 +63,7 @@ export declare type FcmMessage = {
|
|
|
63
63
|
sendTime?: string;
|
|
64
64
|
completionHandlerId?: never;
|
|
65
65
|
};
|
|
66
|
-
export
|
|
67
|
-
export
|
|
66
|
+
export type AndroidPermissionStatus = 'ShouldRequest' | 'ShouldExplainThenRequest' | 'Granted' | 'Denied';
|
|
67
|
+
export type TokenPayload = {
|
|
68
68
|
token: string;
|
|
69
69
|
};
|
package/lib/utils/index.js
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.normalizeNativePermissionStatus = exports.normalizeNativeMessage = void 0;
|
|
5
6
|
var normalizeNativeMessage_1 = require("./normalizeNativeMessage");
|
|
6
|
-
exports
|
|
7
|
+
Object.defineProperty(exports, "normalizeNativeMessage", { enumerable: true, get: function () { return normalizeNativeMessage_1.normalizeNativeMessage; } });
|
|
7
8
|
var normalizeNativePermissionStatus_1 = require("./normalizeNativePermissionStatus");
|
|
8
|
-
exports
|
|
9
|
+
Object.defineProperty(exports, "normalizeNativePermissionStatus", { enumerable: true, get: function () { return normalizeNativePermissionStatus_1.normalizeNativePermissionStatus; } });
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
package/lib/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,qFAAoF;AAA3E,kJAAA,+BAA+B,OAAA"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NativeMessage, PushNotificationMessage } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
5
|
-
export declare const normalizeNativeMessage: (nativeMessage?:
|
|
6
|
-
token?: undefined;
|
|
7
|
-
}) | (FcmMessage & {
|
|
8
|
-
token?: undefined;
|
|
9
|
-
}) | undefined) => PushNotificationMessage | null;
|
|
5
|
+
export declare const normalizeNativeMessage: (nativeMessage?: NativeMessage) => PushNotificationMessage | null;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.normalizeNativeMessage = void 0;
|
|
5
6
|
const lodash_1 = require("lodash");
|
|
6
7
|
/**
|
|
7
8
|
* @internal
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
+
const normalizeNativeMessage = (nativeMessage) => {
|
|
10
11
|
let normalized;
|
|
11
12
|
if (isApnsMessage(nativeMessage)) {
|
|
12
13
|
normalized = normalizeApnsMessage(nativeMessage);
|
|
@@ -27,6 +28,7 @@ exports.normalizeNativeMessage = (nativeMessage) => {
|
|
|
27
28
|
...options,
|
|
28
29
|
};
|
|
29
30
|
};
|
|
31
|
+
exports.normalizeNativeMessage = normalizeNativeMessage;
|
|
30
32
|
const normalizeApnsMessage = (apnsMessage) => {
|
|
31
33
|
const { aps, data } = apnsMessage;
|
|
32
34
|
const { body, title } = aps.alert ?? {};
|
|
@@ -57,7 +59,7 @@ const getFcmAction = (action) => {
|
|
|
57
59
|
const getApnsOptions = ({ aps, }) => {
|
|
58
60
|
const { subtitle } = aps.alert ?? {};
|
|
59
61
|
const apnsOptions = { ...(subtitle && { subtitle }) };
|
|
60
|
-
return { ...(!lodash_1.isEmpty(apnsOptions) && { apnsOptions }) };
|
|
62
|
+
return { ...(!(0, lodash_1.isEmpty)(apnsOptions) && { apnsOptions }) };
|
|
61
63
|
};
|
|
62
64
|
const getFcmOptions = ({ channelId = '', messageId = '', senderId = '', sendTime = '', }) => {
|
|
63
65
|
const fcmOptions = {
|
|
@@ -66,7 +68,7 @@ const getFcmOptions = ({ channelId = '', messageId = '', senderId = '', sendTime
|
|
|
66
68
|
senderId,
|
|
67
69
|
sendTime: new Date(sendTime),
|
|
68
70
|
};
|
|
69
|
-
return { ...(!lodash_1.isEmpty(fcmOptions) && { fcmOptions }) };
|
|
71
|
+
return { ...(!(0, lodash_1.isEmpty)(fcmOptions) && { fcmOptions }) };
|
|
70
72
|
};
|
|
71
73
|
const isApnsMessage = (nativeMessage) => !!nativeMessage?.aps;
|
|
72
74
|
const isFcmMessage = (nativeMessage) => !!nativeMessage?.rawData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeNativeMessage.js","sourceRoot":"","sources":["../../src/utils/normalizeNativeMessage.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"normalizeNativeMessage.js","sourceRoot":"","sources":["../../src/utils/normalizeNativeMessage.ts"],"names":[],"mappings":"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"}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.normalizeNativePermissionStatus = void 0;
|
|
5
6
|
/**
|
|
6
7
|
* @internal
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
+
const normalizeNativePermissionStatus = (nativeStatus) => {
|
|
9
10
|
switch (nativeStatus) {
|
|
10
11
|
case 'ShouldRequest':
|
|
11
12
|
return 'shouldRequest';
|
|
@@ -19,4 +20,5 @@ exports.normalizeNativePermissionStatus = (nativeStatus) => {
|
|
|
19
20
|
return 'denied';
|
|
20
21
|
}
|
|
21
22
|
};
|
|
23
|
+
exports.normalizeNativePermissionStatus = normalizeNativePermissionStatus;
|
|
22
24
|
//# sourceMappingURL=normalizeNativePermissionStatus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeNativePermissionStatus.js","sourceRoot":"","sources":["../../src/utils/normalizeNativePermissionStatus.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"normalizeNativePermissionStatus.js","sourceRoot":"","sources":["../../src/utils/normalizeNativePermissionStatus.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAOtC;;GAEG;AACI,MAAM,+BAA+B,GAAG,CAC9C,YAAoC,EACD,EAAE;IACrC,QAAQ,YAAY,EAAE;QACrB,KAAK,eAAe;YACnB,OAAO,eAAe,CAAC;QACxB,KAAK,eAAe,CAAC;QACrB,KAAK,0BAA0B;YAC9B,OAAO,0BAA0B,CAAC;QACnC,KAAK,YAAY,CAAC;QAClB,KAAK,SAAS;YACb,OAAO,SAAS,CAAC;QAClB,KAAK,QAAQ;YACZ,OAAO,QAAQ,CAAC;KACjB;AACF,CAAC,CAAC;AAfW,QAAA,+BAA+B,mCAe1C"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EmitterSubscription } from 'react-native';
|
|
2
2
|
import { PushNotificationMessage } from '../types';
|
|
3
|
-
export declare const addMessageEventListener: (event: string, listener: (message: PushNotificationMessage | null, completionHandlerId?: string
|
|
3
|
+
export declare const addMessageEventListener: (event: string, listener: (message: PushNotificationMessage | null, completionHandlerId?: string) => void) => EmitterSubscription;
|
package/lib-esm/index.d.ts
CHANGED
|
@@ -20,5 +20,5 @@ declare const module: {
|
|
|
20
20
|
requestPermissions: (permissions?: import("./types").PushNotificationPermissions) => Promise<boolean>;
|
|
21
21
|
setBadgeCount: (count: number) => void;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export type PushNotificationModule = typeof module;
|
|
24
24
|
export { module };
|
package/lib-esm/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
|
@@ -13,7 +13,7 @@ export interface PushNotificationMessage {
|
|
|
13
13
|
apnsOptions?: ApnsPlatformOptions;
|
|
14
14
|
data?: Record<string, unknown>;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type PushNotificationPermissionStatus = 'denied' | 'granted' | 'shouldRequest' | 'shouldExplainThenRequest';
|
|
17
17
|
interface ApnsPlatformOptions {
|
|
18
18
|
subtitle?: string;
|
|
19
19
|
}
|
package/lib-esm/types/module.js
CHANGED
|
@@ -18,14 +18,14 @@ export interface PushNotificationNativeModule extends NativeModule {
|
|
|
18
18
|
getPermissionStatus: () => Promise<NativePermissionStatus>;
|
|
19
19
|
requestPermissions: (permissions: PushNotificationPermissions) => Promise<boolean>;
|
|
20
20
|
}
|
|
21
|
-
export
|
|
21
|
+
export type NativeAction = {
|
|
22
22
|
deeplink?: string;
|
|
23
23
|
url?: string;
|
|
24
24
|
};
|
|
25
|
-
export
|
|
25
|
+
export type NativeMessage = (ApnsMessage | FcmMessage) & {
|
|
26
26
|
token?: never;
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type NativePermissionStatus = AndroidPermissionStatus | IosPermissionStatus;
|
|
29
29
|
export interface NormalizedValues {
|
|
30
30
|
body?: string;
|
|
31
31
|
imageUrl?: string;
|
|
@@ -34,7 +34,7 @@ export interface NormalizedValues {
|
|
|
34
34
|
options?: Pick<PushNotificationMessage, 'apnsOptions' | 'fcmOptions'>;
|
|
35
35
|
data?: Record<string, unknown>;
|
|
36
36
|
}
|
|
37
|
-
export
|
|
37
|
+
export type ApnsMessage = {
|
|
38
38
|
aps: {
|
|
39
39
|
alert?: {
|
|
40
40
|
body?: string;
|
|
@@ -49,8 +49,8 @@ export declare type ApnsMessage = {
|
|
|
49
49
|
rawData?: never;
|
|
50
50
|
completionHandlerId?: string;
|
|
51
51
|
};
|
|
52
|
-
export
|
|
53
|
-
export
|
|
52
|
+
export type IosPermissionStatus = 'NotDetermined' | 'Authorized' | 'Denied';
|
|
53
|
+
export type FcmMessage = {
|
|
54
54
|
action?: NativeAction;
|
|
55
55
|
aps?: never;
|
|
56
56
|
body?: string;
|
|
@@ -63,7 +63,7 @@ export declare type FcmMessage = {
|
|
|
63
63
|
sendTime?: string;
|
|
64
64
|
completionHandlerId?: never;
|
|
65
65
|
};
|
|
66
|
-
export
|
|
67
|
-
export
|
|
66
|
+
export type AndroidPermissionStatus = 'ShouldRequest' | 'ShouldExplainThenRequest' | 'Granted' | 'Denied';
|
|
67
|
+
export type TokenPayload = {
|
|
68
68
|
token: string;
|
|
69
69
|
};
|
package/lib-esm/types/native.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NativeMessage, PushNotificationMessage } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
5
|
-
export declare const normalizeNativeMessage: (nativeMessage?:
|
|
6
|
-
token?: undefined;
|
|
7
|
-
}) | (FcmMessage & {
|
|
8
|
-
token?: undefined;
|
|
9
|
-
}) | undefined) => PushNotificationMessage | null;
|
|
5
|
+
export declare const normalizeNativeMessage: (nativeMessage?: NativeMessage) => PushNotificationMessage | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/rtn-push-notification",
|
|
3
|
-
"version": "1.2.1-console-preview.
|
|
3
|
+
"version": "1.2.1-console-preview.d745d43.0+d745d43",
|
|
4
4
|
"description": "React Native module for aws-amplify push notifications",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib-esm/index.js",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 88.21"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@types/react-native": "0.70.0"
|
|
27
|
+
"@types/react-native": "0.70.0",
|
|
28
|
+
"typescript": "5.0.2"
|
|
28
29
|
},
|
|
29
30
|
"react-native": {
|
|
30
31
|
"./lib/index": "./lib-esm/index.js"
|
|
@@ -47,5 +48,5 @@
|
|
|
47
48
|
"lib-esm",
|
|
48
49
|
"src"
|
|
49
50
|
],
|
|
50
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "d745d43595a690928a86070deff39f3eed526437"
|
|
51
52
|
}
|