Skip to content

Commit

Permalink
Merge pull request #1 from maniac-tech/react-native-expo-read-sms__test
Browse files Browse the repository at this point in the history
Test app for `@maniac-tech/react-native-expo-read-sms`
  • Loading branch information
maniac-tech authored Jul 3, 2022
2 parents 8ec0f61 + f34fcb3 commit 5bd82a6
Show file tree
Hide file tree
Showing 6 changed files with 14,789 additions and 10,872 deletions.
43 changes: 38 additions & 5 deletions App.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,45 @@
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
import { Button, StyleSheet, Text, View } from 'react-native';
import { Provider as PaperProvider } from 'react-native-paper';

import useApp from './useApp';

const PermissionStatus = ({ READ_SMS_PERMISSION_STATUS, RECEIVE_SMS_PERMISSION_STATUS }) => {
console.log('READ_SMS_PERMISSION_STATUS, RECEIVE_SMS_PERMISSION_STATUS:', READ_SMS_PERMISSION_STATUS, RECEIVE_SMS_PERMISSION_STATUS)
return <>
<Text>READ_SMS:{READ_SMS_PERMISSION_STATUS + '' || 'null'}</Text>
<Text>RECEIVE_SMS:{RECEIVE_SMS_PERMISSION_STATUS + '' || 'null'}</Text>
</>;
};

export default function App() {
const {
appState,
buttonClickHandler,
errorCallbackStatus,
hasReceiveSMSPermission,
hasReadSMSPermission,
smsPermissionState,
successCallbackStatus,
smsValue,
smsError
} = useApp();

return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<StatusBar style="auto" />
</View>
<PaperProvider>
<View style={styles.container}>
<StatusBar style="auto" />
<Text>ExpoReadSMS - Test Application (Expo)</Text>
<Text>App State:{appState}</Text>
<PermissionStatus
READ_SMS_PERMISSION_STATUS={hasReadSMSPermission}
RECEIVE_SMS_PERMISSION_STATUS={hasReceiveSMSPermission} />
<Text>smsPermissionState:{smsPermissionState + '' || 'null'}</Text>
<Text>smsValue:{smsValue + '' || 'null'}</Text>
<Text>smsError:{smsError + '' || 'null'}</Text>
<Button onPress={buttonClickHandler} title="start" />
</View>
</PaperProvider>
);
}

Expand Down
9 changes: 7 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
}
},
"package": "com.maniactech.exporeadsmstest",
"permissions": [
"android.permission.READ_SMS",
"android.permission.RECEIVE_SMS"
]
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
}
18 changes: 18 additions & 0 deletions eas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"cli": {
"version": ">= 0.54.1"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"distribution": "internal"
},
"production": {}
},
"submit": {
"production": {}
}
}
Loading

0 comments on commit 5bd82a6

Please sign in to comment.