From 8b322fb751ef6f14aee2316d7b8748202badf03a Mon Sep 17 00:00:00 2001 From: Pankaj Negi Date: Tue, 14 May 2019 10:43:32 +0530 Subject: [PATCH 1/5] Slider Library Changes and Alert --- App/Components/ImageViewer.js | 41 ++++++++++++++++++++++++-- App/Components/SliderItem.js | 44 ++++++++++++++++++++++++++++ App/Components/sliderEntry.js | 10 +++++-- App/Containers/EventsList.js | 4 +-- App/Containers/FeedbackDetail.js | 14 ++++++++- package-lock.json | 49 +++++++++++++------------------- package.json | 1 + 7 files changed, 125 insertions(+), 38 deletions(-) create mode 100644 App/Components/SliderItem.js diff --git a/App/Components/ImageViewer.js b/App/Components/ImageViewer.js index 1829c49..8111b13 100644 --- a/App/Components/ImageViewer.js +++ b/App/Components/ImageViewer.js @@ -1,14 +1,18 @@ import React, { Component } from 'react'; -import { Platform, View, ScrollView, Text, StatusBar, SafeAreaView } from 'react-native'; +import { Platform, View, ScrollView, Text, StatusBar, SafeAreaView, Dimensions } from 'react-native'; import Carousel, { Pagination } from 'react-native-snap-carousel'; import { sliderWidth, itemWidth } from './Styles/SliderEntryStyle'; import SliderEntry from './sliderEntry'; import styles, { colors } from './Styles/ImageViewerStyle'; import { scrollInterpolators, animatedStyles } from '../Lib/animation'; +import Slick from 'react-native-slick'; +import SliderItem from './SliderItem'; const IS_ANDROID = Platform.OS === 'android'; const SLIDER_1_FIRST_ITEM = 1; +const ScreenWidth = Dimensions.get('window').width; + export default class ImageViewerComponent extends Component { constructor (props) { @@ -83,13 +87,44 @@ export default class ImageViewerComponent extends Component { ); } + renderSlickSlider(){ + const { data } = this.props; + return ( + } + activeDot={} + paginationStyle={{ + bottom: 20 + }} + loop={true} + autoplay={true} + autoplayTimeout={5.0}> + { + data.map((imageData, i) => + this.imageClicked}> + ) + } + + + ) + } + imageClicked = (image, keyValue) => { + //alert("Hello Testing .... ", keyValue); + console.log("Hello Testing..."); + this.props.onFullScreenEvent(); + } render () { - const carousel = this.mainExample(1, 'Default layout | Loop | Autoplay | Parallax | Scale | Opacity | Pagination with tappable dots'); + const carousel = this.renderSlickSlider(); //this.mainExample(1, 'Default layout | Loop | Autoplay | Parallax | Scale | Opacity | Pagination with tappable dots'); const { data } = this.props; + console.log("Data..... ", this.props); return ( - + {data && data.length ? carousel : null} ); diff --git a/App/Components/SliderItem.js b/App/Components/SliderItem.js new file mode 100644 index 0000000..9ec6077 --- /dev/null +++ b/App/Components/SliderItem.js @@ -0,0 +1,44 @@ +import React, { Component } from 'react'; +import { View, Dimensions, Image, PixelRatio, Text, TouchableWithoutFeedback } from 'react-native'; + +// Create a component +let ScreenWidth = Dimensions.get("window").width; + +class SliderItem extends Component { + + constructor(props){ + super(props); + } + + render(){ + return ( + + + + + + ); + } +} + +export default SliderItem; + +const styles = { + containerStyle: { + flex:1, + justifyContent: 'center', + alignItems:'center', + + }, +}; + +export { SliderItem }; \ No newline at end of file diff --git a/App/Components/sliderEntry.js b/App/Components/sliderEntry.js index ecbfa52..cdbeb72 100644 --- a/App/Components/sliderEntry.js +++ b/App/Components/sliderEntry.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { View, Text, Image, TouchableOpacity } from 'react-native'; +import { View, Text, Image, TouchableOpacity, TouchableWithoutFeedback } from 'react-native'; import PropTypes from 'prop-types'; import { ParallaxImage } from 'react-native-snap-carousel'; import styles from './Styles/SliderEntryStyle' @@ -28,6 +28,11 @@ export default class SliderEntry extends Component { ); } + imageClicked(){ + alert("Hello Testing.... "); + } + + render () { const { data, even } = this.props; @@ -37,7 +42,8 @@ export default class SliderEntry extends Component { style={styles.slideInnerContainer} > - + { this.image } diff --git a/App/Containers/EventsList.js b/App/Containers/EventsList.js index fdf6bc9..81779a8 100644 --- a/App/Containers/EventsList.js +++ b/App/Containers/EventsList.js @@ -136,13 +136,13 @@ class EventsList extends Component { {this.renderContent()} - + /> */} ) diff --git a/App/Containers/FeedbackDetail.js b/App/Containers/FeedbackDetail.js index 19b8579..0b8d232 100644 --- a/App/Containers/FeedbackDetail.js +++ b/App/Containers/FeedbackDetail.js @@ -14,6 +14,12 @@ import Styles from './Styles/BenefeciaryDetailViewStyle' class FeedbackDetailView extends Component { + constructor(props){ + super(props); + + this.onFullScreenImage = this.onFullScreenImage.bind(this); + } + refreshPage() { const { navigation, fetching } = this.props; const parentProps = navigation.getParam('selectedData', null); @@ -26,11 +32,17 @@ class FeedbackDetailView extends Component { } } + onFullScreenImage(){ + console.log("Data come ....."); + alert("Full Screen"); + } + renderContent() { const { data, detailError } = this.props; if (detailError) { return this.refreshPage()} /> } + console.log("data :- ", data); return ( @@ -78,7 +90,7 @@ class FeedbackDetailView extends Component { { - data.images && data.images.length ? : null + data.images && data.images.length ? : null } diff --git a/package-lock.json b/package-lock.json index f879c32..1ef1ed4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6941,8 +6941,7 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true, - "optional": true + "bundled": true }, "aproba": { "version": "1.2.0", @@ -6960,13 +6959,11 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, - "optional": true + "bundled": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -6979,18 +6976,15 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "concat-map": { "version": "0.0.1", - "bundled": true, - "optional": true + "bundled": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "core-util-is": { "version": "1.0.2", @@ -7093,8 +7087,7 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, - "optional": true + "bundled": true }, "ini": { "version": "1.3.5", @@ -7104,7 +7097,6 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -7117,20 +7109,17 @@ "minimatch": { "version": "3.0.4", "bundled": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true, - "optional": true + "bundled": true }, "minipass": { "version": "2.3.5", "bundled": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -7147,7 +7136,6 @@ "mkdirp": { "version": "0.5.1", "bundled": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -7220,8 +7208,7 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, - "optional": true + "bundled": true }, "object-assign": { "version": "4.1.1", @@ -7231,7 +7218,6 @@ "once": { "version": "1.4.0", "bundled": true, - "optional": true, "requires": { "wrappy": "1" } @@ -7307,8 +7293,7 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true, - "optional": true + "bundled": true }, "safer-buffer": { "version": "2.1.2", @@ -7338,7 +7323,6 @@ "string-width": { "version": "1.0.2", "bundled": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -7356,7 +7340,6 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -7395,13 +7378,11 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, - "optional": true + "bundled": true }, "yallist": { "version": "3.0.3", - "bundled": true, - "optional": true + "bundled": true } } }, @@ -15214,6 +15195,14 @@ "resolved": "https://registry.npmjs.org/react-native-searchable-dropdown/-/react-native-searchable-dropdown-1.0.6.tgz", "integrity": "sha512-RVCoSciRX4xSfs4r5s7m1N6s/DZItLX8hLirF3W1CWUv8lZ1cLXyDGbO7VxX6FwZWFr+7igKGEJ62K/cuZcAsA==" }, + "react-native-slick": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/react-native-slick/-/react-native-slick-1.0.2.tgz", + "integrity": "sha512-pEnCX4KSYn9dLqyMBOuuO9ofcMStYHLrpNEZAvizL2rG8CFjCX5s31PbHTu9ndZosdH3xX7V+slvIMNNz1RYEw==", + "requires": { + "prop-types": "^15.5.10" + } + }, "react-native-snap-carousel": { "version": "3.7.5", "resolved": "https://registry.npmjs.org/react-native-snap-carousel/-/react-native-snap-carousel-3.7.5.tgz", diff --git a/package.json b/package.json index 9d98e45..35366fe 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "react-native-paper": "^2.15.2", "react-native-redux-toast": "^1.0.3", "react-native-searchable-dropdown": "^1.0.6", + "react-native-slick": "^1.0.2", "react-native-snap-carousel": "^3.7.5", "react-native-splash-screen": "^3.2.0", "react-native-vector-icons": "6.1.0", From f363ce3f84484ab62d63bae959798073b102fd74 Mon Sep 17 00:00:00 2001 From: bistanil98 Date: Tue, 14 May 2019 13:41:38 +0530 Subject: [PATCH 2/5] Feedback Image Detail Full Screen Slider --- App/Components/ImageViewer.js | 9 +++- App/Components/SliderFullIImage.js | 41 ++++++++++++++++ App/Components/SliderItem.js | 1 - App/Containers/FeedbackDetail.js | 7 ++- App/Containers/FullScreenImages.js | 75 ++++++++++++++++++++++++++++++ App/Navigation/AppNavigation.js | 4 ++ 6 files changed, 133 insertions(+), 4 deletions(-) create mode 100644 App/Components/SliderFullIImage.js create mode 100644 App/Containers/FullScreenImages.js diff --git a/App/Components/ImageViewer.js b/App/Components/ImageViewer.js index 8111b13..2851a94 100644 --- a/App/Components/ImageViewer.js +++ b/App/Components/ImageViewer.js @@ -120,8 +120,13 @@ export default class ImageViewerComponent extends Component { } render () { - const carousel = this.renderSlickSlider(); //this.mainExample(1, 'Default layout | Loop | Autoplay | Parallax | Scale | Opacity | Pagination with tappable dots'); - const { data } = this.props; + var carousel; + const { data, onFullScreenEvent } = this.props; + if(onFullScreenEvent === undefined){ + carousel = this.mainExample(1, 'Default layout | Loop | Autoplay | Parallax | Scale | Opacity | Pagination with tappable dots'); + }else { + carousel = this.renderSlickSlider(); + } console.log("Data..... ", this.props); return ( diff --git a/App/Components/SliderFullIImage.js b/App/Components/SliderFullIImage.js new file mode 100644 index 0000000..30eebdc --- /dev/null +++ b/App/Components/SliderFullIImage.js @@ -0,0 +1,41 @@ +import React, { Component } from 'react'; +import { View, Dimensions, Image, PixelRatio, Text, TouchableWithoutFeedback } from 'react-native'; + +// Create a component +let ScreenWidth = Dimensions.get("window").width; + +class SliderFullImage extends Component { + + constructor(props){ + super(props); + } + + render(){ + return ( + + + + + + ); + } +} + +export default SliderFullImage; + +const styles = { + containerStyle: { + flex:1, + justifyContent: 'center', + alignItems:'center', + }, +}; + diff --git a/App/Components/SliderItem.js b/App/Components/SliderItem.js index 9ec6077..62203e7 100644 --- a/App/Components/SliderItem.js +++ b/App/Components/SliderItem.js @@ -41,4 +41,3 @@ const styles = { }, }; -export { SliderItem }; \ No newline at end of file diff --git a/App/Containers/FeedbackDetail.js b/App/Containers/FeedbackDetail.js index 0b8d232..91d3d3c 100644 --- a/App/Containers/FeedbackDetail.js +++ b/App/Containers/FeedbackDetail.js @@ -34,7 +34,12 @@ class FeedbackDetailView extends Component { onFullScreenImage(){ console.log("Data come ....."); - alert("Full Screen"); + //alert("Full Screen"); + const { data } = this.props; + this.props.navigation.navigate("FullScreenImages", { + data: data.images, + backScreen: 'FeedbackDetailScreen' + }); } renderContent() { diff --git a/App/Containers/FullScreenImages.js b/App/Containers/FullScreenImages.js new file mode 100644 index 0000000..8af3c61 --- /dev/null +++ b/App/Containers/FullScreenImages.js @@ -0,0 +1,75 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { StatusBar, TouchableOpacity, Image, AsyncStorage,Dimensions } from 'react-native'; +import { Container, Header, Content, Icon, Text, View, Badge } from 'native-base'; + +import HeaderComponent from '../Components/HeaderComponent'; +import Styles from './Styles/BenefeciaryDetailViewStyle'; +import Slick from 'react-native-slick'; +import SliderFullImage from '../Components/SliderFullIImage'; + +const ScreenWidth = Dimensions.get('window').width; +const ScreenHeight = Dimensions.get('window').height; + +class FullScreenImages extends Component { + constructor(props){ + super(props); + } + + + renderSliderImage(data){ + return( + } + activeDot={} + paginationStyle={{ + bottom: 20 + }} + height={ScreenHeight - 100} + loop={true} + autoplay={false}> + { + data.map((imageData, i) => + + ) + } + + + ); + } + + render(){ + const {navigation} = this.props; + const backScreen = navigation.getParam('backScreen', 'NetworkError'); + const data = navigation.getParam('data', []); + return ( + +
+ + + + + + + + + { navigation.navigate(backScreen); }}> + + + +
+ + + {this.renderSliderImage(data)} + + +
+ ) + } +} + +export default FullScreenImages; \ No newline at end of file diff --git a/App/Navigation/AppNavigation.js b/App/Navigation/AppNavigation.js index 8125065..4a2927d 100644 --- a/App/Navigation/AppNavigation.js +++ b/App/Navigation/AppNavigation.js @@ -26,6 +26,7 @@ import EventDetailScreen from '../Containers/EventDetail'; import FeedbackScreen from '../Containers/FeedbackScreen'; import FeedbackList from '../Containers/FeedbackList'; import FeedbackDetailScreen from '../Containers/FeedbackDetail'; +import FullScreenImages from '../Containers/FullScreenImages'; import UserSettings from '../Containers/UserSettings'; @@ -66,6 +67,9 @@ const MyDrawerNavigator = createDrawerNavigator({ FeedbackDetailScreen: { screen: FeedbackDetailScreen, }, + FullScreenImages:{ + screen: FullScreenImages, + }, UserSettings: { screen: UserSettings, }, From 135225425e52dc952425013793b7bc55d60d31b3 Mon Sep 17 00:00:00 2001 From: bistanil98 Date: Tue, 14 May 2019 19:04:46 +0530 Subject: [PATCH 3/5] File Changes --- App/Containers/FeedbackScreen.js | 114 ++++++++++++++---- App/Containers/Styles/FeedbackScreenStyle.js | 1 + App/Sagas/FeedbackSagas.js | 4 +- android/app/build.gradle | 2 + .../java/com/sunilnaik/MainApplication.java | 4 + android/settings.gradle | 4 + ios/sunilNaik.xcodeproj/project.pbxproj | 66 +++++++++- package-lock.json | 34 ++++++ package.json | 2 + 9 files changed, 205 insertions(+), 26 deletions(-) diff --git a/App/Containers/FeedbackScreen.js b/App/Containers/FeedbackScreen.js index 3c550d6..9191b12 100644 --- a/App/Containers/FeedbackScreen.js +++ b/App/Containers/FeedbackScreen.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import { AsyncStorage, StatusBar, TouchableOpacity, TextInput, Image, Platform, FlatList, Alert } from 'react-native'; import { Container, Header, Content, Icon, Text, Picker, View, Textarea } from 'native-base'; import { connect } from 'react-redux'; -// import { DocumentPicker, DocumentPickerUtil } from 'react-native-document-picker'; +import { DocumentPicker, DocumentPickerUtil } from 'react-native-document-picker'; import ImagePicker from 'react-native-image-picker'; import ImageResizer from 'react-native-image-resizer'; import { Images } from '../Themes/' @@ -10,7 +10,8 @@ import LoadingOverlay from '../Components/LoadingOverlay'; import ErrorPage from '../Components/NetworkErrorScreen'; import SearchableDropdown from 'react-native-searchable-dropdown'; import FeedbackActions from '../Redux/FeedbackRedux'; -import Styles from './Styles/FeedbackScreenStyle' +import Styles from './Styles/FeedbackScreenStyle'; +import RNFetchBlob from 'react-native-fetch-blob'; const ImagePickerOptions = { @@ -32,6 +33,7 @@ class FeedbackScreen extends Component { photos: [], } this.renderRow = this.renderRow.bind(this); + this.renderRowDocument = this.renderRowDocument.bind(this); } componentWillReceiveProps(nextProps) { @@ -46,8 +48,8 @@ class FeedbackScreen extends Component { } } - handleDocumentRemove(e, idx) { - e.preventDefault(); + handleDocumentRemove(idx) { + //e.preventDefault(); const documents = this.state.documents.filter((s, sidx) => idx !== sidx); this.setState({ documents }); } @@ -57,27 +59,41 @@ class FeedbackScreen extends Component { this.setState({ photos }); } - // addDocument = () => { - // const { documents } = this.state; - // DocumentPicker.show({ - // filetype: [DocumentPickerUtil.allFiles()], - // //All type of Files DocumentPickerUtil.allFiles() - // //Only PDF DocumentPickerUtil.pdf() - // //Audio DocumentPickerUtil.audio() - // //Plain Text DocumentPickerUtil.plainText() - // }, - // (error, res) => { - // if (res.uri) { - // this.setState({ - // documents: documents.concat([{ label: res.fileName, file: res.uri }]), - // }); - // } - // } - // ); - // }; + + addDocument = () => { + const { documents } = this.state; + DocumentPicker.show({ + filetype: [DocumentPickerUtil.pdf()], + //All type of Files DocumentPickerUtil.allFiles() + //Only PDF DocumentPickerUtil.pdf() + //Audio DocumentPickerUtil.audio() + //Plain Text DocumentPickerUtil.plainText() + }, + (error, res) => { + console.log("res :- ", res); + console.log("error :- ", error); + if (res !== null && res.uri !== null) { + RNFetchBlob.fs.stat(res.uri) + .then((stats) => { + console.log("stats :- ", stats); + this.setState({ + documents: documents.concat([{ label: res.fileName, file: res.uri , + filePath: stats.path}]), + }); + }) + .catch((err) => { + console.log("error :- ", err); + Alert.alert("Error", "Please Choose File for Internal Storage"); + }) + + } + } + ); + }; addPhoto = () => { const { photos } = this.state; + console.log("photos :- ", photos); ImagePicker.showImagePicker(ImagePickerOptions, (response) => { if (response.didCancel) { console.log('User cancelled image picker'); @@ -134,7 +150,7 @@ class FeedbackScreen extends Component { } onFormSubmit = () => { const isFormValid = this.validateForm(); - const { formObj, photos } = this.state; + const { formObj, photos, documents } = this.state; if (isFormValid) { let data = new FormData(); for (let property in formObj) { @@ -156,6 +172,21 @@ class FeedbackScreen extends Component { return photoItem; }); } + + if(documents && documents.length){ + documents.map((documentsItem, index) => { + if (documentsItem.filePath) { + data.append(`feedback[stored_files_attributes][${index}][document]`, { + uri: 'file://' + documentsItem.filePath, + type: 'application/pdf', + name: documentsItem.label, + }); + data.append(`feedback[stored_files_attributes][${index}][desc]`, documentsItem.label); + } + return documentsItem; + }); + } + AsyncStorage.getItem('accessToken').then((accessToken) => { this.props.createFeedback(accessToken, data); }); @@ -228,10 +259,24 @@ class FeedbackScreen extends Component { ) } + renderRowDocument({item, index}){ + return ( + + + {item.label} + this.handleDocumentRemove(index)}> + + + + + ) + } + renderComponent() { const { plantsList, errorCode } = this.props; const { OS } = Platform; - const { formObj, errorsObj, photos, imageLoading } = this.state; + const { formObj, errorsObj, photos, imageLoading, documents } = this.state; if (errorCode) { return this.refreshPage(1)} /> } @@ -333,6 +378,27 @@ class FeedbackScreen extends Component {
+ + + + Document + + + Add Document + + + + + + + + + Submit diff --git a/App/Containers/Styles/FeedbackScreenStyle.js b/App/Containers/Styles/FeedbackScreenStyle.js index e1d9576..21ae74a 100644 --- a/App/Containers/Styles/FeedbackScreenStyle.js +++ b/App/Containers/Styles/FeedbackScreenStyle.js @@ -234,6 +234,7 @@ regForm: { borderRadius: 3, backgroundColor: '#FF0000' }, + photoDeleteIcon: { fontSize: 14, color: '#FFF' diff --git a/App/Sagas/FeedbackSagas.js b/App/Sagas/FeedbackSagas.js index 4fb1fe9..75012e9 100644 --- a/App/Sagas/FeedbackSagas.js +++ b/App/Sagas/FeedbackSagas.js @@ -196,8 +196,10 @@ export function* createFeedback({ accessToken, data }) { credentials: 'same-origin' }; - + console.log("Send Data :- ", data); const { body, status } = yield call(request, `${BASE_URL}${API_VERSION}feedbacks?access_token=${accessToken}`, options); + console.log("status :- ", status); + console.log("body :- ", body); switch (status) { case undefined: { yield put(FeedbackActions.createFeedbackFail(503)); diff --git a/android/app/build.gradle b/android/app/build.gradle index 4505ead..ba647f7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -148,6 +148,8 @@ android { } dependencies { + compile project(':react-native-fetch-blob') + compile project(':react-native-document-picker') compile project(':react-native-image-resizer') compile project(':react-native-image-picker') compile project(':react-native-vector-icons') diff --git a/android/app/src/main/java/com/sunilnaik/MainApplication.java b/android/app/src/main/java/com/sunilnaik/MainApplication.java index 7c216b5..3debb1b 100644 --- a/android/app/src/main/java/com/sunilnaik/MainApplication.java +++ b/android/app/src/main/java/com/sunilnaik/MainApplication.java @@ -3,6 +3,8 @@ import android.app.Application; import com.facebook.react.ReactApplication; +import com.RNFetchBlob.RNFetchBlobPackage; +import com.reactnativedocumentpicker.ReactNativeDocumentPicker; import fr.bamlab.rnimageresizer.ImageResizerPackage; import com.imagepicker.ImagePickerPackage; import com.oblador.vectoricons.VectorIconsPackage; @@ -33,6 +35,8 @@ public boolean getUseDeveloperSupport() { protected List getPackages() { return Arrays.asList( new MainReactPackage(), + new RNFetchBlobPackage(), + new ReactNativeDocumentPicker(), new ImageResizerPackage(), new ImagePickerPackage(), new VectorIconsPackage(), diff --git a/android/settings.gradle b/android/settings.gradle index cdfdfa0..8a58859 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,4 +1,8 @@ rootProject.name = 'sunilNaik' +include ':react-native-fetch-blob' +project(':react-native-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fetch-blob/android') +include ':react-native-document-picker' +project(':react-native-document-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-document-picker/android') include ':react-native-image-resizer' project(':react-native-image-resizer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-resizer/android') include ':react-native-image-picker' diff --git a/ios/sunilNaik.xcodeproj/project.pbxproj b/ios/sunilNaik.xcodeproj/project.pbxproj index 495a162..7b4e11b 100644 --- a/ios/sunilNaik.xcodeproj/project.pbxproj +++ b/ios/sunilNaik.xcodeproj/project.pbxproj @@ -5,7 +5,6 @@ }; objectVersion = 46; objects = { - /* Begin PBXBuildFile section */ 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; @@ -47,6 +46,7 @@ 35A1B54A47084BD09015BD66 /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8E4352BCC4764DCCB29A54E8 /* MaterialCommunityIcons.ttf */; }; 3BB20B2693364317B33486CD /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 2AB833AE207A4AA1A51D4A10 /* SimpleLineIcons.ttf */; }; 46FDBFE3F686445981AC20EB /* libRNI18n-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 81A6E124AE244F0791DD1F40 /* libRNI18n-tvOS.a */; }; + 49EF6807010948DD893B2AC5 /* libRNDocumentPicker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B010A53BB0DF47489F8D1C71 /* libRNDocumentPicker.a */; }; 4D2A02D87C994952BB974634 /* FontAwesome5_Brands.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FDCE31F3B4E6496399924AB6 /* FontAwesome5_Brands.ttf */; }; 57C9413BD8A045A6A0B262D7 /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = DEA46253FD9248D6809822E2 /* Entypo.ttf */; }; 7324C9334C2445AEB815A073 /* libRNCAsyncStorage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AB30C07BB1B4CC387F906FB /* libRNCAsyncStorage.a */; }; @@ -70,6 +70,7 @@ F292BFA911FE4AAE9F2506C2 /* libSplashScreen.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C68F06F4F4648ED93B43A73 /* libSplashScreen.a */; }; FAEA618F417846DE993C3859 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A9C8D44A82514F18B14326E5 /* EvilIcons.ttf */; }; FD9345AD087C436D8C2B15B3 /* libRNDeviceInfo-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13CF5689248D46C88D492960 /* libRNDeviceInfo-tvOS.a */; }; + 043BEFC846F2412993FFA78F /* libRNFetchBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C74E0958BBE64603A9E1951F /* libRNFetchBlob.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -136,6 +137,13 @@ remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; remoteInfo = React; }; + 1893BBB7228AD3C6006F8042 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D78B0A723383463694063846 /* RNDocumentPicker.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = E01DD9DB1D2311A600C39062; + remoteInfo = RNDocumentPicker; + }; 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; @@ -502,6 +510,7 @@ A9C8D44A82514F18B14326E5 /* EvilIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = EvilIcons.ttf; path = "../node_modules/native-base/Fonts/EvilIcons.ttf"; sourceTree = ""; }; AA9D9CFF1EC7492498A401EB /* RNCAsyncStorage.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNCAsyncStorage.xcodeproj; path = "../node_modules/@react-native-community/async-storage/ios/RNCAsyncStorage.xcodeproj"; sourceTree = ""; }; ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = ""; }; + B010A53BB0DF47489F8D1C71 /* libRNDocumentPicker.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNDocumentPicker.a; sourceTree = ""; }; B30F27C3477C41128EE60990 /* RNGestureHandler.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNGestureHandler.xcodeproj; path = "../node_modules/react-native-gesture-handler/ios/RNGestureHandler.xcodeproj"; sourceTree = ""; }; B9EF15C080214A9FB05494F0 /* libRNImagePicker.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNImagePicker.a; sourceTree = ""; }; BF121C02D91F4F69B7908764 /* FontAwesome.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome.ttf; path = "../node_modules/native-base/Fonts/FontAwesome.ttf"; sourceTree = ""; }; @@ -509,12 +518,15 @@ C8B056E2FF3E41D8B143572A /* rubicon-icon-font.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "rubicon-icon-font.ttf"; path = "../node_modules/native-base/Fonts/rubicon-icon-font.ttf"; sourceTree = ""; }; C8F79FF0A3A14065BCFB6E37 /* Zocial.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Zocial.ttf; path = "../node_modules/native-base/Fonts/Zocial.ttf"; sourceTree = ""; }; D5DB98BECF3840C48A2BEBC7 /* RNLocalize.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNLocalize.xcodeproj; path = "../node_modules/react-native-localize/ios/RNLocalize.xcodeproj"; sourceTree = ""; }; + D78B0A723383463694063846 /* RNDocumentPicker.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNDocumentPicker.xcodeproj; path = "../node_modules/react-native-document-picker/ios/RNDocumentPicker.xcodeproj"; sourceTree = ""; }; DEA46253FD9248D6809822E2 /* Entypo.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Entypo.ttf; path = "../node_modules/native-base/Fonts/Entypo.ttf"; sourceTree = ""; }; DF788B5616CD4B5C845A7533 /* SplashScreen.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = SplashScreen.xcodeproj; path = "../node_modules/react-native-splash-screen/ios/SplashScreen.xcodeproj"; sourceTree = ""; }; E6841AAE45184B3284931E7C /* RNDeviceInfo.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNDeviceInfo.xcodeproj; path = "../node_modules/react-native-device-info/ios/RNDeviceInfo.xcodeproj"; sourceTree = ""; }; EA036245670A426794A6F4B9 /* RNI18n.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNI18n.xcodeproj; path = "../node_modules/react-native-i18n/ios/RNI18n.xcodeproj"; sourceTree = ""; }; F640C246A10548C6A3FF65BA /* ReactNativeConfig.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = ReactNativeConfig.xcodeproj; path = "../node_modules/react-native-config/ios/ReactNativeConfig.xcodeproj"; sourceTree = ""; }; FDCE31F3B4E6496399924AB6 /* FontAwesome5_Brands.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Brands.ttf; path = "../node_modules/native-base/Fonts/FontAwesome5_Brands.ttf"; sourceTree = ""; }; + A4BAF133580D4643AC02AA5C /* RNFetchBlob.xcodeproj */ = {isa = PBXFileReference; name = "RNFetchBlob.xcodeproj"; path = "../node_modules/react-native-fetch-blob/ios/RNFetchBlob.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; + C74E0958BBE64603A9E1951F /* libRNFetchBlob.a */ = {isa = PBXFileReference; name = "libRNFetchBlob.a"; path = "libRNFetchBlob.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -552,6 +564,8 @@ 8130C92106444C4EA99010BD /* libRNVectorIcons.a in Frameworks */, C0E3E033F9354D4481A0B82C /* libRNImagePicker.a in Frameworks */, A26152F8CA214315BE623A37 /* libRCTImageResizer.a in Frameworks */, + 49EF6807010948DD893B2AC5 /* libRNDocumentPicker.a in Frameworks */, + 043BEFC846F2412993FFA78F /* libRNFetchBlob.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -701,6 +715,14 @@ name = Products; sourceTree = ""; }; + 1893BBB4228AD3C5006F8042 /* Products */ = { + isa = PBXGroup; + children = ( + 1893BBB8228AD3C6006F8042 /* libRNDocumentPicker.a */, + ); + name = Products; + sourceTree = ""; + }; 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { isa = PBXGroup; children = ( @@ -752,6 +774,8 @@ 932071513AA64B5395889B5A /* RNVectorIcons.xcodeproj */, 9AF2AF214D734DA493330DF2 /* RNImagePicker.xcodeproj */, 2F7DAE80BB444204B07D5C2D /* RCTImageResizer.xcodeproj */, + D78B0A723383463694063846 /* RNDocumentPicker.xcodeproj */, + A4BAF133580D4643AC02AA5C /* RNFetchBlob.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -859,6 +883,7 @@ 8E485BAB592343388D2CE435 /* libRNVectorIcons-tvOS.a */, B9EF15C080214A9FB05494F0 /* libRNImagePicker.a */, 5D60B774EA7D4D939088424A /* libRCTImageResizer.a */, + B010A53BB0DF47489F8D1C71 /* libRNDocumentPicker.a */, ); name = "Recovered References"; sourceTree = ""; @@ -1107,6 +1132,10 @@ ProductGroup = F9846EA9227684390057B2F8 /* Products */; ProjectRef = E6841AAE45184B3284931E7C /* RNDeviceInfo.xcodeproj */; }, + { + ProductGroup = 1893BBB4228AD3C5006F8042 /* Products */; + ProjectRef = D78B0A723383463694063846 /* RNDocumentPicker.xcodeproj */; + }, { ProductGroup = F9846EAD2276843A0057B2F8 /* Products */; ProjectRef = B30F27C3477C41128EE60990 /* RNGestureHandler.xcodeproj */; @@ -1199,6 +1228,13 @@ remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 1893BBB8228AD3C6006F8042 /* libRNDocumentPicker.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRNDocumentPicker.a; + remoteRef = 1893BBB7228AD3C6006F8042 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 2D16E6721FA4F8DC00B85C8A /* libRCTBlob-tvOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -1668,6 +1704,8 @@ "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-image-picker/ios", "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", + "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", + "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", ); INFOPLIST_FILE = sunilNaikTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; @@ -1688,6 +1726,8 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -1716,6 +1756,8 @@ "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-image-picker/ios", "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", + "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", + "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", ); INFOPLIST_FILE = sunilNaikTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; @@ -1736,6 +1778,8 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -1765,6 +1809,8 @@ "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-image-picker/ios", "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", + "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", + "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", ); INFOPLIST_FILE = sunilNaik/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -1796,6 +1842,8 @@ "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-image-picker/ios", "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", + "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", + "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", ); INFOPLIST_FILE = sunilNaik/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -1834,6 +1882,8 @@ "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-image-picker/ios", "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", + "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", + "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", ); INFOPLIST_FILE = "sunilNaik-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -1853,6 +1903,8 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -1890,6 +1942,8 @@ "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-image-picker/ios", "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", + "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", + "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", ); INFOPLIST_FILE = "sunilNaik-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -1909,6 +1963,8 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -1945,6 +2001,8 @@ "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-image-picker/ios", "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", + "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", + "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", ); INFOPLIST_FILE = "sunilNaik-tvOSTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -1964,6 +2022,8 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -2000,6 +2060,8 @@ "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-image-picker/ios", "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", + "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", + "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", ); INFOPLIST_FILE = "sunilNaik-tvOSTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -2019,6 +2081,8 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", diff --git a/package-lock.json b/package-lock.json index 1ef1ed4..a67eaf1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3634,6 +3634,11 @@ } } }, + "base-64": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz", + "integrity": "sha1-eAqZyE59YAJgNhURxId2E78k9rs=" + }, "base64-js": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", @@ -15038,6 +15043,11 @@ "resolved": "https://registry.npmjs.org/react-native-device-info/-/react-native-device-info-0.24.3.tgz", "integrity": "sha512-usW00Wk6DoXH1eRSMt07j0uYvuka3SIEnJ9girlddAacyqwfa1QMVTN4eYmtaBzuMd/avhis8iHZQ3cLaR9CMA==" }, + "react-native-document-picker": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/react-native-document-picker/-/react-native-document-picker-2.3.0.tgz", + "integrity": "sha512-bHMyAOzFl+II0ZdfzobKsZKvTErmXfmQGalpxpGbeN8+/uhfhUcdp4WuIMecZhFyX6rbj3h3XXLdA12hVlGgmw==" + }, "react-native-drawer": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/react-native-drawer/-/react-native-drawer-2.5.1.tgz", @@ -15074,6 +15084,30 @@ } } }, + "react-native-fetch-blob": { + "version": "0.10.8", + "resolved": "https://registry.npmjs.org/react-native-fetch-blob/-/react-native-fetch-blob-0.10.8.tgz", + "integrity": "sha1-T8JWq64MtfEOfEHyjBGz/zMNcqk=", + "requires": { + "base-64": "0.1.0", + "glob": "7.0.6" + }, + "dependencies": { + "glob": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", + "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, "react-native-gesture-handler": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-1.0.9.tgz", diff --git a/package.json b/package.json index 35366fe..f87b3a1 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,8 @@ "react-native-animatable": "^1.3.2", "react-native-config": "^0.10.0", "react-native-device-info": "^0.24.3", + "react-native-document-picker": "^2.3.0", + "react-native-fetch-blob": "^0.10.8", "react-native-gesture-handler": "1.0.9", "react-native-i18n": "2.0.14", "react-native-image-picker": "^0.28.1", From 16d840c3e68048536e090ad4ca1ce0d1594bd6f0 Mon Sep 17 00:00:00 2001 From: bistanil98 Date: Wed, 15 May 2019 15:27:46 +0530 Subject: [PATCH 4/5] Document Upload With Edit Title --- App/Containers/FeedbackScreen.js | 102 ++++++++++++--- App/Containers/Styles/FeedbackScreenStyle.js | 53 ++++++++ android/app/build.gradle | 1 + .../java/com/sunilnaik/MainApplication.java | 2 + android/settings.gradle | 2 + ios/sunilNaik.xcodeproj/project.pbxproj | 116 +++++++++++++++++- ios/sunilNaik/Info.plist | 54 ++++---- ios/sunilNaik/sunilNaik.entitlements | 20 +++ package-lock.json | 14 +++ package.json | 1 + 10 files changed, 313 insertions(+), 52 deletions(-) create mode 100644 ios/sunilNaik/sunilNaik.entitlements diff --git a/App/Containers/FeedbackScreen.js b/App/Containers/FeedbackScreen.js index 9191b12..8426a5e 100644 --- a/App/Containers/FeedbackScreen.js +++ b/App/Containers/FeedbackScreen.js @@ -12,6 +12,7 @@ import SearchableDropdown from 'react-native-searchable-dropdown'; import FeedbackActions from '../Redux/FeedbackRedux'; import Styles from './Styles/FeedbackScreenStyle'; import RNFetchBlob from 'react-native-fetch-blob'; +import RNFS from 'react-native-fs'; const ImagePickerOptions = { @@ -54,11 +55,23 @@ class FeedbackScreen extends Component { this.setState({ documents }); } + handeDocumentOpen(documentItem){ + alert("Hello"); + } + handlePhotoRemove(idx) { const photos = this.state.photos.filter((s, sidx) => idx !== sidx); this.setState({ photos }); } + isSize2MB(byte) { + var FileSize = byte / 1024 / 1024; // in MB + if (FileSize > 2) { + return true; + } + return false; + } + addDocument = () => { const { documents } = this.state; @@ -73,18 +86,35 @@ class FeedbackScreen extends Component { console.log("res :- ", res); console.log("error :- ", error); if (res !== null && res.uri !== null) { - RNFetchBlob.fs.stat(res.uri) - .then((stats) => { - console.log("stats :- ", stats); - this.setState({ + if(Platform.OS === 'android'){ + RNFetchBlob.fs.stat(res.uri) + .then((stats) => { + console.log("stats :- ", stats); + if(!this.isSize2MB(stats.size)){ + this.setState({ + documents: documents.concat([{ label: res.fileName, file: res.uri , + filePath: stats.path}]), + }); + }else { + Alert.alert("Error", "File Size should be less than 2MB"); + } + + }) + .catch((err) => { + console.log("error :- ", err); + Alert.alert("Error", "Please Choose File for Internal Storage"); + }) + }else { + if(!this.isSize2MB(res.fileSize)){ + this.setState({ documents: documents.concat([{ label: res.fileName, file: res.uri , - filePath: stats.path}]), - }); - }) - .catch((err) => { - console.log("error :- ", err); - Alert.alert("Error", "Please Choose File for Internal Storage"); - }) + filePath: res.uri}]), + }); + }else { + Alert.alert("Error", "File Size should be less than 2MB"); + } + } + } } @@ -126,20 +156,34 @@ class FeedbackScreen extends Component { } validateForm = () => { - const { formObj } = this.state; + const { formObj, documents } = this.state; const errorsObj = {}; let errors = 0; // 'feedback[department_id]' - const requiredFields = ['feedback[name]', 'feedback[details]', 'feedback[feedback_type]', 'feedback[place_id]']; + var documentRequiredFields = []; + if(documents && documents.length){ + documents.map((documentsItem, index) => { + documentRequiredFields[index] = `feedback[stored_files_attributes][${index}][desc]` + }); + } + console.log("documentRequiredFields :- ", documentRequiredFields); + const allOtherFields = ['feedback[name]', 'feedback[details]', 'feedback[feedback_type]', 'feedback[place_id]']; + const requiredFields = allOtherFields.concat(documentRequiredFields); + console.log("requiredFields :- ", requiredFields); requiredFields.map((key) => { + console.log("key :- ", key); if (formObj[key]) { + console.log("formObj[key] :- ", formObj[key]); errorsObj[key] = null; } else { errors += 1; errorsObj[key] = `Please Fill ${key.replace("feedback[", "").slice(0, -1)}`; + console.log('Please :- ', errorsObj[key]) } return key; }); + + console.log("errorsObj[key] :- ", errorsObj ); this.setState({ errorsObj, }); @@ -151,6 +195,7 @@ class FeedbackScreen extends Component { onFormSubmit = () => { const isFormValid = this.validateForm(); const { formObj, photos, documents } = this.state; + console.log("formObj :- ", formObj); if (isFormValid) { let data = new FormData(); for (let property in formObj) { @@ -181,7 +226,9 @@ class FeedbackScreen extends Component { type: 'application/pdf', name: documentsItem.label, }); - data.append(`feedback[stored_files_attributes][${index}][desc]`, documentsItem.label); + const desc = formObj[`feedback[stored_files_attributes][${index}][desc]`]; + console.log("desc index :- " + index, desc); + data.append(`feedback[stored_files_attributes][${index}][desc]`, desc); } return documentsItem; }); @@ -260,14 +307,28 @@ class FeedbackScreen extends Component { } renderRowDocument({item, index}){ + const { formObj, errorsObj } = this.state; + console.log("renderRowDocument errorsObj :- ", errorsObj); return ( - - {item.label} - this.handleDocumentRemove(index)}> - - + + + this.onFormChange(text, 'feedback[stored_files_attributes]['+index+'][desc]')} + value={formObj[`feedback[stored_files_attributes][${index}][desc]`]}> + + this.handleDocumentRemove(index)}> + + + this.handeDocumentOpen(item)}> + + ) @@ -392,6 +453,7 @@ class FeedbackScreen extends Component { diff --git a/App/Containers/Styles/FeedbackScreenStyle.js b/App/Containers/Styles/FeedbackScreenStyle.js index 21ae74a..645808b 100644 --- a/App/Containers/Styles/FeedbackScreenStyle.js +++ b/App/Containers/Styles/FeedbackScreenStyle.js @@ -113,6 +113,21 @@ regForm: { borderBottomWidth: 1, borderColor: 'rgba(36,42,56,0.05)' }, + + fDoucmentRow:{ + flex: 1, + flexDirection: 'row', + alignItems: 'center', + // paddingVertical: 5, + ...Platform.select({ + ios: { + paddingVertical: 10, + }, + }), + borderBottomWidth: 1, + borderColor: 'rgba(36,42,56,0.05)' + }, + fRowError: { flex: 1, flexDirection: 'row', @@ -129,6 +144,21 @@ regForm: { backgroundColor: '#fff6f6', }, + fDoucmentError: { + flex: 1, + flexDirection: 'row', + alignItems: 'center', + // paddingVertical: 5, + ...Platform.select({ + ios: { + paddingVertical: 10, + }, + }), + borderBottomWidth: 1, + borderColor: '#bb0000', + backgroundColor: '#fff6f6', + }, + fPicker: { flex: 1 }, @@ -235,11 +265,34 @@ regForm: { backgroundColor: '#FF0000' }, + documentItem:{ + width: 30, + padding: 3, + borderRadius: 3, + }, + + documentShowItem:{ + width: 30, + padding: 3, + borderRadius: 3, + backgroundColor: '#FF0000' + }, + photoDeleteIcon: { fontSize: 14, color: '#FFF' }, + documentDeleteIcon: { + fontSize: 24, + color: '#FF0000' + }, + + documentShowIcon:{ + fontSize: 24, + color: 'gray' + }, + truckImg: { width: 90, height: 64, diff --git a/android/app/build.gradle b/android/app/build.gradle index ba647f7..9b57f12 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -148,6 +148,7 @@ android { } dependencies { + compile project(':react-native-fs') compile project(':react-native-fetch-blob') compile project(':react-native-document-picker') compile project(':react-native-image-resizer') diff --git a/android/app/src/main/java/com/sunilnaik/MainApplication.java b/android/app/src/main/java/com/sunilnaik/MainApplication.java index 3debb1b..e12b13d 100644 --- a/android/app/src/main/java/com/sunilnaik/MainApplication.java +++ b/android/app/src/main/java/com/sunilnaik/MainApplication.java @@ -3,6 +3,7 @@ import android.app.Application; import com.facebook.react.ReactApplication; +import com.rnfs.RNFSPackage; import com.RNFetchBlob.RNFetchBlobPackage; import com.reactnativedocumentpicker.ReactNativeDocumentPicker; import fr.bamlab.rnimageresizer.ImageResizerPackage; @@ -35,6 +36,7 @@ public boolean getUseDeveloperSupport() { protected List getPackages() { return Arrays.asList( new MainReactPackage(), + new RNFSPackage(), new RNFetchBlobPackage(), new ReactNativeDocumentPicker(), new ImageResizerPackage(), diff --git a/android/settings.gradle b/android/settings.gradle index 8a58859..ebbbceb 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,4 +1,6 @@ rootProject.name = 'sunilNaik' +include ':react-native-fs' +project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android') include ':react-native-fetch-blob' project(':react-native-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fetch-blob/android') include ':react-native-document-picker' diff --git a/ios/sunilNaik.xcodeproj/project.pbxproj b/ios/sunilNaik.xcodeproj/project.pbxproj index 7b4e11b..cf6012b 100644 --- a/ios/sunilNaik.xcodeproj/project.pbxproj +++ b/ios/sunilNaik.xcodeproj/project.pbxproj @@ -5,6 +5,7 @@ }; objectVersion = 46; objects = { + /* Begin PBXBuildFile section */ 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; @@ -12,6 +13,7 @@ 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 00E356F31AD99517003FC87E /* sunilNaikTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* sunilNaikTests.m */; }; + 043BEFC846F2412993FFA78F /* libRNFetchBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C74E0958BBE64603A9E1951F /* libRNFetchBlob.a */; }; 0B067EECF4194501A2FCD0BE /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6834E57085FD4C44AB3E5050 /* Foundation.ttf */; }; 0FC3973D0D454C269AA59C38 /* libRNVectorIcons-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E485BAB592343388D2CE435 /* libRNVectorIcons-tvOS.a */; }; 11D1A2F320CAFA9E000508D9 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; @@ -45,6 +47,7 @@ 2DF0FFEE2056DD460020B375 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; }; 35A1B54A47084BD09015BD66 /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8E4352BCC4764DCCB29A54E8 /* MaterialCommunityIcons.ttf */; }; 3BB20B2693364317B33486CD /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 2AB833AE207A4AA1A51D4A10 /* SimpleLineIcons.ttf */; }; + 3FBF6DF7FBFA4CFA957458DC /* libRNFS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22CB7E8B6BC44CEDAA021A5B /* libRNFS.a */; }; 46FDBFE3F686445981AC20EB /* libRNI18n-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 81A6E124AE244F0791DD1F40 /* libRNI18n-tvOS.a */; }; 49EF6807010948DD893B2AC5 /* libRNDocumentPicker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B010A53BB0DF47489F8D1C71 /* libRNDocumentPicker.a */; }; 4D2A02D87C994952BB974634 /* FontAwesome5_Brands.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FDCE31F3B4E6496399924AB6 /* FontAwesome5_Brands.ttf */; }; @@ -70,7 +73,6 @@ F292BFA911FE4AAE9F2506C2 /* libSplashScreen.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C68F06F4F4648ED93B43A73 /* libSplashScreen.a */; }; FAEA618F417846DE993C3859 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A9C8D44A82514F18B14326E5 /* EvilIcons.ttf */; }; FD9345AD087C436D8C2B15B3 /* libRNDeviceInfo-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13CF5689248D46C88D492960 /* libRNDeviceInfo-tvOS.a */; }; - 043BEFC846F2412993FFA78F /* libRNFetchBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C74E0958BBE64603A9E1951F /* libRNFetchBlob.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -137,6 +139,27 @@ remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; remoteInfo = React; }; + 181100D1228BE9350088C4FE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 27C54F1CD8FC4240B9E055FA /* RNFS.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F12AFB9B1ADAF8F800E0535D; + remoteInfo = RNFS; + }; + 181100D3228BE9350088C4FE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 27C54F1CD8FC4240B9E055FA /* RNFS.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 6456441F1EB8DA9100672408; + remoteInfo = "RNFS-tvOS"; + }; + 181100D8228BE9350088C4FE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A4BAF133580D4643AC02AA5C /* RNFetchBlob.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A15C300E1CD25C330074CB35; + remoteInfo = RNFetchBlob; + }; 1893BBB7228AD3C6006F8042 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D78B0A723383463694063846 /* RNDocumentPicker.xcodeproj */; @@ -478,9 +501,12 @@ 13CF5689248D46C88D492960 /* libRNDeviceInfo-tvOS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = "libRNDeviceInfo-tvOS.a"; sourceTree = ""; }; 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 14FD73D69B0F492FBEF9C713 /* FontAwesome5_Solid.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Solid.ttf; path = "../node_modules/native-base/Fonts/FontAwesome5_Solid.ttf"; sourceTree = ""; }; + 181100DA228BEA900088C4FE /* sunilNaik.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = sunilNaik.entitlements; path = sunilNaik/sunilNaik.entitlements; sourceTree = ""; }; 18D7F59FA2B542C8815B1DD9 /* libRNVectorIcons.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNVectorIcons.a; sourceTree = ""; }; 21EC9D0857E6439380FC7569 /* Ionicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Ionicons.ttf; path = "../node_modules/native-base/Fonts/Ionicons.ttf"; sourceTree = ""; }; + 22CB7E8B6BC44CEDAA021A5B /* libRNFS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNFS.a; sourceTree = ""; }; 27AA74A444C2460B9A81C608 /* Roboto.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Roboto.ttf; path = "../node_modules/native-base/Fonts/Roboto.ttf"; sourceTree = ""; }; + 27C54F1CD8FC4240B9E055FA /* RNFS.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNFS.xcodeproj; path = "../node_modules/react-native-fs/RNFS.xcodeproj"; sourceTree = ""; }; 2AB833AE207A4AA1A51D4A10 /* SimpleLineIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = SimpleLineIcons.ttf; path = "../node_modules/native-base/Fonts/SimpleLineIcons.ttf"; sourceTree = ""; }; 2D02E47B1E0B4A5D006451C7 /* sunilNaik-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "sunilNaik-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 2D02E4901E0B4A5D006451C7 /* sunilNaik-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "sunilNaik-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -507,6 +533,7 @@ 9E1AE13330A84490B50C89A7 /* libReactNativeConfig.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libReactNativeConfig.a; sourceTree = ""; }; A067B049644843D9AA658147 /* MaterialIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialIcons.ttf; path = "../node_modules/native-base/Fonts/MaterialIcons.ttf"; sourceTree = ""; }; A3E7F0A240BC4C658396B2D9 /* libRNGestureHandler.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNGestureHandler.a; sourceTree = ""; }; + A4BAF133580D4643AC02AA5C /* RNFetchBlob.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNFetchBlob.xcodeproj; path = "../node_modules/react-native-fetch-blob/ios/RNFetchBlob.xcodeproj"; sourceTree = ""; }; A9C8D44A82514F18B14326E5 /* EvilIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = EvilIcons.ttf; path = "../node_modules/native-base/Fonts/EvilIcons.ttf"; sourceTree = ""; }; AA9D9CFF1EC7492498A401EB /* RNCAsyncStorage.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNCAsyncStorage.xcodeproj; path = "../node_modules/@react-native-community/async-storage/ios/RNCAsyncStorage.xcodeproj"; sourceTree = ""; }; ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = ""; }; @@ -515,6 +542,7 @@ B9EF15C080214A9FB05494F0 /* libRNImagePicker.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNImagePicker.a; sourceTree = ""; }; BF121C02D91F4F69B7908764 /* FontAwesome.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome.ttf; path = "../node_modules/native-base/Fonts/FontAwesome.ttf"; sourceTree = ""; }; C0AD4701E2E949D890E5C4F0 /* libRNLocalize-tvOS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = "libRNLocalize-tvOS.a"; sourceTree = ""; }; + C74E0958BBE64603A9E1951F /* libRNFetchBlob.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNFetchBlob.a; sourceTree = ""; }; C8B056E2FF3E41D8B143572A /* rubicon-icon-font.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "rubicon-icon-font.ttf"; path = "../node_modules/native-base/Fonts/rubicon-icon-font.ttf"; sourceTree = ""; }; C8F79FF0A3A14065BCFB6E37 /* Zocial.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Zocial.ttf; path = "../node_modules/native-base/Fonts/Zocial.ttf"; sourceTree = ""; }; D5DB98BECF3840C48A2BEBC7 /* RNLocalize.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNLocalize.xcodeproj; path = "../node_modules/react-native-localize/ios/RNLocalize.xcodeproj"; sourceTree = ""; }; @@ -525,8 +553,6 @@ EA036245670A426794A6F4B9 /* RNI18n.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNI18n.xcodeproj; path = "../node_modules/react-native-i18n/ios/RNI18n.xcodeproj"; sourceTree = ""; }; F640C246A10548C6A3FF65BA /* ReactNativeConfig.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = ReactNativeConfig.xcodeproj; path = "../node_modules/react-native-config/ios/ReactNativeConfig.xcodeproj"; sourceTree = ""; }; FDCE31F3B4E6496399924AB6 /* FontAwesome5_Brands.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Brands.ttf; path = "../node_modules/native-base/Fonts/FontAwesome5_Brands.ttf"; sourceTree = ""; }; - A4BAF133580D4643AC02AA5C /* RNFetchBlob.xcodeproj */ = {isa = PBXFileReference; name = "RNFetchBlob.xcodeproj"; path = "../node_modules/react-native-fetch-blob/ios/RNFetchBlob.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; - C74E0958BBE64603A9E1951F /* libRNFetchBlob.a */ = {isa = PBXFileReference; name = "libRNFetchBlob.a"; path = "libRNFetchBlob.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -566,6 +592,7 @@ A26152F8CA214315BE623A37 /* libRCTImageResizer.a in Frameworks */, 49EF6807010948DD893B2AC5 /* libRNDocumentPicker.a in Frameworks */, 043BEFC846F2412993FFA78F /* libRNFetchBlob.a in Frameworks */, + 3FBF6DF7FBFA4CFA957458DC /* libRNFS.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -681,6 +708,7 @@ 13B07FAE1A68108700A75B9A /* sunilNaik */ = { isa = PBXGroup; children = ( + 181100DA228BEA900088C4FE /* sunilNaik.entitlements */, 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 13B07FB01A68108700A75B9A /* AppDelegate.m */, @@ -715,6 +743,23 @@ name = Products; sourceTree = ""; }; + 181100CD228BE9340088C4FE /* Products */ = { + isa = PBXGroup; + children = ( + 181100D2228BE9350088C4FE /* libRNFS.a */, + 181100D4228BE9350088C4FE /* libRNFS.a */, + ); + name = Products; + sourceTree = ""; + }; + 181100D5228BE9350088C4FE /* Products */ = { + isa = PBXGroup; + children = ( + 181100D9228BE9350088C4FE /* libRNFetchBlob.a */, + ); + name = Products; + sourceTree = ""; + }; 1893BBB4228AD3C5006F8042 /* Products */ = { isa = PBXGroup; children = ( @@ -776,6 +821,7 @@ 2F7DAE80BB444204B07D5C2D /* RCTImageResizer.xcodeproj */, D78B0A723383463694063846 /* RNDocumentPicker.xcodeproj */, A4BAF133580D4643AC02AA5C /* RNFetchBlob.xcodeproj */, + 27C54F1CD8FC4240B9E055FA /* RNFS.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -884,6 +930,8 @@ B9EF15C080214A9FB05494F0 /* libRNImagePicker.a */, 5D60B774EA7D4D939088424A /* libRCTImageResizer.a */, B010A53BB0DF47489F8D1C71 /* libRNDocumentPicker.a */, + C74E0958BBE64603A9E1951F /* libRNFetchBlob.a */, + 22CB7E8B6BC44CEDAA021A5B /* libRNFS.a */, ); name = "Recovered References"; sourceTree = ""; @@ -1042,8 +1090,17 @@ TargetAttributes = { 00E356ED1AD99517003FC87E = { CreatedOnToolsVersion = 6.2; + DevelopmentTeam = W7P9573U99; TestTargetID = 13B07F861A680F5B00A75B9A; }; + 13B07F861A680F5B00A75B9A = { + DevelopmentTeam = W7P9573U99; + SystemCapabilities = { + com.apple.iCloud = { + enabled = 1; + }; + }; + }; 2D02E47A1E0B4A5D006451C7 = { CreatedOnToolsVersion = 8.2.1; ProvisioningStyle = Automatic; @@ -1136,6 +1193,14 @@ ProductGroup = 1893BBB4228AD3C5006F8042 /* Products */; ProjectRef = D78B0A723383463694063846 /* RNDocumentPicker.xcodeproj */; }, + { + ProductGroup = 181100D5228BE9350088C4FE /* Products */; + ProjectRef = A4BAF133580D4643AC02AA5C /* RNFetchBlob.xcodeproj */; + }, + { + ProductGroup = 181100CD228BE9340088C4FE /* Products */; + ProjectRef = 27C54F1CD8FC4240B9E055FA /* RNFS.xcodeproj */; + }, { ProductGroup = F9846EAD2276843A0057B2F8 /* Products */; ProjectRef = B30F27C3477C41128EE60990 /* RNGestureHandler.xcodeproj */; @@ -1228,6 +1293,27 @@ remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 181100D2228BE9350088C4FE /* libRNFS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRNFS.a; + remoteRef = 181100D1228BE9350088C4FE /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 181100D4228BE9350088C4FE /* libRNFS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRNFS.a; + remoteRef = 181100D3228BE9350088C4FE /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 181100D9228BE9350088C4FE /* libRNFetchBlob.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRNFetchBlob.a; + remoteRef = 181100D8228BE9350088C4FE /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 1893BBB8228AD3C6006F8042 /* libRNDocumentPicker.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -1688,6 +1774,7 @@ isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; + DEVELOPMENT_TEAM = W7P9573U99; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -1706,6 +1793,7 @@ "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", + "$(SRCROOT)/../node_modules/react-native-fs/**", ); INFOPLIST_FILE = sunilNaikTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; @@ -1728,6 +1816,7 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -1744,6 +1833,7 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COPY_PHASE_STRIP = NO; + DEVELOPMENT_TEAM = W7P9573U99; HEADER_SEARCH_PATHS = ( "$(inherited)", "$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios", @@ -1758,6 +1848,7 @@ "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", + "$(SRCROOT)/../node_modules/react-native-fs/**", ); INFOPLIST_FILE = sunilNaikTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; @@ -1780,6 +1871,7 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -1795,8 +1887,10 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = sunilNaik/sunilNaik.entitlements; CURRENT_PROJECT_VERSION = 4; DEAD_CODE_STRIPPING = NO; + DEVELOPMENT_TEAM = W7P9573U99; HEADER_SEARCH_PATHS = ( "$(inherited)", "$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios", @@ -1811,6 +1905,7 @@ "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", + "$(SRCROOT)/../node_modules/react-native-fs/**", ); INFOPLIST_FILE = sunilNaik/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -1819,7 +1914,7 @@ "-ObjC", "-lc++", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = com.likelydating.likely; PRODUCT_NAME = sunilNaik; VERSIONING_SYSTEM = "apple-generic"; }; @@ -1829,7 +1924,9 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = sunilNaik/sunilNaik.entitlements; CURRENT_PROJECT_VERSION = 4; + DEVELOPMENT_TEAM = W7P9573U99; HEADER_SEARCH_PATHS = ( "$(inherited)", "$(SRCROOT)/../node_modules/@react-native-community/async-storage/ios", @@ -1844,6 +1941,7 @@ "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", + "$(SRCROOT)/../node_modules/react-native-fs/**", ); INFOPLIST_FILE = sunilNaik/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -1852,7 +1950,7 @@ "-ObjC", "-lc++", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = com.likelydating.likely; PRODUCT_NAME = sunilNaik; VERSIONING_SYSTEM = "apple-generic"; }; @@ -1884,6 +1982,7 @@ "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", + "$(SRCROOT)/../node_modules/react-native-fs/**", ); INFOPLIST_FILE = "sunilNaik-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -1905,6 +2004,7 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -1944,6 +2044,7 @@ "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", + "$(SRCROOT)/../node_modules/react-native-fs/**", ); INFOPLIST_FILE = "sunilNaik-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -1965,6 +2066,7 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -2003,6 +2105,7 @@ "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", + "$(SRCROOT)/../node_modules/react-native-fs/**", ); INFOPLIST_FILE = "sunilNaik-tvOSTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -2024,6 +2127,7 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -2062,6 +2166,7 @@ "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", + "$(SRCROOT)/../node_modules/react-native-fs/**", ); INFOPLIST_FILE = "sunilNaik-tvOSTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -2083,6 +2188,7 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", diff --git a/ios/sunilNaik/Info.plist b/ios/sunilNaik/Info.plist index ab74711..094938f 100644 --- a/ios/sunilNaik/Info.plist +++ b/ios/sunilNaik/Info.plist @@ -23,36 +23,30 @@ CFBundleVersion 4 LSRequiresIPhoneOS - - NSLocationWhenInUseUsageDescription - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - + NSAppTransportSecurity NSAllowsArbitraryLoads - + NSExceptionDomains localhost NSExceptionAllowsInsecureHTTPLoads - + + NSCameraUsageDescription + $(PRODUCT_NAME) would like to use your camera + NSLocationWhenInUseUsageDescription + + NSMicrophoneUsageDescription + $(PRODUCT_NAME) would like to your microphone (for videos) + NSPhotoLibraryAddUsageDescription + $(PRODUCT_NAME) would like to save photos to your photo gallery + NSPhotoLibraryUsageDescription + $(PRODUCT_NAME) would like access to your photo gallery UIAppFonts AntDesign.ttf @@ -74,13 +68,19 @@ SimpleLineIcons.ttf Zocial.ttf - NSPhotoLibraryUsageDescription - $(PRODUCT_NAME) would like access to your photo gallery - NSCameraUsageDescription - $(PRODUCT_NAME) would like to use your camera - NSPhotoLibraryAddUsageDescription - $(PRODUCT_NAME) would like to save photos to your photo gallery - NSMicrophoneUsageDescription - $(PRODUCT_NAME) would like to your microphone (for videos) + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + diff --git a/ios/sunilNaik/sunilNaik.entitlements b/ios/sunilNaik/sunilNaik.entitlements new file mode 100644 index 0000000..367dc1b --- /dev/null +++ b/ios/sunilNaik/sunilNaik.entitlements @@ -0,0 +1,20 @@ + + + + + com.apple.developer.icloud-container-identifiers + + iCloud.$(CFBundleIdentifier) + + com.apple.developer.icloud-services + + CloudDocuments + + com.apple.developer.ubiquity-container-identifiers + + iCloud.$(CFBundleIdentifier) + + com.apple.developer.ubiquity-kvstore-identifier + $(TeamIdentifierPrefix)$(CFBundleIdentifier) + + diff --git a/package-lock.json b/package-lock.json index a67eaf1..c050c3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15108,6 +15108,15 @@ } } }, + "react-native-fs": { + "version": "2.13.3", + "resolved": "https://registry.npmjs.org/react-native-fs/-/react-native-fs-2.13.3.tgz", + "integrity": "sha512-B62LSSAEYQGItg7KVTzTVVCxezOYFBYp4DMVFbdoZUd1mZVFdqR2sy1HY1mye1VI/Lf3IbxSyZEQ0GmrrdwLjg==", + "requires": { + "base-64": "^0.1.0", + "utf8": "^2.1.1" + } + }, "react-native-gesture-handler": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-1.0.9.tgz", @@ -18004,6 +18013,11 @@ "os-homedir": "^1.0.0" } }, + "utf8": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.2.tgz", + "integrity": "sha1-H6DZJw6b6FDZsFAn9jUZv0ZFfZY=" + }, "util": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", diff --git a/package.json b/package.json index f87b3a1..4daeb7a 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "react-native-device-info": "^0.24.3", "react-native-document-picker": "^2.3.0", "react-native-fetch-blob": "^0.10.8", + "react-native-fs": "^2.13.3", "react-native-gesture-handler": "1.0.9", "react-native-i18n": "2.0.14", "react-native-image-picker": "^0.28.1", From 390fd3bba5b017f4a1902c325df9739c847d01e6 Mon Sep 17 00:00:00 2001 From: bistanil98 Date: Wed, 15 May 2019 18:29:07 +0530 Subject: [PATCH 5/5] Document viewer --- App/Containers/DocumentViewer.js | 77 ++++++++++++++++ App/Containers/FeedbackScreen.js | 9 +- App/Navigation/AppNavigation.js | 4 + android/app/build.gradle | 15 ++- .../java/com/sunilnaik/MainApplication.java | 6 ++ android/settings.gradle | 6 ++ ios/sunilNaik.xcodeproj/project.pbxproj | 92 +++++++++++++++++++ package-lock.json | 43 +++++++++ package.json | 3 + 9 files changed, 253 insertions(+), 2 deletions(-) create mode 100644 App/Containers/DocumentViewer.js diff --git a/App/Containers/DocumentViewer.js b/App/Containers/DocumentViewer.js new file mode 100644 index 0000000..1f36492 --- /dev/null +++ b/App/Containers/DocumentViewer.js @@ -0,0 +1,77 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { StatusBar, TouchableOpacity,Dimensions, Platform, WebView } from 'react-native'; +import { Container, Header, Content, Icon, Text, View, Badge } from 'native-base'; + +import Styles from './Styles/BenefeciaryDetailViewStyle'; +import Pdf from 'react-native-pdf'; + + +const ScreenWidth = Dimensions.get('window').width; +const ScreenHeight = Dimensions.get('window').height; + +class DocumentViewer extends Component { + constructor(props){ + super(props); + } + + + renderSliderImage(data){ + if(Platform.OS === 'ios'){ + return ( < WebView + source={{ uri: data.filePath }} + onLoad={this.onFinish} + style={{flex:1, width: ScreenWidth}} + originWhitelist={['*']} /> ); + }else { + return( + { + console.log(`number of pages: ${numberOfPages}`); + }} + onPageChanged={(page,numberOfPages)=>{ + console.log(`current page: ${page}`); + }} + onError={(error)=>{ + console.log(error); + }} + style={{flex:1, width: ScreenWidth}}/> + ); + } + + } + + render(){ + const {navigation} = this.props; + const backScreen = navigation.getParam('backScreen', 'NetworkError'); + const data = navigation.getParam('data', {}); + return ( + +
+ + + + + + + + {data.label} + + { navigation.navigate(backScreen); }}> + + + +
+ + + {this.renderSliderImage(data)} + + +
+ ) + } +} + +export default DocumentViewer; \ No newline at end of file diff --git a/App/Containers/FeedbackScreen.js b/App/Containers/FeedbackScreen.js index 8426a5e..3536831 100644 --- a/App/Containers/FeedbackScreen.js +++ b/App/Containers/FeedbackScreen.js @@ -13,6 +13,7 @@ import FeedbackActions from '../Redux/FeedbackRedux'; import Styles from './Styles/FeedbackScreenStyle'; import RNFetchBlob from 'react-native-fetch-blob'; import RNFS from 'react-native-fs'; +import OpenFile from 'react-native-doc-viewer'; const ImagePickerOptions = { @@ -56,7 +57,13 @@ class FeedbackScreen extends Component { } handeDocumentOpen(documentItem){ - alert("Hello"); + //alert("Hello"); + console.log("documentItem :- ", documentItem); + this.props.navigation.navigate("DocumentViewer", { + data: documentItem, + backScreen: 'FeedbackScreen' + }); + } handlePhotoRemove(idx) { diff --git a/App/Navigation/AppNavigation.js b/App/Navigation/AppNavigation.js index 4a2927d..c1736d4 100644 --- a/App/Navigation/AppNavigation.js +++ b/App/Navigation/AppNavigation.js @@ -27,6 +27,7 @@ import FeedbackScreen from '../Containers/FeedbackScreen'; import FeedbackList from '../Containers/FeedbackList'; import FeedbackDetailScreen from '../Containers/FeedbackDetail'; import FullScreenImages from '../Containers/FullScreenImages'; +import DocumentViewer from '../Containers/DocumentViewer'; import UserSettings from '../Containers/UserSettings'; @@ -70,6 +71,9 @@ const MyDrawerNavigator = createDrawerNavigator({ FullScreenImages:{ screen: FullScreenImages, }, + DocumentViewer:{ + screen: DocumentViewer, + }, UserSettings: { screen: UserSettings, }, diff --git a/android/app/build.gradle b/android/app/build.gradle index 9b57f12..5a74cd7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -103,10 +103,14 @@ android { targetSdkVersion rootProject.ext.targetSdkVersion versionCode 4 versionName "0.0.1" + multiDexEnabled true ndk { abiFilters "armeabi-v7a", "x86" } } + dexOptions { + javaMaxHeapSize "4g" + } signingConfigs { release { if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) { @@ -125,6 +129,10 @@ android { include "armeabi-v7a", "x86" } } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + } buildTypes { release { minifyEnabled enableProguardInReleaseBuilds @@ -148,6 +156,9 @@ android { } dependencies { + compile project(':react-native-pdf') + compile project(':rn-fetch-blob') + compile project(':react-native-doc-viewer') compile project(':react-native-fs') compile project(':react-native-fetch-blob') compile project(':react-native-document-picker') @@ -162,7 +173,9 @@ dependencies { compile project(':react-native-config') compile project(':@react-native-community_async-storage') implementation fileTree(dir: "libs", include: ["*.jar"]) - implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" + implementation 'com.android.support:multidex:1.0.3' + implementation "com.android.support:design:${rootProject.ext.targetSdkVersion}" + implementation "com.android.support:appcompat-v7:${rootProject.ext.targetSdkVersion}" implementation "com.facebook.react:react-native:+" // From node_modules } diff --git a/android/app/src/main/java/com/sunilnaik/MainApplication.java b/android/app/src/main/java/com/sunilnaik/MainApplication.java index e12b13d..da2c762 100644 --- a/android/app/src/main/java/com/sunilnaik/MainApplication.java +++ b/android/app/src/main/java/com/sunilnaik/MainApplication.java @@ -3,6 +3,9 @@ import android.app.Application; import com.facebook.react.ReactApplication; +import org.wonday.pdf.RCTPdfView; +import com.RNFetchBlob.RNFetchBlobPackage; +import com.reactlibrary.RNReactNativeDocViewerPackage; import com.rnfs.RNFSPackage; import com.RNFetchBlob.RNFetchBlobPackage; import com.reactnativedocumentpicker.ReactNativeDocumentPicker; @@ -36,6 +39,9 @@ public boolean getUseDeveloperSupport() { protected List getPackages() { return Arrays.asList( new MainReactPackage(), + new RCTPdfView(), + new RNFetchBlobPackage(), + new RNReactNativeDocViewerPackage(), new RNFSPackage(), new RNFetchBlobPackage(), new ReactNativeDocumentPicker(), diff --git a/android/settings.gradle b/android/settings.gradle index ebbbceb..23a6503 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,4 +1,10 @@ rootProject.name = 'sunilNaik' +include ':react-native-pdf' +project(':react-native-pdf').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-pdf/android') +include ':rn-fetch-blob' +project(':rn-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/rn-fetch-blob/android') +include ':react-native-doc-viewer' +project(':react-native-doc-viewer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-doc-viewer/android') include ':react-native-fs' project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android') include ':react-native-fetch-blob' diff --git a/ios/sunilNaik.xcodeproj/project.pbxproj b/ios/sunilNaik.xcodeproj/project.pbxproj index cf6012b..c883056 100644 --- a/ios/sunilNaik.xcodeproj/project.pbxproj +++ b/ios/sunilNaik.xcodeproj/project.pbxproj @@ -32,6 +32,7 @@ 286F8DAAC4884EFB99CC386E /* libRNLocalize.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78EFF200A3DF46EDA0BDB0CC /* libRNLocalize.a */; }; 28C2E5886DE84E3D8502E150 /* AntDesign.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 70BCD660C36D4A06B8CB3DAE /* AntDesign.ttf */; }; 2B93816A5F124C389B992C0C /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 21EC9D0857E6439380FC7569 /* Ionicons.ttf */; }; + 2CFCBFD135094AA59F079906 /* libRCTPdf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F6BE78289C37400B99E40B91 /* libRCTPdf.a */; }; 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; @@ -66,6 +67,7 @@ A26152F8CA214315BE623A37 /* libRCTImageResizer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D60B774EA7D4D939088424A /* libRCTImageResizer.a */; }; ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; }; B321D84201D942C285F3EDE9 /* FontAwesome5_Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 9D4BFCE20C454DB89312E7CD /* FontAwesome5_Regular.ttf */; }; + B90C1764E1C141EC9FA83813 /* libRNReactNativeDocViewer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59BC1E49093B4DFF8E5753AB /* libRNReactNativeDocViewer.a */; }; C0E3E033F9354D4481A0B82C /* libRNImagePicker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B9EF15C080214A9FB05494F0 /* libRNImagePicker.a */; }; C257B713F0AA4AB989BBA3BD /* libRNI18n.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 062A1B7794F445E695BC0B6D /* libRNI18n.a */; }; E9138E24C84143449BD713F9 /* Roboto_medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8B98B58046F04577A4724B2B /* Roboto_medium.ttf */; }; @@ -160,6 +162,13 @@ remoteGlobalIDString = A15C300E1CD25C330074CB35; remoteInfo = RNFetchBlob; }; + 18342D8D228C1D50002F1625 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 02418A92AB704A3FBC3A6A6F /* RNReactNativeDocViewer.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RNReactNativeDocViewer; + }; 1893BBB7228AD3C6006F8042 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D78B0A723383463694063846 /* RNDocumentPicker.xcodeproj */; @@ -167,6 +176,13 @@ remoteGlobalIDString = E01DD9DB1D2311A600C39062; remoteInfo = RNDocumentPicker; }; + 18C459B4228C328A00D99CD6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1A15E4D1A104453598CD8DD1 /* RCTPdf.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 20D8E03F1C8E946C00039823; + remoteInfo = RCTPdf; + }; 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; @@ -487,6 +503,7 @@ 00E356EE1AD99517003FC87E /* sunilNaikTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = sunilNaikTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 00E356F21AD99517003FC87E /* sunilNaikTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = sunilNaikTests.m; sourceTree = ""; }; + 02418A92AB704A3FBC3A6A6F /* RNReactNativeDocViewer.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNReactNativeDocViewer.xcodeproj; path = "../node_modules/react-native-doc-viewer/ios/RNReactNativeDocViewer.xcodeproj"; sourceTree = ""; }; 060E4CC8775B4CEE877B8138 /* Feather.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Feather.ttf; path = "../node_modules/native-base/Fonts/Feather.ttf"; sourceTree = ""; }; 062A1B7794F445E695BC0B6D /* libRNI18n.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNI18n.a; sourceTree = ""; }; 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; @@ -503,6 +520,7 @@ 14FD73D69B0F492FBEF9C713 /* FontAwesome5_Solid.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Solid.ttf; path = "../node_modules/native-base/Fonts/FontAwesome5_Solid.ttf"; sourceTree = ""; }; 181100DA228BEA900088C4FE /* sunilNaik.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = sunilNaik.entitlements; path = sunilNaik/sunilNaik.entitlements; sourceTree = ""; }; 18D7F59FA2B542C8815B1DD9 /* libRNVectorIcons.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNVectorIcons.a; sourceTree = ""; }; + 1A15E4D1A104453598CD8DD1 /* RCTPdf.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RCTPdf.xcodeproj; path = "../node_modules/react-native-pdf/ios/RCTPdf.xcodeproj"; sourceTree = ""; }; 21EC9D0857E6439380FC7569 /* Ionicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Ionicons.ttf; path = "../node_modules/native-base/Fonts/Ionicons.ttf"; sourceTree = ""; }; 22CB7E8B6BC44CEDAA021A5B /* libRNFS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNFS.a; sourceTree = ""; }; 27AA74A444C2460B9A81C608 /* Roboto.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Roboto.ttf; path = "../node_modules/native-base/Fonts/Roboto.ttf"; sourceTree = ""; }; @@ -513,6 +531,7 @@ 2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; }; 2F7DAE80BB444204B07D5C2D /* RCTImageResizer.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RCTImageResizer.xcodeproj; path = "../node_modules/react-native-image-resizer/ios/RCTImageResizer.xcodeproj"; sourceTree = ""; }; 3AB30C07BB1B4CC387F906FB /* libRNCAsyncStorage.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNCAsyncStorage.a; sourceTree = ""; }; + 59BC1E49093B4DFF8E5753AB /* libRNReactNativeDocViewer.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNReactNativeDocViewer.a; sourceTree = ""; }; 5D60B774EA7D4D939088424A /* libRCTImageResizer.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTImageResizer.a; sourceTree = ""; }; 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; 6834E57085FD4C44AB3E5050 /* Foundation.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Foundation.ttf; path = "../node_modules/native-base/Fonts/Foundation.ttf"; sourceTree = ""; }; @@ -552,6 +571,7 @@ E6841AAE45184B3284931E7C /* RNDeviceInfo.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNDeviceInfo.xcodeproj; path = "../node_modules/react-native-device-info/ios/RNDeviceInfo.xcodeproj"; sourceTree = ""; }; EA036245670A426794A6F4B9 /* RNI18n.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNI18n.xcodeproj; path = "../node_modules/react-native-i18n/ios/RNI18n.xcodeproj"; sourceTree = ""; }; F640C246A10548C6A3FF65BA /* ReactNativeConfig.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = ReactNativeConfig.xcodeproj; path = "../node_modules/react-native-config/ios/ReactNativeConfig.xcodeproj"; sourceTree = ""; }; + F6BE78289C37400B99E40B91 /* libRCTPdf.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTPdf.a; sourceTree = ""; }; FDCE31F3B4E6496399924AB6 /* FontAwesome5_Brands.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Brands.ttf; path = "../node_modules/native-base/Fonts/FontAwesome5_Brands.ttf"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -593,6 +613,8 @@ 49EF6807010948DD893B2AC5 /* libRNDocumentPicker.a in Frameworks */, 043BEFC846F2412993FFA78F /* libRNFetchBlob.a in Frameworks */, 3FBF6DF7FBFA4CFA957458DC /* libRNFS.a in Frameworks */, + B90C1764E1C141EC9FA83813 /* libRNReactNativeDocViewer.a in Frameworks */, + 2CFCBFD135094AA59F079906 /* libRCTPdf.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -760,6 +782,14 @@ name = Products; sourceTree = ""; }; + 18342D8A228C1D50002F1625 /* Products */ = { + isa = PBXGroup; + children = ( + 18342D8E228C1D50002F1625 /* libRNReactNativeDocViewer.a */, + ); + name = Products; + sourceTree = ""; + }; 1893BBB4228AD3C5006F8042 /* Products */ = { isa = PBXGroup; children = ( @@ -768,6 +798,14 @@ name = Products; sourceTree = ""; }; + 18C459B1228C328A00D99CD6 /* Products */ = { + isa = PBXGroup; + children = ( + 18C459B5228C328A00D99CD6 /* libRCTPdf.a */, + ); + name = Products; + sourceTree = ""; + }; 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { isa = PBXGroup; children = ( @@ -822,6 +860,8 @@ D78B0A723383463694063846 /* RNDocumentPicker.xcodeproj */, A4BAF133580D4643AC02AA5C /* RNFetchBlob.xcodeproj */, 27C54F1CD8FC4240B9E055FA /* RNFS.xcodeproj */, + 02418A92AB704A3FBC3A6A6F /* RNReactNativeDocViewer.xcodeproj */, + 1A15E4D1A104453598CD8DD1 /* RCTPdf.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -932,6 +972,8 @@ B010A53BB0DF47489F8D1C71 /* libRNDocumentPicker.a */, C74E0958BBE64603A9E1951F /* libRNFetchBlob.a */, 22CB7E8B6BC44CEDAA021A5B /* libRNFS.a */, + 59BC1E49093B4DFF8E5753AB /* libRNReactNativeDocViewer.a */, + F6BE78289C37400B99E40B91 /* libRCTPdf.a */, ); name = "Recovered References"; sourceTree = ""; @@ -1157,6 +1199,10 @@ ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; }, + { + ProductGroup = 18C459B1228C328A00D99CD6 /* Products */; + ProjectRef = 1A15E4D1A104453598CD8DD1 /* RCTPdf.xcodeproj */; + }, { ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; @@ -1217,6 +1263,10 @@ ProductGroup = F9846EB52276843A0057B2F8 /* Products */; ProjectRef = D5DB98BECF3840C48A2BEBC7 /* RNLocalize.xcodeproj */; }, + { + ProductGroup = 18342D8A228C1D50002F1625 /* Products */; + ProjectRef = 02418A92AB704A3FBC3A6A6F /* RNReactNativeDocViewer.xcodeproj */; + }, { ProductGroup = F9846EAB227684390057B2F8 /* Products */; ProjectRef = 932071513AA64B5395889B5A /* RNVectorIcons.xcodeproj */; @@ -1314,6 +1364,13 @@ remoteRef = 181100D8228BE9350088C4FE /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 18342D8E228C1D50002F1625 /* libRNReactNativeDocViewer.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRNReactNativeDocViewer.a; + remoteRef = 18342D8D228C1D50002F1625 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 1893BBB8228AD3C6006F8042 /* libRNDocumentPicker.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -1321,6 +1378,13 @@ remoteRef = 1893BBB7228AD3C6006F8042 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 18C459B5228C328A00D99CD6 /* libRCTPdf.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTPdf.a; + remoteRef = 18C459B4228C328A00D99CD6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 2D16E6721FA4F8DC00B85C8A /* libRCTBlob-tvOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -1794,6 +1858,8 @@ "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", "$(SRCROOT)/../node_modules/react-native-fs/**", + "$(SRCROOT)/../node_modules/react-native-doc-viewer/ios/**", + "$(SRCROOT)/../node_modules/react-native-pdf/ios/RCTPdf/**", ); INFOPLIST_FILE = sunilNaikTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; @@ -1817,6 +1883,8 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -1849,6 +1917,8 @@ "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", "$(SRCROOT)/../node_modules/react-native-fs/**", + "$(SRCROOT)/../node_modules/react-native-doc-viewer/ios/**", + "$(SRCROOT)/../node_modules/react-native-pdf/ios/RCTPdf/**", ); INFOPLIST_FILE = sunilNaikTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; @@ -1872,6 +1942,8 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -1906,6 +1978,8 @@ "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", "$(SRCROOT)/../node_modules/react-native-fs/**", + "$(SRCROOT)/../node_modules/react-native-doc-viewer/ios/**", + "$(SRCROOT)/../node_modules/react-native-pdf/ios/RCTPdf/**", ); INFOPLIST_FILE = sunilNaik/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -1942,6 +2016,8 @@ "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", "$(SRCROOT)/../node_modules/react-native-fs/**", + "$(SRCROOT)/../node_modules/react-native-doc-viewer/ios/**", + "$(SRCROOT)/../node_modules/react-native-pdf/ios/RCTPdf/**", ); INFOPLIST_FILE = sunilNaik/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -1983,6 +2059,8 @@ "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", "$(SRCROOT)/../node_modules/react-native-fs/**", + "$(SRCROOT)/../node_modules/react-native-doc-viewer/ios/**", + "$(SRCROOT)/../node_modules/react-native-pdf/ios/RCTPdf/**", ); INFOPLIST_FILE = "sunilNaik-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -2005,6 +2083,8 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -2045,6 +2125,8 @@ "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", "$(SRCROOT)/../node_modules/react-native-fs/**", + "$(SRCROOT)/../node_modules/react-native-doc-viewer/ios/**", + "$(SRCROOT)/../node_modules/react-native-pdf/ios/RCTPdf/**", ); INFOPLIST_FILE = "sunilNaik-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -2067,6 +2149,8 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -2106,6 +2190,8 @@ "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", "$(SRCROOT)/../node_modules/react-native-fs/**", + "$(SRCROOT)/../node_modules/react-native-doc-viewer/ios/**", + "$(SRCROOT)/../node_modules/react-native-pdf/ios/RCTPdf/**", ); INFOPLIST_FILE = "sunilNaik-tvOSTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -2128,6 +2214,8 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -2167,6 +2255,8 @@ "$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker", "$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**", "$(SRCROOT)/../node_modules/react-native-fs/**", + "$(SRCROOT)/../node_modules/react-native-doc-viewer/ios/**", + "$(SRCROOT)/../node_modules/react-native-pdf/ios/RCTPdf/**", ); INFOPLIST_FILE = "sunilNaik-tvOSTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -2189,6 +2279,8 @@ "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", diff --git a/package-lock.json b/package-lock.json index c050c3d..ee5b419 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4758,6 +4758,11 @@ "randomfill": "^1.0.3" } }, + "crypto-js": { + "version": "3.1.9-1", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.9-1.tgz", + "integrity": "sha1-/aGedh/Ad+Af+/3G6f38WeiAbNg=" + }, "css-color-names": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", @@ -15043,6 +15048,11 @@ "resolved": "https://registry.npmjs.org/react-native-device-info/-/react-native-device-info-0.24.3.tgz", "integrity": "sha512-usW00Wk6DoXH1eRSMt07j0uYvuka3SIEnJ9girlddAacyqwfa1QMVTN4eYmtaBzuMd/avhis8iHZQ3cLaR9CMA==" }, + "react-native-doc-viewer": { + "version": "2.7.8", + "resolved": "https://registry.npmjs.org/react-native-doc-viewer/-/react-native-doc-viewer-2.7.8.tgz", + "integrity": "sha1-Q9BlMo+xt+yQ0yHlvSNHEegHyPY=" + }, "react-native-document-picker": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/react-native-document-picker/-/react-native-document-picker-2.3.0.tgz", @@ -15211,6 +15221,15 @@ } } }, + "react-native-pdf": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/react-native-pdf/-/react-native-pdf-5.0.12.tgz", + "integrity": "sha512-XHsC0rJFF+tZbuodKoufS7tpLeOd8CcUqks+Vp1J2/ob3d9Dilc4nrvP3U+LboIE0Ky8SmmCp4pVtxZ8p6vPfA==", + "requires": { + "crypto-js": "^3.1.9-1", + "prop-types": "^15.5.10" + } + }, "react-native-redux-toast": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/react-native-redux-toast/-/react-native-redux-toast-1.0.3.tgz", @@ -16302,6 +16321,30 @@ "inherits": "^2.0.1" } }, + "rn-fetch-blob": { + "version": "0.10.15", + "resolved": "https://registry.npmjs.org/rn-fetch-blob/-/rn-fetch-blob-0.10.15.tgz", + "integrity": "sha512-/m/gurTaPAvR3J843uehHhznj5k89x7XClyO5ejmbspNLNQ4ByF+kZs80wiiKGWntj+Wqo0jJu1goArXEfc0kA==", + "requires": { + "base-64": "0.1.0", + "glob": "7.0.6" + }, + "dependencies": { + "glob": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", + "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, "rst-selector-parser": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz", diff --git a/package.json b/package.json index 4daeb7a..f5f0e68 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "react-native-animatable": "^1.3.2", "react-native-config": "^0.10.0", "react-native-device-info": "^0.24.3", + "react-native-doc-viewer": "^2.7.8", "react-native-document-picker": "^2.3.0", "react-native-fetch-blob": "^0.10.8", "react-native-fs": "^2.13.3", @@ -48,6 +49,7 @@ "react-native-image-resizer": "^1.0.1", "react-native-localize": "^1.1.2", "react-native-paper": "^2.15.2", + "react-native-pdf": "^5.0.12", "react-native-redux-toast": "^1.0.3", "react-native-searchable-dropdown": "^1.0.6", "react-native-slick": "^1.0.2", @@ -60,6 +62,7 @@ "redux": "^4.0.0", "redux-saga": "^0.16.0", "reduxsauce": "0.7.0", + "rn-fetch-blob": "^0.10.15", "seamless-immutable": "^7.1.2" }, "devDependencies": {