From bcc12bbbda73495e1a04415408cff97debcfc6e0 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 9 Jun 2026 11:06:41 +0000 Subject: [PATCH] Fix legacy (no-wv) Feedback widget close on mobile Legacy NPS and Rating widgets (those without a wv parameter) sent their close signal via postMessage even on mobile, where the SDK only intercepts URL navigation -- so the close button did nothing on Android/iOS. Make the no-wv branch trigger a real navigation to https://countly_action_event?cly_widget_command=1&close=1 on mobile, matching the modern (wv) widgets, while preserving the existing web postMessage behaviour for legacy widgets. https://claude.ai/code/session_015nUig7QXdAEYMhS16eSsu1 --- .../frontend/public/templates/feedback-popup.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/star-rating/frontend/public/templates/feedback-popup.html b/plugins/star-rating/frontend/public/templates/feedback-popup.html index 5005901b85f..fd010c33b9f 100644 --- a/plugins/star-rating/frontend/public/templates/feedback-popup.html +++ b/plugins/star-rating/frontend/public/templates/feedback-popup.html @@ -718,7 +718,12 @@ } } else { - if (window.parent && typeof window.parent.postMessage === 'function') { + if (platform !== 'Web') { + // Legacy widgets (no wv) on mobile must trigger a real navigation so the + // mobile SDK can intercept and close. postMessage is only for the web SDK. + window.location.href = 'https://countly_action_event?cly_widget_command=1&close=1'; + } + else if (window.parent && typeof window.parent.postMessage === 'function') { var d = JSON.stringify({ close: true }); window.parent.postMessage(d, parentOrigin); }