Skip to content

Commit

Permalink
Make local notifications actually play sound
Browse files Browse the repository at this point in the history
Add in-line documentation of a silencing method
  • Loading branch information
spinks committed Apr 18, 2020
1 parent 44c0906 commit 4e688d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Binary file added public/assets/note.mp3
Binary file not shown.
11 changes: 11 additions & 0 deletions src/utilities/notify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,28 @@ function notify(notificationContent: NProps) {
id: notificationContent['id'],
schedule: { at: new Date(notificationContent['datetime']) },
actionTypeId: '',
sound: notificationContent['silent'] ? undefined : '/assets/note.mp3',
extra: null
}
]
});
}

export interface NProps {
/**
* id: unique numeric ID for notification
*/
id: number;
title: string;
body: string;
/**
* datetime: string parsable by Date() method for time of notification
*/
datetime: string;
/**
* silent: if passed and true then sound will be disabled for notification
*/
silent?: boolean;
}

const NotifyChip: React.FC<NProps> = props => {
Expand Down

0 comments on commit 4e688d9

Please sign in to comment.