|
|
@@ -63,7 +63,6 @@ public class FirebasePushService extends FirebaseMessagingService {
|
|
|
|
|
|
SuperModelInit.instant(getApplicationContext());
|
|
|
|
|
|
-
|
|
|
// Check if message contains a data payload.
|
|
|
if (remoteMessage.getData().size() > 0) {
|
|
|
Log.d("APP# FirebasePushService | onMessageReceived", "|" + "Message data payload: " + remoteMessage.getData());
|
|
|
@@ -72,13 +71,12 @@ public class FirebasePushService extends FirebaseMessagingService {
|
|
|
|
|
|
Gson gson = new Gson();
|
|
|
JsonElement jsonElement = gson.toJsonTree(data);
|
|
|
+
|
|
|
PushBean bean = gson.fromJson(jsonElement, PushBean.class);
|
|
|
- Log.d("APP# FirebasePushService | onMessageReceived", "|" + bean.toJson());
|
|
|
|
|
|
if (null != bean && PushMessageManager.isAvailableCode(bean.getScreenCode())) {
|
|
|
- PushMessageManager manager = PushMessageManager.getStoredManager().addPushBean(bean);
|
|
|
- PushMessageManager.saveManager(manager);
|
|
|
- PushMessageBroker.getInstance().push(manager);
|
|
|
+ Log.d("APP# FirebasePushService | onMessageReceived", "|" + bean.toJson());
|
|
|
+ PushMessageManager.onRecived(bean);
|
|
|
|
|
|
// 노티를 표시할지 구분
|
|
|
if (PushMessageManager.isEventCode(bean.getScreenCode()) && SuperModel.getInstance().getPreferences().isPushEventEnabled()) {
|
|
|
@@ -133,7 +131,7 @@ public class FirebasePushService extends FirebaseMessagingService {
|
|
|
// Since android Oreo notification channel is needed.
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
|
NotificationChannel channel = new NotificationChannel(channelId,
|
|
|
- "Channel human readable title",
|
|
|
+ "Lifeplus Notification",
|
|
|
NotificationManager.IMPORTANCE_DEFAULT);
|
|
|
notificationManager.createNotificationChannel(channel);
|
|
|
}
|