- * Modify this method to associate the user's FCM InstanceID token with any server-side account
- * maintained by your application.
- *
- * @param token The new token.
- */
private void sendRegistrationToServer(String token) {
// This method is blank, but if you were to build a server that stores users token
// information, this is where you'd send the token to the server.
diff --git a/app/src/main/java/android/example/com/squawker/fcm/SquawkFirebaseMessageService.java b/app/src/main/java/android/example/com/squawker/fcm/SquawkFirebaseMessageService.java
index 9c868dbe..f8cbf2c2 100644
--- a/app/src/main/java/android/example/com/squawker/fcm/SquawkFirebaseMessageService.java
+++ b/app/src/main/java/android/example/com/squawker/fcm/SquawkFirebaseMessageService.java
@@ -1,18 +1,19 @@
/*
-* Copyright (C) 2017 The Android Open Source Project
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package android.example.com.squawker.fcm;
import android.app.NotificationManager;
@@ -27,9 +28,10 @@
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.AsyncTask;
-import android.support.v4.app.NotificationCompat;
import android.util.Log;
+import androidx.core.app.NotificationCompat;
+
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
@@ -57,22 +59,6 @@ public class SquawkFirebaseMessageService extends FirebaseMessagingService {
*/
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
- // There are two types of messages data messages and notification messages. Data messages
- // are handled
- // here in onMessageReceived whether the app is in the foreground or background. Data
- // messages are the type
- // traditionally used with FCM. Notification messages are only received here in
- // onMessageReceived when the app
- // is in the foreground. When the app is in the background an automatically generated
- // notification is displayed.
- // When the user taps on the notification they are returned to the app. Messages
- // containing both notification
- // and data payloads are treated as notification messages. The Firebase console always
- // sends notification
- // messages. For more see: https://firebase.google.com/docs/cloud-messaging/concept-options\
-
- // The Squawk server always sends just *data* messages, meaning that onMessageReceived when
- // the app is both in the foreground AND the background
Log.d(LOG_TAG, "From: " + remoteMessage.getFrom());
@@ -99,9 +85,8 @@ private void insertSquawk(final Map