Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
*** PLEASE FOLLOW THIS FORMAT: [<priority indicator, more stars = higher priority>] <description> [<PR URL>]
*** Use [*****] to indicate smoke tests of all critical flows should be run on the final APK before release (e.g. major library or targetSdk updates).
*** For entries which are touching the Android Wear app's, start entry with `[WEAR]` too.
23.6
-----
- [Internal][Woo POS] Survey for potential and current users of the POS delivered via local push notification. [https://github.com/woocommerce/woocommerce-android/pull/14751]


23.5
-----
- [Internal][Wear] Remove unused dependencies and optimize dependency scopes [https://github.com/woocommerce/woocommerce-android/pull/14710]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.woocommerce.android.notifications.local
enum class LocalNotificationType(val value: String) {
BLAZE_NO_CAMPAIGN_REMINDER("blaze_no_campaign_reminder"),
BLAZE_ABANDONED_CAMPAIGN_REMINDER("blaze_abandoned_campaign_reminder"),
WOO_POS_SURVEY_POTENTIAL_USER_REMINDER("woo_pos_survey_potential_user_reminder"),
WOO_POS_SURVEY_CURRENT_USER_REMINDER("woo_pos_survey_current_user_reminder");
WOO_POS_SURVEY_POTENTIAL_USER_REMINDER("woo_pos_survey_potential_user_survey"),
WOO_POS_SURVEY_CURRENT_USER_REMINDER("woo_pos_survey_current_user_survey");
override fun toString() = value

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import com.woocommerce.android.notifications.local.LocalNotification
import com.woocommerce.android.notifications.local.LocalNotificationScheduler
import com.woocommerce.android.tools.SelectedSite
import com.woocommerce.android.ui.woopos.util.datastore.WooPosPreferencesRepository
import com.woocommerce.android.util.FeatureFlag
import kotlinx.coroutines.flow.first
import org.wordpress.android.fluxc.store.WooCommerceStore
import java.util.concurrent.TimeUnit
Expand All @@ -26,7 +25,7 @@ class WooPosSurveysNotificationScheduler @Inject constructor(
suspend fun schedulePotentialUserSurveyNotification() {
if (!appPrefs.isWooPosSurveyNotificationPotentialUserShown &&
!wooPosPreferencesRepository.wasOpenedOnce.first() &&
areNotificationsAllowed()
isAllowedCountry()
) {
localNotificationScheduler.scheduleNotification(
LocalNotification.WooPosSurveyPotentialUserNotification(
Expand All @@ -39,7 +38,7 @@ class WooPosSurveysNotificationScheduler @Inject constructor(
suspend fun scheduleCurrentUserSurveyNotification() {
if (!appPrefs.isWooPosSurveyNotificationCurrentUserShown &&
wooPosPreferencesRepository.wasOpenedOnce.first() &&
areNotificationsAllowed()
isAllowedCountry()
) {
localNotificationScheduler.scheduleNotification(
LocalNotification.WooPosSurveyCurrentUserNotification(
Expand All @@ -50,9 +49,6 @@ class WooPosSurveysNotificationScheduler @Inject constructor(
}
}

private suspend fun areNotificationsAllowed(): Boolean =
isAllowedCountry() && FeatureFlag.WOO_POS_SURVEYS.isEnabled()

private suspend fun isAllowedCountry(): Boolean {
val countryCode = wooCommerceStore.getSiteSettingsAsync(selectedSite.get())?.countryCode
return countryCode?.lowercase() in ALLOWED_COUNTRIES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ enum class FeatureFlag {
WC_SHIPPING_BANNER,
BETTER_CUSTOMER_SEARCH_M2,
ORDER_CREATION_AUTO_TAX_RATE,
WOO_POS_SURVEYS,
WOO_POS_HISTORICAL_ORDERS_M1,
WOO_POS_LOCAL_CATALOG_M1,
BOOKINGS_MVP;
Expand All @@ -23,7 +22,6 @@ enum class FeatureFlag {

WOO_POS_HISTORICAL_ORDERS_M1,
WC_SHIPPING_BANNER,
WOO_POS_SURVEYS,
BETTER_CUSTOMER_SEARCH_M2,
ORDER_CREATION_AUTO_TAX_RATE,
WOO_POS_LOCAL_CATALOG_M1,
Expand Down