@aws-amplify/rtn-push-notification 1.2.16 → 1.2.17-unstable.0d2aa5d.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/rtn-push-notification",
3
- "version": "1.2.16",
3
+ "version": "1.2.17-unstable.0d2aa5d.0+0d2aa5d",
4
4
  "description": "React Native module for aws-amplify push notifications",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.mjs",
@@ -44,5 +44,5 @@
44
44
  "dist/esm",
45
45
  "src"
46
46
  ],
47
- "gitHead": "0e919f6e759cb94d03e119162b530b32d48f1357"
47
+ "gitHead": "0d2aa5d71a6b995e302c7404becd8345763eae43"
48
48
  }
@@ -10,12 +10,12 @@ export const addMessageEventListener = (
10
10
  event: string,
11
11
  listener: (
12
12
  message: PushNotificationMessage | null,
13
- completionHandlerId?: string
14
- ) => void
13
+ completionHandlerId?: string,
14
+ ) => void,
15
15
  ): EmitterSubscription =>
16
16
  nativeEventEmitter.addListener(event, (nativeMessage: NativeMessage) => {
17
17
  listener(
18
18
  normalizeNativeMessage(nativeMessage),
19
- nativeMessage.completionHandlerId
19
+ nativeMessage.completionHandlerId,
20
20
  );
21
21
  });
@@ -7,7 +7,7 @@ import { TokenPayload } from '../types';
7
7
 
8
8
  export const addTokenEventListener = (
9
9
  event: string,
10
- listener: (token: string) => void
10
+ listener: (token: string) => void,
11
11
  ): EmitterSubscription =>
12
12
  nativeEventEmitter.addListener(event, ({ token }: TokenPayload) => {
13
13
  listener(token);
@@ -8,5 +8,5 @@ import { normalizeNativeMessage } from '../utils';
8
8
  export const getLaunchNotification =
9
9
  async (): Promise<PushNotificationMessage | null> =>
10
10
  normalizeNativeMessage(
11
- (await nativeModule.getLaunchNotification()) ?? undefined
11
+ (await nativeModule.getLaunchNotification()) ?? undefined,
12
12
  );
@@ -7,7 +7,7 @@ import { NativeMessage, PushNotificationMessage } from '../types';
7
7
  import { normalizeNativeMessage } from '../utils';
8
8
 
9
9
  export const registerHeadlessTask = (
10
- task: (message: PushNotificationMessage | null) => Promise<void>
10
+ task: (message: PushNotificationMessage | null) => Promise<void>,
11
11
  ): void => {
12
12
  const { NativeHeadlessTaskKey } = getConstants();
13
13
  if (NativeHeadlessTaskKey) {
@@ -15,7 +15,7 @@ export const registerHeadlessTask = (
15
15
  NativeHeadlessTaskKey,
16
16
  () => async (nativeMessage: NativeMessage) => {
17
17
  await task(normalizeNativeMessage(nativeMessage));
18
- }
18
+ },
19
19
  );
20
20
  }
21
21
  };
@@ -9,7 +9,7 @@ export const requestPermissions = async (
9
9
  alert: true,
10
10
  badge: true,
11
11
  sound: true,
12
- }
12
+ },
13
13
  ): Promise<boolean> =>
14
14
  nativeModule.requestPermissions({
15
15
  alert,
@@ -14,7 +14,7 @@ export const nativeModule: PushNotificationNativeModule =
14
14
  get() {
15
15
  throw new Error(LINKING_ERROR);
16
16
  },
17
- }
18
- );
17
+ },
18
+ );
19
19
 
20
20
  export const nativeEventEmitter = new NativeEventEmitter(nativeModule);
@@ -21,7 +21,7 @@ export interface PushNotificationNativeModule extends NativeModule {
21
21
  setBadgeCount?: (count: number) => void;
22
22
  getPermissionStatus: () => Promise<NativePermissionStatus>;
23
23
  requestPermissions: (
24
- permissions: PushNotificationPermissions
24
+ permissions: PushNotificationPermissions,
25
25
  ) => Promise<boolean>;
26
26
  }
27
27
 
@@ -15,7 +15,7 @@ import {
15
15
  * @internal
16
16
  */
17
17
  export const normalizeNativeMessage = (
18
- nativeMessage?: NativeMessage
18
+ nativeMessage?: NativeMessage,
19
19
  ): PushNotificationMessage | null => {
20
20
  let normalized: NormalizedValues;
21
21
  if (isApnsMessage(nativeMessage)) {
@@ -53,7 +53,7 @@ const normalizeFcmMessage = (fcmMessage: FcmMessage): NormalizedValues => {
53
53
  };
54
54
 
55
55
  const getApnsAction = (
56
- action?: NativeAction
56
+ action?: NativeAction,
57
57
  ): Pick<PushNotificationMessage, 'deeplinkUrl'> | undefined => {
58
58
  if (action?.deeplink) {
59
59
  return { deeplinkUrl: action.deeplink };
@@ -61,7 +61,7 @@ const getApnsAction = (
61
61
  };
62
62
 
63
63
  const getFcmAction = (
64
- action?: NativeAction
64
+ action?: NativeAction,
65
65
  ): Pick<PushNotificationMessage, 'goToUrl' | 'deeplinkUrl'> | undefined => {
66
66
  if (action?.url) {
67
67
  return { goToUrl: action.url };
@@ -95,9 +95,9 @@ const getFcmOptions = ({
95
95
  };
96
96
 
97
97
  const isApnsMessage = (
98
- nativeMessage?: NativeMessage
98
+ nativeMessage?: NativeMessage,
99
99
  ): nativeMessage is ApnsMessage => !!nativeMessage?.aps;
100
100
 
101
101
  const isFcmMessage = (
102
- nativeMessage?: NativeMessage
102
+ nativeMessage?: NativeMessage,
103
103
  ): nativeMessage is FcmMessage => !!nativeMessage?.rawData;
@@ -10,7 +10,7 @@ import {
10
10
  * @internal
11
11
  */
12
12
  export const normalizeNativePermissionStatus = (
13
- nativeStatus: NativePermissionStatus
13
+ nativeStatus: NativePermissionStatus,
14
14
  ): PushNotificationPermissionStatus => {
15
15
  switch (nativeStatus) {
16
16
  case 'ShouldRequest':