diff --git a/Examples/RN0747/.bundle/config b/Examples/RN0747/.bundle/config deleted file mode 100644 index 848943bb5..000000000 --- a/Examples/RN0747/.bundle/config +++ /dev/null @@ -1,2 +0,0 @@ -BUNDLE_PATH: "vendor/bundle" -BUNDLE_FORCE_RUBY_PLATFORM: 1 diff --git a/Examples/RN0747/.eslintrc.js b/Examples/RN0747/.eslintrc.js deleted file mode 100644 index 187894b6a..000000000 --- a/Examples/RN0747/.eslintrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - root: true, - extends: '@react-native', -}; diff --git a/Examples/RN0747/.gitignore b/Examples/RN0747/.gitignore deleted file mode 100644 index d5ae45669..000000000 --- a/Examples/RN0747/.gitignore +++ /dev/null @@ -1,74 +0,0 @@ -# OSX -# -.DS_Store - -# Xcode -# -build/ -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata -*.xccheckout -*.moved-aside -DerivedData -*.hmap -*.ipa -*.xcuserstate -**/.xcode.env.local - -# Android/IntelliJ -# -build/ -.idea -.gradle -local.properties -*.iml -*.hprof -.cxx/ -*.keystore -!debug.keystore - -# node.js -# -node_modules/ -npm-debug.log -yarn-error.log - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/ - -**/fastlane/report.xml -**/fastlane/Preview.html -**/fastlane/screenshots -**/fastlane/test_output - -# Bundle artifact -*.jsbundle - -# Ruby / CocoaPods -**/Pods/ -/vendor/bundle/ - -# Temporary files created by Metro to check the health of the file watcher -.metro-health-check* - -# testing -/coverage - -# Yarn -.yarn/* -!.yarn/patches -!.yarn/plugins -!.yarn/releases -!.yarn/sdks -!.yarn/versions diff --git a/Examples/RN0747/.prettierrc.js b/Examples/RN0747/.prettierrc.js deleted file mode 100644 index 2b540746a..000000000 --- a/Examples/RN0747/.prettierrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - arrowParens: 'avoid', - bracketSameLine: true, - bracketSpacing: false, - singleQuote: true, - trailingComma: 'all', -}; diff --git a/Examples/RN0747/.watchmanconfig b/Examples/RN0747/.watchmanconfig deleted file mode 100644 index 0967ef424..000000000 --- a/Examples/RN0747/.watchmanconfig +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/Examples/RN0747/App.tsx b/Examples/RN0747/App.tsx deleted file mode 100644 index a2567a56d..000000000 --- a/Examples/RN0747/App.tsx +++ /dev/null @@ -1,191 +0,0 @@ -import React, { useCallback, useState } from 'react'; -import { - Button, - Platform, - ScrollView, - StatusBar, - Text, - TextInput, - View, -} from 'react-native'; -import CodePush, { - ReleaseHistoryInterface, - UpdateCheckRequest, -} from '@bravemobile/react-native-code-push'; -import { SafeAreaProvider, useSafeAreaInsets } from 'react-native-safe-area-context'; - -// Set this to true before run `npx code-push release` to release a new bundle -const IS_RELEASING_BUNDLE = false; - -const REACT_NATIVE_VERSION = (() => { - const { major, minor, patch, prerelease } = Platform.constants.reactNativeVersion; - return `${major}.${minor}.${patch}` + (prerelease ? `-${prerelease}` : ''); -})(); - -function App() { - const { top } = useSafeAreaInsets(); - const [syncResult, setSyncResult] = useState(''); - const [progress, setProgress] = useState(0); - const [runningMetadata, setRunningMetadata] = useState(''); - const [pendingMetadata, setPendingMetadata] = useState(''); - const [latestMetadata, setLatestMetadata] = useState(''); - - const handleSync = useCallback(() => { - CodePush.sync( - {}, - status => { - setSyncResult(findKeyByValue(CodePush.SyncStatus, status) ?? ''); - }, - ({ receivedBytes, totalBytes }) => { - setProgress(Math.round((receivedBytes / totalBytes) * 100)); - }, - mismatch => { - console.log('CodePush mismatch', JSON.stringify(mismatch, null, 2)); - }, - ).catch(error => { - console.error(error); - console.log('Sync failed', error.message ?? 'Unknown error'); - }); - }, []); - - const handleMetadata = useCallback(async () => { - const [running, pending, latest] = await Promise.all([ - CodePush.getUpdateMetadata(CodePush.UpdateState.RUNNING), - CodePush.getUpdateMetadata(CodePush.UpdateState.PENDING), - CodePush.getUpdateMetadata(CodePush.UpdateState.LATEST), - ]); - setRunningMetadata(JSON.stringify(running ?? null, null, 2)); - setPendingMetadata(JSON.stringify(pending ?? null, null, 2)); - setLatestMetadata(JSON.stringify(latest ?? null, null, 2)); - }, []); - - return ( - - - {`React Native ${REACT_NATIVE_VERSION}`} - - {IS_RELEASING_BUNDLE && - {'UPDATED!'} - } - - - -