Bird
Raised Fist0
HLDsystem_design~10 mins

Push notification integration in HLD - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to initialize push notifications in the app.

HLD
PushNotificationManager.[1]();
Drag options to blanks, or click blank then click option'
Aactivate
Bstart
Claunch
Dinitialize
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' or 'launch' which might sound correct but are not standard method names.
Confusing activation with initialization.
2fill in blank
medium

Complete the code to request user permission for push notifications.

HLD
NotificationService.request[1]Permission();
Drag options to blanks, or click blank then click option'
APush
BLocation
CCamera
DMicrophone
Attempts:
3 left
💡 Hint
Common Mistakes
Requesting unrelated permissions like camera or microphone.
Confusing push permission with location permission.
3fill in blank
hard

Fix the error in the code to handle incoming push notifications.

HLD
PushNotificationManager.onNotificationReceived = function([1]) {
  console.log('Notification:', [1].message);
};
Drag options to blanks, or click blank then click option'
Aevent
Bmsg
Cnotification
Ddata
Attempts:
3 left
💡 Hint
Common Mistakes
Using a parameter name that does not match the object used inside the function.
Using generic names like 'event' or 'msg' that cause confusion.
4fill in blank
hard

Fill both blanks to subscribe the user to a topic and handle errors.

HLD
PushNotificationManager.subscribeToTopic([1])
  .then(() => console.log('Subscribed to topic'))
  .catch([2] => console.error('Subscription error:', [2]));
Drag options to blanks, or click blank then click option'
A'news-updates'
Berror
Cerr
D'daily-alerts'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-string value for the topic name.
Using inconsistent error parameter names.
5fill in blank
hard

Fill all three blanks to create a notification payload and send it.

HLD
const payload = {
  title: [1],
  body: [2],
  priority: [3]
};
PushNotificationManager.sendNotification(payload);
Drag options to blanks, or click blank then click option'
A'Welcome!'
B'You have a new message.'
C'high'
D'low'
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-string values for title or body.
Setting priority to 'low' when high priority is needed.