Esempio n. 1
0
  private void handleNotifications() {
    // Make sure that we have instance of the Discussion object
    if (discussionObject == null) {
      return;
    }

    /**
     * ************ A new message was added to an existing discussion - we want to send notification
     * according to discussionsImIn **********
     */
    ParseQuery pushQuery = ParseInstallation.getQuery();

    // Get queries of devices that should get the notification
    pushQuery = ReliNotifications.getQueryAccordingToDiscussion(pushQuery, discussionTableName);

    // Get the list of devices that should be excluded
    pushQuery = ReliNotifications.getQueryExcludedCurrentUser(pushQuery);

    // Send push notification
    ReliNotifications.sendNotifications(
        pushQuery,
        MainActivity.user.getFullName()
            + " "
            + getString(R.string.notification_new_message_part_1)
            + " "
            + discussionObject.getDiscussionName()
            + " "
            + getString(R.string.notification_new_message_part_2));
  }