Skip to content

Commit

Permalink
Enx verbiage (#975)
Browse files Browse the repository at this point in the history
* add enxnotificationText to env
* add verbiage
* formatting
* remove code not needed
* add needed code
* remove label
* Update mobile_resources_commit
* switched to use ENX_INAPP_TEXT
  • Loading branch information
mxMarkowitz committed Apr 15, 2022
1 parent 634d6af commit 3930b41
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ios/BT/ExposureManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ final class ExposureManager: NSObject {
let identifier = String.enxMigrationIdentifier
let content = UNMutableNotificationContent()
content.title = String.enxMigrationNotificationTitle.localized
content.body = String.enxMigrationNotificationContent.localized
content.body = String(ReactNativeConfig.env(for: .enxNotificationText))
//content.body = String.enxMigrationNotificationContent.localized
content.userInfo = [String.notificationUrlKey: "\(String.notificationUrlBasePath)"]
content.sound = .default

Expand Down
1 change: 1 addition & 0 deletions ios/BT/Extensions/Foundation/String+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ extension String {
static let hmackey = "HMAC_KEY"
static let regionCodes = "REGION_CODES"
static let dev = "DEV"
static let enxNotificationText = "ENX_NOTIFICATION_TEXT"

// Notifications
static let bluetoothNotificationTitle = "Bluetooth Off"
Expand Down
2 changes: 1 addition & 1 deletion mobile_resources_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9466165c85fc4c1499b912932c41289b5d1ced5d
1044389b5672dce75a18d7f61ae5bf70b5509118
6 changes: 4 additions & 2 deletions src/Home/EnxMigrationInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
} from "../styles"
import { Icons, Images } from "../assets"
import { SvgXml } from "react-native-svg"
import { useConfigurationContext } from "../configuration"

interface EnxMigrationInfoProps {
enxRegion: string
Expand All @@ -29,6 +30,7 @@ const EnxMigrationInfo: FunctionComponent<EnxMigrationInfoProps> = ({
enxRegion,
}) => {
const { t } = useTranslation()
const { enxNotificationText } = useConfigurationContext()
const onboardingUrl = `ens://onboarding?r=${enxRegion}`

const handleOnPress = async () => {
Expand All @@ -47,13 +49,13 @@ const EnxMigrationInfo: FunctionComponent<EnxMigrationInfoProps> = ({
<TouchableOpacity
style={style.shareContainer}
onPress={handleOnPress}
accessibilityLabel={t("home.migrate_enx")}
accessibilityLabel={enxNotificationText}
>
<View style={style.imageContainer}>
<Image source={Images.ExclamationInCircle} style={style.image} />
</View>
<View style={style.textContainer}>
<Text style={style.shareText}>{t("home.migrate_enx")}</Text>
<Text style={style.shareText}>{enxNotificationText}</Text>
</View>
<SvgXml
xml={Icons.ChevronRight}
Expand Down
2 changes: 2 additions & 0 deletions src/configuration/configurationContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const initialState: Configuration = {
emergencyPhoneNumber: "",
enableProductAnalytics: false,
enxRegion: "",
enxNotificationText:
"Click here to enable the new Exposure Notifications. In order to stay protected from COVID-19, you need to take this step. After that, this app can be safely deleted.",
externalCovidDataLabel: "home.covid_data",
externalCovidDataLink: null,
externalTravelGuidanceLink: null,
Expand Down
1 change: 1 addition & 0 deletions src/configuration/configurationInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface Configuration {
enableProductAnalytics: boolean
emergencyPhoneNumber: string
enxRegion: string
enxNotificationText: string
externalCovidDataLink: string | null // link to show external covid data link on main page
externalCovidDataLabel: string // custom label for external covid data, will default to "Covid Data"
externalTravelGuidanceLink: string | null // link to external travel guidence link on main page
Expand Down
4 changes: 4 additions & 0 deletions src/configuration/configurationProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ const ConfigurationProvider: FunctionComponent = ({ children }) => {

// Enx migration
const enxRegion = env.ENX_REGION || ""
const enxNotificationText =
env.ENX_INAPP_TEXT ||
"Click here to enable the new Exposure Notifications. In order to stay protected from COVID-19, you need to take this step. After that, this app can be safely deleted."

return (
<ConfigurationContext.Provider
Expand All @@ -116,6 +119,7 @@ const ConfigurationProvider: FunctionComponent = ({ children }) => {
displaySelfAssessment,
displayAgeVerification,
enableProductAnalytics,
enxNotificationText,
enxRegion,
emergencyPhoneNumber,
externalCovidDataLabel,
Expand Down
2 changes: 2 additions & 0 deletions src/factories/configurationContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export default Factory.define<Configuration>(() => ({
displayAgeVerification: false,
enableProductAnalytics: false,
enxRegion: "",
enxNotificationText:
"Click here to enable the new Exposure Notifications. In order to stay protected from COVID-19, you need to take this step. After that, this app can be safely deleted.",
externalCovidDataLabel: "home.covid_data",
externalCovidDataLink: null,
externalTravelGuidanceLink: null,
Expand Down

0 comments on commit 3930b41

Please sign in to comment.