-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dep(@notifee/react-native): rebase and linter fixes
- Loading branch information
1 parent
b8df6b5
commit 4ea24fa
Showing
1 changed file
with
4 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,23 @@ | ||
import './react/index.native'; | ||
import notifee, {EventType} from '@notifee/react-native'; | ||
import notifee, { EventType } from '@notifee/react-native'; | ||
|
||
import logger from './react/features/app/logger'; | ||
import './react/index.native'; | ||
|
||
// Needs to be registered outside any React components as early as possible | ||
await notifee.registerForegroundService(() => { | ||
return new Promise(resolve => { | ||
return new Promise(() => { | ||
logger.warn('Foreground service running'); | ||
|
||
notifee.onBackgroundEvent(async event => { | ||
if (event.type === EventType.ACTION_PRESS && event.detail.pressAction.id === 'hang-up') { | ||
console.log('HANG UP BUTTON PRESSED BACKGROUND'); | ||
} | ||
|
||
return resolve(); | ||
}); | ||
|
||
notifee.onForegroundEvent(async ({ type, detail }) => { | ||
if (type === EventType.ACTION_PRESS && detail.pressAction.id === 'hang-up') { | ||
console.log('HANG UP BUTTON PRESSED'); | ||
} | ||
|
||
return resolve(); | ||
}); | ||
}); | ||
}); |