From 73ae21c8cb22a8e1d9556fbb8eb015bd1f547aa7 Mon Sep 17 00:00:00 2001 From: Rehan Date: Tue, 25 Jul 2023 13:45:37 +0500 Subject: [PATCH 1/5] fix: removed unnecessary validations --- Apps/APN/src/screens/Attributes.js | 26 -------------------------- Apps/APN/src/screens/CustomEvent.js | 24 ------------------------ 2 files changed, 50 deletions(-) diff --git a/Apps/APN/src/screens/Attributes.js b/Apps/APN/src/screens/Attributes.js index e2d43d10..d16ef51f 100644 --- a/Apps/APN/src/screens/Attributes.js +++ b/Apps/APN/src/screens/Attributes.js @@ -36,33 +36,7 @@ const Attributes = ({ route }) => { throw new Error(`Invalid screen prop: ${screen}.`); } - const isFormValid = () => { - let message; - let emptyFieldMessageBuilder = (fieldName) => { - return `${fieldName} cannot be empty`; - }; - - if (!attributeName) { - message = emptyFieldMessageBuilder('Attribute Name'); - } else if (!attributeValue) { - message = emptyFieldMessageBuilder('Attribute Value'); - } - - if (message) { - Prompts.showAlert({ - title: 'Error', - message: message, - }); - return false; - } - return true; - }; - const handleSendPress = () => { - if (!isFormValid()) { - return; - } - switch (screen) { case Screen.DEVICE_ATTRIBUTES: trackDeviceAttribute(attributeName, attributeValue); diff --git a/Apps/APN/src/screens/CustomEvent.js b/Apps/APN/src/screens/CustomEvent.js index 5595e240..6517ee08 100644 --- a/Apps/APN/src/screens/CustomEvent.js +++ b/Apps/APN/src/screens/CustomEvent.js @@ -13,31 +13,7 @@ const CustomEvent = () => { const [propertyName, setPropertyName] = useState(''); const [propertyValue, setPropertyValue] = useState(''); - const isFormValid = () => { - let message; - let emptyFieldMessageBuilder = (fieldName) => { - return `${fieldName} cannot be empty`; - }; - - if (!eventName) { - message = emptyFieldMessageBuilder('Event Name'); - } - - if (message) { - Prompts.showAlert({ - title: 'Error', - message: message, - }); - return false; - } - return true; - }; - const handleSendPress = () => { - if (!isFormValid()) { - return; - } - trackEvent(eventName, propertyName, propertyValue); Prompts.showSnackbar({ text: 'Event sent successfully' }); }; From a24fdf9b7d8dbb49b1865c2be77fa024e379361d Mon Sep 17 00:00:00 2001 From: Rehan Date: Tue, 25 Jul 2023 13:51:01 +0500 Subject: [PATCH 2/5] fixed random event time --- Apps/APN/src/screens/Dashboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Apps/APN/src/screens/Dashboard.js b/Apps/APN/src/screens/Dashboard.js index e1c3dc3d..c73b521e 100644 --- a/Apps/APN/src/screens/Dashboard.js +++ b/Apps/APN/src/screens/Dashboard.js @@ -42,7 +42,7 @@ const Dashboard = ({ navigation }) => { eventName = 'appointmentScheduled'; propertyName = 'appointmentTime'; - propertyValue = appointmentTime.getTime() / 1000; + propertyValue = Math.round(appointmentTime.getTime() / 1000); break; case 2: From d34ce3f9e6a3949104b6ea6c9f3338042c0b94ee Mon Sep 17 00:00:00 2001 From: Rehan Date: Tue, 25 Jul 2023 13:56:50 +0500 Subject: [PATCH 3/5] pod updated --- Apps/APN/ios/Podfile.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Apps/APN/ios/Podfile.lock b/Apps/APN/ios/Podfile.lock index 770b1c7f..4142bbe8 100644 --- a/Apps/APN/ios/Podfile.lock +++ b/Apps/APN/ios/Podfile.lock @@ -1,18 +1,18 @@ PODS: - boost (1.76.0) - - customerio-reactnative (3.1.5): - - customerio-reactnative/nopush (= 3.1.5) + - customerio-reactnative (3.1.6): + - customerio-reactnative/nopush (= 3.1.6) - CustomerIO/MessagingInApp (= 2.7.4) - CustomerIO/Tracking (= 2.7.4) - React-Core - - customerio-reactnative-richpush/apn (3.1.5): + - customerio-reactnative-richpush/apn (3.1.6): - CustomerIO/MessagingPushAPN (= 2.7.4) - - customerio-reactnative/apn (3.1.5): + - customerio-reactnative/apn (3.1.6): - CustomerIO/MessagingInApp (= 2.7.4) - CustomerIO/MessagingPushAPN (= 2.7.4) - CustomerIO/Tracking (= 2.7.4) - React-Core - - customerio-reactnative/nopush (3.1.5): + - customerio-reactnative/nopush (3.1.6): - CustomerIO/MessagingInApp (= 2.7.4) - CustomerIO/Tracking (= 2.7.4) - React-Core @@ -545,8 +545,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: a7c83b31436843459a1961bfd74b96033dc77234 CustomerIO: fc932c67b92a71cb25edc4699d1bbfcbd74aa960 - customerio-reactnative: 8f3913c1251ecfb7e0c62ce235824a95a4ec8a51 - customerio-reactnative-richpush: 5d991f0b018db8d098c29f2ccadf7585f45f04cf + customerio-reactnative: 903f1ac499962a6b34518d9fcb15ff709b2eea5c + customerio-reactnative-richpush: 59c7b5c08aaa7f9e7f6e34c3efcbd1c011d79bea CustomerIOCommon: d26701acf4ffa6e7dfff82d5a4902d9ab034fec5 CustomerIOMessagingInApp: 431a7033a25292c09f8adc8c8e65ddd482ad7932 CustomerIOMessagingPush: c24b9cc5babcd5a707c9d2c5f66deb236a976fe0 From 4112f17491855fc2777d9d524af5d4a8d52fa901 Mon Sep 17 00:00:00 2001 From: Rehan Date: Tue, 25 Jul 2023 14:19:04 +0500 Subject: [PATCH 4/5] fixes safeareaview --- Apps/APN/App.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Apps/APN/App.js b/Apps/APN/App.js index 2a24afed..4c351663 100644 --- a/Apps/APN/App.js +++ b/Apps/APN/App.js @@ -1,5 +1,5 @@ import React, { useCallback, useEffect, useState } from 'react'; -import { ActivityIndicator } from 'react-native'; +import { ActivityIndicator, SafeAreaView, StyleSheet } from 'react-native'; import CustomerIoSDKConfig from './src/data/sdk/CustomerIoSDKConfig'; import AppNavigator from './src/navigation/AppNavigator'; import { @@ -106,8 +106,16 @@ export default function App() { return ( - + + + ); } + +const styles = StyleSheet.create({ + container: { + flex: 1, + }, +}); From 374580faa17f74559349ed80ed13c46e9fd02384 Mon Sep 17 00:00:00 2001 From: Rehan Date: Tue, 25 Jul 2023 14:42:23 +0500 Subject: [PATCH 5/5] hint color in dark mode --- Apps/APN/src/components/TextField.js | 1 + Apps/APN/src/constants/Colors.js | 1 + 2 files changed, 2 insertions(+) diff --git a/Apps/APN/src/components/TextField.js b/Apps/APN/src/components/TextField.js index 7381fc78..e169dc2a 100644 --- a/Apps/APN/src/components/TextField.js +++ b/Apps/APN/src/components/TextField.js @@ -89,6 +89,7 @@ export const TextField = ({ onSubmitEditing={onSubmitEditing} returnKeyType={returnKeyType} accessibilityLabel={contentDesc} + placeholderTextColor={Colors.INPUT_FIELD_HINT_COLOR} {...textInputProps} /> {leadingIconImageSource && ( diff --git a/Apps/APN/src/constants/Colors.js b/Apps/APN/src/constants/Colors.js index a481e10c..b3406300 100644 --- a/Apps/APN/src/constants/Colors.js +++ b/Apps/APN/src/constants/Colors.js @@ -2,6 +2,7 @@ export const PRIMARY_COLOR = '#3C437D'; export const SECONDARY_COLOR = '#7131FF'; export const CONTAINER_BACKGROUND_COLOR = '#FFFFFF'; export const INPUT_FIELD_BORDER_COLOR = 'rgba(0, 0, 0, 0.12)'; +export const INPUT_FIELD_HINT_COLOR = 'rgba(0, 0, 0, 0.12)'; export const SWITCH_THUMB_COLOR_ON = '#FFFFFF'; export const SWITCH_THUMB_COLOR_OFF = '#F3F3F3'; export const SWITCH_TRACK_COLOR_ON = '#34C759';