mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2026-01-18 14:36:40 +00:00
fix flavors
This commit is contained in:
parent
cd55669524
commit
7c66ad94ae
@ -146,9 +146,9 @@ dependencies {
|
||||
annotationProcessor "frankiesardo:icepick-processor:${icepickVersion}"
|
||||
annotationProcessor "com.jakewharton:butterknife-compiler:${butterKnifeVersion}"
|
||||
provided "org.projectlombok:lombok:${lombokVersion}"
|
||||
gmsCompile "com.google.firebase:firebase-ads:${firebase}"
|
||||
gmsCompile "com.google.firebase:firebase-messaging:${firebase}"
|
||||
if (isGms) {
|
||||
compile "com.google.firebase:firebase-ads:${firebase}"
|
||||
compile "com.google.firebase:firebase-messaging:${firebase}"
|
||||
releaseCompile "com.google.firebase:firebase-crash:${firebase}"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,40 +0,0 @@
|
||||
package com.fastaccess.provider.fcm;
|
||||
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
|
||||
import com.fastaccess.R;
|
||||
import com.fastaccess.ui.modules.main.MainActivity;
|
||||
import com.google.firebase.messaging.FirebaseMessagingService;
|
||||
import com.google.firebase.messaging.RemoteMessage;
|
||||
|
||||
/**
|
||||
* Created by Kosh on 16 Apr 2017, 1:17 PM
|
||||
*/
|
||||
|
||||
public class PushNotificationService extends FirebaseMessagingService {
|
||||
|
||||
@Override public void onMessageReceived(RemoteMessage remoteMessage) {
|
||||
super.onMessageReceived(remoteMessage);
|
||||
String title = remoteMessage.getNotification().getTitle();
|
||||
String body = remoteMessage.getNotification().getBody();
|
||||
if (remoteMessage.getData() != null && !remoteMessage.getData().isEmpty()) {
|
||||
title = title == null ? remoteMessage.getData().get("title") : title;
|
||||
body = body == null ? remoteMessage.getData().get("message") : body;
|
||||
}
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);
|
||||
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
|
||||
.setSmallIcon(R.drawable.ic_notification)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent);
|
||||
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
notificationManager.notify(1, notificationBuilder.build());
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user