Advertisement
DaniyyelTouboul

Untitled

Oct 23rd, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.19 KB | None | 0 0
  1.  
  2.             SharedPreferences sp = getSharedPreferences("notifications",MODE_PRIVATE);
  3.             getAudioNotif = sp.getBoolean("audio_notif_get",false);
  4.             getVideoNotif = sp.getBoolean("video_notif_get",false);
  5.             getEventNotif = sp.getBoolean("event_notif_get",false);
  6.  
  7.             if (getAudioNotif) {
  8.                 FirebaseMessaging.getInstance().subscribeToTopic("Notifications_For_Audio_Items");
  9.             } else if (!getAudioNotif) {
  10.                 FirebaseMessaging.getInstance().unsubscribeFromTopic("Notifications_For_Audio_Items");
  11.             }
  12.             else if(getVideoNotif) {
  13.                 FirebaseMessaging.getInstance().subscribeToTopic("Notifications_For_Video_Items");
  14.             }
  15.             else if(!getVideoNotif) {
  16.                 FirebaseMessaging.getInstance().unsubscribeFromTopic("Notifications_For_Video_Items");
  17.             }
  18.             else if(getEventNotif) {
  19.                 FirebaseMessaging.getInstance().subscribeToTopic("Notifications_For_Event_Items");
  20.             }
  21.             else if(!getEventNotif) {
  22.                 FirebaseMessaging.getInstance().unsubscribeFromTopic("Notifications_For_Event_Items");
  23.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement