Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SharedPreferences sp = getSharedPreferences("notifications",MODE_PRIVATE);
- getAudioNotif = sp.getBoolean("audio_notif_get",false);
- getVideoNotif = sp.getBoolean("video_notif_get",false);
- getEventNotif = sp.getBoolean("event_notif_get",false);
- if (getAudioNotif) {
- FirebaseMessaging.getInstance().subscribeToTopic("Notifications_For_Audio_Items");
- } else if (!getAudioNotif) {
- FirebaseMessaging.getInstance().unsubscribeFromTopic("Notifications_For_Audio_Items");
- }
- else if(getVideoNotif) {
- FirebaseMessaging.getInstance().subscribeToTopic("Notifications_For_Video_Items");
- }
- else if(!getVideoNotif) {
- FirebaseMessaging.getInstance().unsubscribeFromTopic("Notifications_For_Video_Items");
- }
- else if(getEventNotif) {
- FirebaseMessaging.getInstance().subscribeToTopic("Notifications_For_Event_Items");
- }
- else if(!getEventNotif) {
- FirebaseMessaging.getInstance().unsubscribeFromTopic("Notifications_For_Event_Items");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement