Skip to content

fix: open app on notification tap even when autoHandleLandingURL is false - #27

Merged
gunoooo merged 3 commits into
mainfrom
CLIX-176
Apr 1, 2026
Merged

gunoooo merged 3 commits into
mainfrom
CLIX-176

Conversation

@gunoooo

@gunoooo gunoooo commented Mar 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • autoHandleLandingURL = false일 때 알림을 탭하면 앱이 열리지 않는 문제 수정
  • iOS에서는 OS가 알림 탭 시 앱을 foreground로 올려주지만, Android에서는 SDK가 직접 앱을 열어야 함. 이 로직이 autoHandleLandingURL 플래그에 같이 묶여 있어서 false일 때 앱 자체가 열리지 않았음
  • deep link 네비게이션은 기존대로 autoHandleLandingURL에 의해 제어되고, 앱 열기는 항상 동작하도록 변경

Test plan

  • autoHandleLandingURL = false로 설정 후 알림 탭 → 앱이 열리는지 확인
  • autoHandleLandingURL = true + landing URL 있음 → 기존대로 deep link 네비게이션 동작 확인
  • autoHandleLandingURL = true + landing URL 없음 → 앱 메인 화면 열림 확인
  • autoHandleLandingURL = false + onNotificationOpened 핸들러 등록 → 핸들러 호출 + 앱 열림 확인

Fixes CLIX-176

Summary by CodeRabbit

  • Bug Fixes

    • Notification taps now reliably open the app even when automatic landing navigation is disabled.
    • Adds a fallback app launch on tap and safer error logging to reduce silent failures.
  • Chores

    • Release notes updated for version 1.5.1.

…alse

When autoHandleLandingURL was set to false, tapping a notification would
only track the event but not open the app — the transparent
NotificationTappedActivity would finish() without starting any activity.

On iOS, the OS brings the app to the foreground on notification tap, so
autoHandleLandingURL only controls deep link navigation. On Android, the
SDK must explicitly launch the app, which was gated behind the same flag.

Now, when autoHandleLandingURL is false, the SDK skips deep link
navigation but still opens the app via getLaunchIntentForPackage().

Fixes CLIX-176
@coderabbitai

coderabbitai Bot commented Mar 31, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 52b326a7-b565-42f4-bd00-74d0d9b0ef0e

📥 Commits

Reviewing files that changed from the base of the PR and between b3c6f04 and 129b28c.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • gradle/libs.versions.toml
✅ Files skipped from review due to trivial changes (2)
  • gradle/libs.versions.toml
  • CHANGELOG.md

Walkthrough

Notification tap handling now launches the app when automatic landing-URL navigation is disabled; added an openApp(context) helper that resolves and starts the app launch intent with FLAG_ACTIVITY_NEW_TASK, and logs warnings/errors if resolution or start fails.

Changes

Cohort / File(s) Summary
Notification App Launch Handler
clix/src/main/kotlin/so/clix/core/ClixNotification.kt
Added conditional app-launch on notification tap when auto-open landing URL is disabled; introduced openApp(context) to resolve package launch intent, add Intent.FLAG_ACTIVITY_NEW_TASK, start the activity, and log warning/error cases.
Changelog
CHANGELOG.md
Added release note for version 1.5.1 documenting push notification behavior: notification taps open the app even when autoHandleLandingURL is false and fallback behavior when no onNotificationOpened handler is present.
Version Bump
gradle/libs.versions.toml
Bumped clix package version from 1.5.0 to 1.5.1.

Possibly related PRs

Suggested reviewers

  • nyanxyz
  • JeongwooYoo
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main bug fix: opening the app on notification tap when autoHandleLandingURL is false, which directly matches the primary change across all modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch CLIX-176

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
coderabbitai Bot requested a review from nyanxyz March 31, 2026 09:15

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ace6c56196

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

ClixLogger.debug(
"Auto open disabled, skipping landing navigation for ${payload.messageId}"
)
openApp(context)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid forcing launcher after custom tap handler

When autoHandleLandingURL is disabled, this new unconditional openApp(context) runs after onNotificationOpened executes, which can override app-defined routing. The README’s custom-handling flow relies on opening a destination from the callback, but starting the launcher immediately afterward can bring the main activity to the top and hide the screen the handler just opened. This regresses the primary autoHandleLandingURL = false use case for apps that implement manual deep-link navigation in onNotificationOpened.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
clix/src/main/kotlin/so/clix/core/ClixNotification.kt (1)

304-312: ⚠️ Potential issue | 🟠 Major

Fallback to app launch when landing navigation fails.

When auto-open is enabled, openLandingURLIfPresent(...) can return false, but that result is ignored. In that case, notification tap can still end without opening the app.

🔧 Proposed fix
-        val shouldAutoOpen = autoHandleLandingURL && notificationContext.autoOpenLandingURL
-        if (shouldAutoOpen) {
-            openLandingURLIfPresent(context, payload.landingUrl)
-        } else {
-            ClixLogger.debug(
-                "Auto open disabled, skipping landing navigation for ${payload.messageId}"
-            )
-            openApp(context)
-        }
+        val shouldAutoOpen = autoHandleLandingURL && notificationContext.autoOpenLandingURL
+        val openedLanding = shouldAutoOpen && openLandingURLIfPresent(context, payload.landingUrl)
+        if (!openedLanding) {
+            if (!shouldAutoOpen) {
+                ClixLogger.debug(
+                    "Auto open disabled, skipping landing navigation for ${payload.messageId}"
+                )
+            } else {
+                ClixLogger.warn(
+                    "Landing navigation failed, falling back to app launch for ${payload.messageId}"
+                )
+            }
+            openApp(context)
+        }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@clix/src/main/kotlin/so/clix/core/ClixNotification.kt` around lines 304 -
312, The code currently calls openLandingURLIfPresent(context,
payload.landingUrl) when shouldAutoOpen is true but ignores its Boolean result;
if it returns false the app isn't opened. Change the branch so that when
shouldAutoOpen is true you capture the result of openLandingURLIfPresent(...)
and, if it returns false, call openApp(context) as a fallback; keep the existing
else branch for the disabled case and preserve the ClixLogger.debug message when
auto-open is disabled. Ensure you reference openLandingURLIfPresent, openApp,
shouldAutoOpen, payload.landingUrl, and notificationContext.autoOpenLandingURL
when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@clix/src/main/kotlin/so/clix/core/ClixNotification.kt`:
- Around line 304-312: The code currently calls openLandingURLIfPresent(context,
payload.landingUrl) when shouldAutoOpen is true but ignores its Boolean result;
if it returns false the app isn't opened. Change the branch so that when
shouldAutoOpen is true you capture the result of openLandingURLIfPresent(...)
and, if it returns false, call openApp(context) as a fallback; keep the existing
else branch for the disabled case and preserve the ClixLogger.debug message when
auto-open is disabled. Ensure you reference openLandingURLIfPresent, openApp,
shouldAutoOpen, payload.landingUrl, and notificationContext.autoOpenLandingURL
when making the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 61997e2e-0162-4014-873a-c4c34b9754a0

📥 Commits

Reviewing files that changed from the base of the PR and between 883d68d and ace6c56.

📒 Files selected for processing (1)
  • clix/src/main/kotlin/so/clix/core/ClixNotification.kt

박건우 added 2 commits April 1, 2026 13:19
Avoid launching the main activity after a custom tap handler has already
run, which could override app-defined routing.
@gunoooo
gunoooo merged commit 0c065d4 into main Apr 1, 2026
3 checks passed
@gunoooo
gunoooo deleted the CLIX-176 branch April 1, 2026 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant