0
0
React Nativemobile~5 mins

Push notifications (expo-notifications) in React Native - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of expo-notifications in React Native?
It is a library that helps apps send and receive push notifications easily on both iOS and Android devices.
Click to reveal answer
beginner
Which method is used to get the device's push notification token with expo-notifications?
The method getExpoPushTokenAsync() returns a unique token to send push notifications to that device.
Click to reveal answer
beginner
Why do you need to ask for permissions before sending push notifications?
Because users must allow the app to show notifications. Without permission, notifications won’t appear.
Click to reveal answer
intermediate
What is the role of a notification handler in expo-notifications?
It controls how notifications behave when received, like showing alerts or playing sounds.
Click to reveal answer
intermediate
How can you listen for incoming notifications while the app is running?
By adding a listener with addNotificationReceivedListener to react when notifications arrive.
Click to reveal answer
Which function gets the push notification token in Expo?
AgetExpoPushTokenAsync()
BrequestPermissionsAsync()
CsendNotificationAsync()
DaddNotificationReceivedListener()
What must you do before showing notifications to the user?
ARestart the app
BSend a test notification
CRequest permission from the user
DClear app cache
Which listener lets you react when a notification arrives while the app is open?
AaddNotificationResponseReceivedListener
BrequestPermissionsAsync
CgetExpoPushTokenAsync
DaddNotificationReceivedListener
What does the notification handler control?
AThe app’s theme colors
BHow notifications behave when received
CUser login state
DNetwork requests
Which platform(s) does expo-notifications support?
AiOS and Android
BOnly iOS
COnly Android
DWeb browsers
Explain the steps to set up push notifications using expo-notifications in a React Native app.
Think about permissions, token, handlers, and listeners.
You got /5 concepts.
    Describe how you would handle a notification when the app is open versus when it is closed.
    Consider different app states and listeners.
    You got /3 concepts.