Skip to content
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.

Commit

Permalink
fix: add completion
Browse files Browse the repository at this point in the history
  • Loading branch information
gtokman committed Apr 17, 2024
1 parent f5dcbd6 commit c220dcb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/apis/registerHeadlessTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { NativeMessage, PushNotificationMessage } from '../types';
import { normalizeNativeMessage } from '../utils';

import { getConstants } from './getConstants';
import { completeNotification } from './completeNotification';

export const registerHeadlessTask = (
task: (message: PushNotificationMessage | null) => Promise<void>
Expand All @@ -14,6 +15,9 @@ export const registerHeadlessTask = (
NativeHeadlessTaskKey,
() => async (nativeMessage: NativeMessage) => {
await task(normalizeNativeMessage(nativeMessage));
if (nativeMessage.completionHandlerId) {
completeNotification(nativeMessage.completionHandlerId);
}
}
);
}
Expand Down

0 comments on commit c220dcb

Please sign in to comment.