Skip to content

Conversation

kidinov
Copy link
Contributor

@kidinov kidinov commented Oct 3, 2025

WOOMOB-1411

Description

Adds the base infrastructure for local push notifications for Woo POS surveys. This PR creates two notification types:

  1. Potential users survey - targets merchants who haven't used POS yet

    • Title: "Thinking about in-person sales?"
    • Description: "Help us build tools you'd actually use. 2 minutes."
  2. Current users survey - targets merchants actively using POS

    • Title: "How's POS working for you?"
    • Description: "Share your experience in 2 minutes and help us improve."

The implementation includes:

  • New notification type enums for both survey types
  • Notification data classes with titles and descriptions
  • String resources for notification content
  • Precondition check worker updates to validate site before showing notifications
  • AppPrefs flags to track if notifications have been shown (one-time display)
  • LocalNotificationWorker updates to set flags when notifications are displayed

This PR does not include the triggering logic - that will be added in a follow-up PR.

Steps to reproduce

This is infrastructure only. No user-facing changes yet.

Testing information

  • Verify the code compiles successfully
  • Review the notification infrastructure follows existing patterns (Blaze notifications)
  • Confirm AppPrefs flags are properly integrated

The tests that have been performed

  • Build verification

  • Code review of infrastructure components

  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@kidinov kidinov changed the title [WOOMOB-1411] Add local notification infrastructure for Woo POS surveys [WOOMOB-1411][Woo POS][Surveys] Add local notification infrastructure for Woo POS surveys Oct 3, 2025
@kidinov kidinov requested a review from malinajirka October 3, 2025 13:50
@kidinov kidinov added this to the 23.5 milestone Oct 3, 2025
@kidinov kidinov marked this pull request as ready for review October 3, 2025 13:50
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 3, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commitcb64d74
Direct Downloadwoocommerce-wear-prototype-build-pr14694-cb64d74.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 3, 2025

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commitcb64d74
Direct Downloadwoocommerce-prototype-build-pr14694-cb64d74.apk

@codecov-commenter
Copy link

codecov-commenter commented Oct 3, 2025

Codecov Report

❌ Patch coverage is 11.36364% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.36%. Comparing base (11f28db) to head (cb64d74).
⚠️ Report is 8 commits behind head on trunk.

Files with missing lines Patch % Lines
...e/android/notifications/local/LocalNotification.kt 0.00% 20 Missing ⚠️
...oid/notifications/local/PreconditionCheckWorker.kt 0.00% 12 Missing ⚠️
...rc/main/kotlin/com/woocommerce/android/AppPrefs.kt 0.00% 4 Missing ⚠️
...oid/notifications/local/LocalNotificationWorker.kt 0.00% 2 Missing ⚠️
...ocommerce/android/ui/main/MainActivityViewModel.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #14694      +/-   ##
============================================
- Coverage     38.36%   38.36%   -0.01%     
- Complexity     9841     9842       +1     
============================================
  Files          2097     2097              
  Lines        116954   116993      +39     
  Branches      15651    15654       +3     
============================================
+ Hits          44873    44880       +7     
- Misses        67915    67948      +33     
+ Partials       4166     4165       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@malinajirka malinajirka self-assigned this Oct 6, 2025
Copy link
Contributor

@malinajirka malinajirka left a comment

Choose a reason for hiding this comment

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

Thanks LGTM, I've left one question.

<string name="local_notification_blaze_abandoned_campaign_reminder_title">Thinking about boosting your sales?</string>
<string name="local_notification_blaze_abandoned_campaign_reminder_description">Get your products seen by millions with Blaze and boost your sales</string>
<string name="local_notification_woo_pos_survey_potential_user_title">Thinking about in-person sales?</string>
<string name="local_notification_woo_pos_survey_potential_user_description">Help us build tools you\'d actually use. 2 minutes.</string>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this string correct? The "2 minutes" part feels out of place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Fixed the copy - ba0246c

@kidinov kidinov enabled auto-merge October 6, 2025 09:41
@kidinov kidinov merged commit 1e8f36d into trunk Oct 6, 2025
15 checks passed
@kidinov kidinov deleted the woomob-1411-woo-possurveys-prepare-for-sending-a-local-notification-that branch October 6, 2025 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants