diff --git a/android/app/build.gradle b/android/app/build.gradle index f319a83bc..7fb0231ce 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -76,7 +76,7 @@ android { applicationId "app.subwallet.mobile" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 276 + versionCode 278 versionName "1.1.19" missingDimensionStrategy 'react-native-camera', 'general' } diff --git a/ios/SubWalletMobile.xcodeproj/project.pbxproj b/ios/SubWalletMobile.xcodeproj/project.pbxproj index 78eeebf47..efb3c5744 100644 --- a/ios/SubWalletMobile.xcodeproj/project.pbxproj +++ b/ios/SubWalletMobile.xcodeproj/project.pbxproj @@ -535,7 +535,7 @@ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = SubWalletMobile/SubWalletMobile.entitlements; - CURRENT_PROJECT_VERSION = 276; + CURRENT_PROJECT_VERSION = 278; DEVELOPMENT_TEAM = ZUZ7T3GQMT; ENABLE_BITCODE = NO; INFOPLIST_FILE = SubWalletMobile/Info.plist; @@ -568,7 +568,7 @@ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = SubWalletMobile/SubWalletMobile.entitlements; - CURRENT_PROJECT_VERSION = 276; + CURRENT_PROJECT_VERSION = 278; DEVELOPMENT_TEAM = ZUZ7T3GQMT; INFOPLIST_FILE = SubWalletMobile/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = SubWallet; diff --git a/package.json b/package.json index d848310a0..62af049df 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "SubWalletMobile", "version": "1.1.19", - "build": "276", + "build": "278", "bundleVersion": "a(v8)-i(v3)", "bundleVersionStaging": "a(v4)-i(v5)", "private": true, @@ -21,7 +21,9 @@ "android": "ENVFILE=.env.development react-native run-android", "ios": "ENVFILE=.env.development react-native run-ios", "android:production": "cd android && export ENVFILE=.env.production && ./gradlew bundleRelease && open app/build/outputs/bundle/release/", + "android:staging": "cd android && export ENVFILE=.env.development && ./gradlew bundleRelease && open app/build/outputs/bundle/release/", "ios:production": "scripts/build-ios.sh", + "ios:staging": "scripts/build-ios.sh staging", "lint": "eslint . --ext .js,.jsx,.ts,.tsx", "start": "react-native start", "test": "jest" diff --git a/scripts/build-ios.sh b/scripts/build-ios.sh index 93a08075e..b98573af7 100755 --- a/scripts/build-ios.sh +++ b/scripts/build-ios.sh @@ -1,10 +1,26 @@ #!/bin/sh +# How to use: +# release Appstore with bundle production: build-ios.sh or build-ios.sh production appstore +# release Appstore with bundle staging: build-ios.sh staging or build-ios.sh staging appstore +# export Adhoc with bundle production: build-ios.sh production adhoc +# export Adhoc with bundle staging: build-ios.sh staging adhoc cd ./ios rm -rf ./build && rm -rf ./dist && pod install +ENVIRONMENT=${1-"production"} +APPSTORE=${2-"appstore"} #Builds the xcarchive +if [ $ENVIRONMENT = "production" ]; then xcodebuild -workspace ./SubWalletMobile.xcworkspace -scheme SubWalletMobile-Production -sdk iphoneos -configuration Release -quiet -archivePath $PWD/dist/SubWallet.xcarchive clean archive +else +xcodebuild -workspace ./SubWalletMobile.xcworkspace -scheme SubWalletMobile-Staging -sdk iphoneos -configuration Release -quiet -archivePath $PWD/dist/SubWallet.xcarchive clean archive +fi + # Builds the ipa and uploads it to the appstore -xcodebuild -exportArchive -archivePath $PWD/dist/SubWallet.xcarchive -exportOptionsPlist exportOptions.plist -exportPath $PWD/dist \ No newline at end of file +if [ $APPSTORE = "appstore" ]; then +xcodebuild -exportArchive -archivePath $PWD/dist/SubWallet.xcarchive -exportOptionsPlist exportOptions.plist -exportPath $PWD/dist +else +xcodebuild -exportArchive -archivePath $PWD/dist/SubWallet.xcarchive -exportOptionsPlist exportAdhocOptions.plist -exportPath $PWD/dist +fi \ No newline at end of file diff --git a/src/providers/WebRunnerProvider/WebRunner.tsx b/src/providers/WebRunnerProvider/WebRunner.tsx index d9c25da13..fbc0cede7 100644 --- a/src/providers/WebRunnerProvider/WebRunner.tsx +++ b/src/providers/WebRunnerProvider/WebRunner.tsx @@ -378,6 +378,15 @@ export const WebRunner = React.memo(({ webRunnerRef, webRunnerStateRef, webRunne } }; + const onLoadProgress = () => { + // BACKUP-002: Back up local storage for first open app purpose + if (webRunnerRef.current) { + webRunnerRef.current.injectJavaScript( + 'window.ReactNativeWebView.postMessage(JSON.stringify({backupStorage: window.localStorage || ""}));', + ); + } + }; + return ( {runnerGlobalState.uri && ( @@ -389,6 +398,7 @@ export const WebRunner = React.memo(({ webRunnerRef, webRunnerStateRef, webRunne injectedJavaScript={runnerGlobalState.injectScript} webviewDebuggingEnabled onLoadStart={onLoadStart} + onLoadProgress={onLoadProgress} onError={e => console.debug('### WebRunner error', e)} onHttpError={e => console.debug('### WebRunner HttpError', e)} javaScriptEnabled={true}