Skip to content

Commit

Permalink
Companion Object settings made.
Browse files Browse the repository at this point in the history
  • Loading branch information
halilozel1903 committed Nov 28, 2022
1 parent f2c3959 commit 5277d57
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.veripark.buildvariantapp

import android.annotation.SuppressLint
import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
Expand All @@ -12,10 +13,6 @@ import com.google.firebase.messaging.RemoteMessage

class MyFirebaseMessagingService : FirebaseMessagingService() {

companion object {
private const val TAG = "FirebaseMessagingService"
}

override fun onNewToken(token: String) {
super.onNewToken(token)
println("Token : $token")
Expand All @@ -28,6 +25,7 @@ class MyFirebaseMessagingService : FirebaseMessagingService() {
}
}

@SuppressLint("UnspecifiedImmutableFlag")
private fun showNotification(title: String?, body: String?) {
val intent = Intent(this, MainActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
Expand All @@ -49,4 +47,8 @@ class MyFirebaseMessagingService : FirebaseMessagingService() {
getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.notify(0, notificationBuilder.build())
}

companion object {
private const val TAG = "FirebaseMessagingService"
}
}

0 comments on commit 5277d57

Please sign in to comment.