Skip to content

Commit

Permalink
feat: 이런저런 인텐트 손보기
Browse files Browse the repository at this point in the history
  • Loading branch information
CChuYong committed Feb 10, 2024
1 parent d9caf1e commit 1c27f73
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/com/no5ing/bbibbi/DeepLinkActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class DeepLinkActivity : ComponentActivity() {

val mainIntent = intent
mainIntent.setClass(this, MainActivity::class.java)
mainIntent.flags = Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
mainIntent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
.or(Intent.FLAG_ACTIVITY_SINGLE_TOP)
.or(Intent.FLAG_ACTIVITY_NEW_TASK)
startActivity(mainIntent)
finish()

Expand Down
7 changes: 5 additions & 2 deletions app/src/main/java/com/no5ing/bbibbi/FirebaseService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ class FirebaseService : FirebaseMessagingService() {
Timber.d("[FirebaseService] onMessageReceived data: ${remoteMessage.data}")
remoteMessage.notification?.apply {
val intent = Intent(this@FirebaseService, MainActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
.or(Intent.FLAG_ACTIVITY_SINGLE_TOP)
.or(Intent.FLAG_ACTIVITY_NEW_TASK)
remoteMessage.data.forEach { (t, u) ->
Timber.d("Extra data: $t, $u")
putExtra(t, u)
}
}
val pendingIntent = PendingIntent
.getActivity(this@FirebaseService, 0, intent, PendingIntent.FLAG_IMMUTABLE)
.getActivity(this@FirebaseService, 0, intent, PendingIntent.FLAG_IMMUTABLE
.or(PendingIntent.FLAG_CANCEL_CURRENT))
val builder = NotificationCompat
.Builder(this@FirebaseService, channel_id)
.setSmallIcon(R.drawable.notification_icon)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/no5ing/bbibbi/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class MainActivity : ComponentActivity() {
}
deepLink?.let {
pendingDeepLinkDestination.value = it
return
}

val widgetExtraData = newIntent?.extras?.getString(WIDGET_DEEPLINK_KEY) ?: return
Expand Down

0 comments on commit 1c27f73

Please sign in to comment.