Skip to content

Commit

Permalink
Clean up unnecessary GCM stuff, improve FCM logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
greyson-signal committed Feb 2, 2021
1 parent 857b945 commit 53177bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Expand Up @@ -64,7 +64,6 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>

<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

<!-- So we can add a TextSecure 'Account' -->
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
Expand Down
Expand Up @@ -18,9 +18,10 @@ public class FcmReceiveService extends FirebaseMessagingService {

private static final String TAG = FcmReceiveService.class.getSimpleName();


@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Log.i(TAG, "onMessageReceived() ID: " + remoteMessage.getMessageId() + ", Delay: " + (System.currentTimeMillis() - remoteMessage.getSentTime()));
Log.i(TAG, "onMessageReceived() ID: " + remoteMessage.getMessageId() + ", Delay: " + (System.currentTimeMillis() - remoteMessage.getSentTime()) + ", Original Priority: " + remoteMessage.getOriginalPriority());

String challenge = remoteMessage.getData().get("challenge");
if (challenge != null) {
Expand Down Expand Up @@ -48,6 +49,16 @@ public void onNewToken(String token) {
ApplicationDependencies.getJobManager().add(new FcmRefreshJob());
}

@Override
public void onMessageSent(@NonNull String s) {
Log.i(TAG, "onMessageSent()" + s);
}

@Override
public void onSendError(@NonNull String s, @NonNull Exception e) {
Log.w(TAG, "onSendError()", e);
}

private static void handleReceivedNotification(Context context) {
try {
context.startService(new Intent(context, FcmFetchService.class));
Expand Down

0 comments on commit 53177bf

Please sign in to comment.