Skip to content

Commit

Permalink
rename SampleFiles to sample_files and SampleApp to Sample
Browse files Browse the repository at this point in the history
  • Loading branch information
sandra_kuzmic committed Sep 14, 2020
1 parent 9bdda62 commit cb76e7f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ xcshareddata
node_modules
.idea

/SampleApp
/Sample
25 changes: 13 additions & 12 deletions initReactNativeSampleApp.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#!/bin/bash

blink_id_plugin_path=`pwd`/BlinkID
appName=Sample

# remove any existing code
rm -rf SampleApp
rm -rf $appName

# create a sample application
# https://github.com/react-native-community/cli#using-npx-recommended
npx react-native init SampleApp --version="0.62.2" || exit 1
npx react-native init $appName --version="0.62.2" || exit 1

# enter into demo project folder
pushd SampleApp
pushd $appName

IS_LOCAL_BUILD=false || exit 1
if [ "$IS_LOCAL_BUILD" = true ]; then
Expand Down Expand Up @@ -40,11 +41,11 @@ perl -i~ -pe "BEGIN{$/ = undef;} s/maven \{/maven \{ url 'https:\\/\\/maven.micr
# adb uninstall "com.microblink.sample"
mkdir -p app/src/main/java/com/microblink/sample
mkdir -p app/src/debug/java/com/microblink/sample
mv app/src/main/java/com/sampleapp/* app/src/main/java/com/microblink/sample/
mv app/src/debug/java/com/sampleapp/* app/src/debug/java/com/microblink/sample/
rmdir app/src/main/java/com/sampleapp
rmdir app/src/debug/java/com/sampleapp
grep -rl com.sampleapp . | xargs sed -i '' s/com.sampleapp/com.microblink.sample/g
mv app/src/main/java/com/sample/* app/src/main/java/com/microblink/sample/
mv app/src/debug/java/com/sample/* app/src/debug/java/com/microblink/sample/
rmdir app/src/main/java/com/sample
rmdir app/src/debug/java/com/sample
grep -rl com.sample . | xargs sed -i '' s/com.sample/com.microblink.sample/g
./gradlew clean

popd
Expand All @@ -67,7 +68,7 @@ if [ "$IS_LOCAL_BUILD" = true ]; then
fi

# change bundle id
sed -i '' s/\$\(PRODUCT_BUNDLE_IDENTIFIER\)/com.microblink.sample/g SampleApp/Info.plist
sed -i '' s/\$\(PRODUCT_BUNDLE_IDENTIFIER\)/com.microblink.sample/g $appName/Info.plist

# go to react native root project
popd
Expand All @@ -81,12 +82,12 @@ rm -f index.ios.js
# remove index.android.js
rm -f index.android.js

cp ../SampleFiles/index.js ./
cp ../sample_files/index.js ./

# use the same index.js file for Android and iOS
cp index.js index.ios.js
cp index.js index.android.js

echo "Go to React Native project folder: cd SampleApp"
echo "Go to React Native project folder: cd $appName"
echo "To run on Android execute: react-native run-android"
echo "To run on iOS: go to SampleApp/ios and open SampleApp.xcworkspace; set your development team and add Privacy - Camera Usage Description key to Your info.plist file and press run"
echo "To run on iOS: go to $appName/ios and open $appName.xcworkspace; set your development team and add Privacy - Camera Usage Description key to Your info.plist file and press run"
4 changes: 2 additions & 2 deletions SampleFiles/index.js → sample_files/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function buildDateResult(result, key) {
return ""
}

export default class SampleApp extends Component {
export default class Sample extends Component {
constructor(props) {
super(props);

Expand Down Expand Up @@ -293,4 +293,4 @@ const styles = StyleSheet.create({
},
});

AppRegistry.registerComponent('SampleApp', () => SampleApp);
AppRegistry.registerComponent('Sample', () => Sample);

0 comments on commit cb76e7f

Please sign in to comment.