Skip to content

Commit

Permalink
Merge pull request #6 from DanielAraldi/feat/add-notifications
Browse files Browse the repository at this point in the history
Feat/add notifications
  • Loading branch information
DanielAraldi authored Nov 16, 2023
2 parents 7b35112 + 5d7e574 commit f13fed4
Show file tree
Hide file tree
Showing 4 changed files with 269 additions and 25 deletions.
10 changes: 10 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
Rajdhani_700Bold,
} from '@expo-google-fonts/rajdhani';
import { useFonts } from 'expo-font';
import * as Notifications from 'expo-notifications';
import { useEffect } from 'react';
import { StatusBar } from 'react-native';
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';

Expand All @@ -20,6 +22,14 @@ export default function App() {
Rajdhani_700Bold,
});

useEffect(() => {
const subscriptions = Notifications.addNotificationResponseReceivedListener(
notification => console.log(notification),
);

return () => subscriptions.remove();
}, []);

if (!fontsLoaded) return null;

return (
Expand Down
Loading

0 comments on commit f13fed4

Please sign in to comment.