From 99b45a703a6230ac1aa82efbe660b01cb365ec26 Mon Sep 17 00:00:00 2001 From: Esteban Mino Date: Fri, 5 Jun 2020 18:23:11 -0400 Subject: [PATCH 1/9] env android --- scripts/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build.sh b/scripts/build.sh index ed0902be0ea..de648065217 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -138,6 +138,7 @@ prebuild_android(){ yes | cp -rf app/core/InpageBridgeWeb3.js android/app/src/main/assets/. # Copy fonts with iconset yes | cp -rf ./app/fonts/Metamask.ttf ./android/app/src/main/assets/fonts/Metamask.ttf + source $ANDROID_ENV_FILE if [ "$PRE_RELEASE" = false ] ; then if [ -e $ANDROID_ENV_FILE ] then From 6cb1dd4780f9e1c1f06d605276b02ccd5bb13496 Mon Sep 17 00:00:00 2001 From: Esteban Mino Date: Fri, 5 Jun 2020 20:34:36 -0400 Subject: [PATCH 2/9] working --- ios/MetaMask/AppDelegate.m | 2 +- ios/Podfile.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ios/MetaMask/AppDelegate.m b/ios/MetaMask/AppDelegate.m index ca6a61949f4..fb87530c9ab 100644 --- a/ios/MetaMask/AppDelegate.m +++ b/ios/MetaMask/AppDelegate.m @@ -8,7 +8,7 @@ #import -#import +#import #if DEBUG #import diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 3c1ea015d8a..66872575dc0 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,8 +1,8 @@ PODS: - boost-for-react-native (1.63.0) - - Branch (0.28.1): - - Branch/Core (= 0.28.1) - - Branch/Core (0.28.1) + - Branch (0.32.0): + - Branch/Core (= 0.32.0) + - Branch/Core (0.32.0) - CocoaAsyncSocket (7.6.4) - CocoaLibEvent (1.0.0) - DoubleConversion (1.1.6) @@ -253,8 +253,8 @@ PODS: - React-jsinspector (0.62.2) - react-native-background-timer (2.1.1): - React - - react-native-branch (3.1.1): - - Branch (= 0.28.1) + - react-native-branch (5.0.0-beta.1): + - Branch (= 0.32.0) - React - react-native-camera (2.10.0): - React @@ -586,7 +586,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c - Branch: edf6cab0cecb437d6a6abba3a25d0a0fa6f277ec + Branch: 770a23c04d3f5410cf9231db099a444dd3060784 CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845 CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2 @@ -615,7 +615,7 @@ SPEC CHECKSUMS: React-jsiexecutor: 1540d1c01bb493ae3124ed83351b1b6a155db7da React-jsinspector: 512e560d0e985d0e8c479a54a4e5c147a9c83493 react-native-background-timer: 1b6e6b4e10f1b74c367a1fdc3c72b67c619b222b - react-native-branch: 6bbb82aef1201f87b28a96e58140fb394b042dff + react-native-branch: ed90b087f2ff6a2f81643ead0b321531877f2e69 react-native-camera: 5d4ee26d19ac5aa9a8d8663b50f53b1c1250597c react-native-netinfo: 0e563248a4b9a99c33ec29bd03c2d50767db22a6 react-native-randombytes: 3638d24759d67c68f6ccba60c52a7a8a8faa6a23 From 808e7f85e1f09d586033cb58151af7b613361949 Mon Sep 17 00:00:00 2001 From: Esteban Mino Date: Fri, 5 Jun 2020 21:01:44 -0400 Subject: [PATCH 3/9] android working --- .../src/main/java/io/metamask/MainApplication.java | 1 - app/components/Views/Entry/index.js | 4 ++-- package.json | 2 +- patches/react-native-branch+3.1.1.patch | 13 ------------- scripts/build.sh | 3 +++ yarn.lock | 7 ++++--- 6 files changed, 10 insertions(+), 20 deletions(-) delete mode 100644 patches/react-native-branch+3.1.1.patch diff --git a/android/app/src/main/java/io/metamask/MainApplication.java b/android/app/src/main/java/io/metamask/MainApplication.java index 3742540d873..d5f4f98a07f 100644 --- a/android/app/src/main/java/io/metamask/MainApplication.java +++ b/android/app/src/main/java/io/metamask/MainApplication.java @@ -6,7 +6,6 @@ import com.facebook.react.ReactInstanceManager; import com.airbnb.android.react.lottie.LottiePackage; import com.swmansion.gesturehandler.react.RNGestureHandlerPackage; -import io.branch.rnbranch.RNBranchPackage; import io.branch.rnbranch.RNBranchModule; import io.metamask.nativeModules.RCTAnalyticsPackage; import com.facebook.react.ReactNativeHost; diff --git a/app/components/Views/Entry/index.js b/app/components/Views/Entry/index.js index 67ceb750914..53bd881cca0 100644 --- a/app/components/Views/Entry/index.js +++ b/app/components/Views/Entry/index.js @@ -100,13 +100,13 @@ class Entry extends PureComponent { } } - handleDeeplinks = async ({ error, params }) => { + handleDeeplinks = ({ error, params }) => { if (error) { Logger.error(error, 'Error from Branch'); return; } if (params['+non_branch_link']) { - DeeplinkManager.setDeeplink(params['+non_branch_link']); + DeeplinkManager.parse(params['+non_branch_link']); } }; diff --git a/package.json b/package.json index 8e7322912e8..18e5bcf3917 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,7 @@ "react-native-aes-crypto": "git+ssh://git@github.com/MetaMask/react-native-aes.git#b73625d7e1ce711ed3c2fbd795eea2bda5a5e9ad", "react-native-animated-fox": "git+ssh://git@github.com/MetaMask/react-native-animated-fox.git#16e38d54d829709e497f196e31fa8ff00cdf2aa9", "react-native-background-timer": "2.1.1", - "react-native-branch": "git+ssh://git@github.com/MetaMask/react-native-branch-deep-linking-attribution.git#6abb7e34a8f77f624013bb148aed87f50e72bf8f", + "react-native-branch": "5.0.0-beta.1", "react-native-browser-polyfill": "0.1.2", "react-native-button": "git+ssh://git@github.com/MetaMask/react-native-button.git#fd79f4d6c8ced4086ba6e3021b6ed6d4a3e19cf7", "react-native-camera": "2.10.0", diff --git a/patches/react-native-branch+3.1.1.patch b/patches/react-native-branch+3.1.1.patch deleted file mode 100644 index 910a94bb4a8..00000000000 --- a/patches/react-native-branch+3.1.1.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/node_modules/react-native-branch/android/build.gradle b/node_modules/react-native-branch/android/build.gradle -index 438f0e3..3eb34a7 100755 ---- a/node_modules/react-native-branch/android/build.gradle -+++ b/node_modules/react-native-branch/android/build.gradle -@@ -13,7 +13,7 @@ android { - compileSdkVersion safeExtGet('compileSdkVersion', 26) - - defaultConfig { -- minSdkVersion safeExtGet('minSdkVersion', 16) -+ minSdkVersion safeExtGet('minSdkVersion', 19) - targetSdkVersion safeExtGet('targetSdkVersion', 26) - versionCode 1 - versionName "1.0" diff --git a/scripts/build.sh b/scripts/build.sh index de648065217..ef25369b8d6 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -110,6 +110,7 @@ prebuild(){ # Import provider cp node_modules/@metamask/mobile-provider/dist/index.js app/core/InpageBridgeWeb3.js + source $ANDROID_ENV_FILE # Load JS specific env variables if [ "$PRE_RELEASE" = false ] ; then if [ -e $JS_ENV_FILE ] @@ -126,6 +127,8 @@ prebuild_ios(){ echo "" > ios/debug.xcconfig echo "" > ios/release.xcconfig fi + echo "$IOS_ENV" | tr "|" "\n" > ios/release.xcconfig + echo "$IOS_ENV" | tr "|" "\n" > ios/debug.xcconfig # Required to install mixpanel dep git submodule update --init --recursive } diff --git a/yarn.lock b/yarn.lock index 5f3c7cdebad..482adc05c2a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10312,9 +10312,10 @@ react-native-background-timer@2.1.1: resolved "https://registry.yarnpkg.com/react-native-background-timer/-/react-native-background-timer-2.1.1.tgz#9a2489681ab2f8033c213c73272e9d4c47572cd5" integrity sha512-cuXIIv+dcG8a8qkTD8pMzeqOEZCO+UGKglZWIe1osve+yJslmCowYQff+bI9xa7NOt2w+Vtd4L3d9JonlSqODg== -"react-native-branch@git+ssh://git@github.com/MetaMask/react-native-branch-deep-linking-attribution.git#6abb7e34a8f77f624013bb148aed87f50e72bf8f": - version "3.1.1" - resolved "git+ssh://git@github.com/MetaMask/react-native-branch-deep-linking-attribution.git#6abb7e34a8f77f624013bb148aed87f50e72bf8f" +react-native-branch@5.0.0-beta.1: + version "5.0.0-beta.1" + resolved "https://registry.yarnpkg.com/react-native-branch/-/react-native-branch-5.0.0-beta.1.tgz#c32efeedb82bc9f02f228816170719e1be645aa0" + integrity sha512-HtxeEouFVdPgVQtu8UONrANkw1rsOy3mLyED/wmo2NYgoRUA5zzRNTxQ7tu73o/J5NZB4/bFDjO52oVwUeNObg== react-native-browser-polyfill@0.1.2: version "0.1.2" From c83ccc5b57d974c4cc951c348f7c71faa4093487 Mon Sep 17 00:00:00 2001 From: Esteban Mino Date: Fri, 5 Jun 2020 21:31:03 -0400 Subject: [PATCH 4/9] handle from entry --- app/components/Views/BrowserTab/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/components/Views/BrowserTab/index.js b/app/components/Views/BrowserTab/index.js index a3b35d062c3..deef816cf76 100644 --- a/app/components/Views/BrowserTab/index.js +++ b/app/components/Views/BrowserTab/index.js @@ -782,9 +782,8 @@ export class BrowserTab extends PureComponent { Logger.error(error, 'Error from Branch'); return; } - if (params['+non_branch_link']) { - this.handleBranchDeeplink(params['+non_branch_link']); - } else if (params.spotlight_identifier) { + // QA THIS + if (params.spotlight_identifier) { setTimeout(() => { this.props.navigation.setParams({ url: params.spotlight_identifier, From d1c2b98d00f91283d6c255887b019c8e80f54d57 Mon Sep 17 00:00:00 2001 From: Esteban Mino Date: Mon, 8 Jun 2020 20:26:39 -0400 Subject: [PATCH 5/9] handle ios| --- app/components/Views/Entry/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/components/Views/Entry/index.js b/app/components/Views/Entry/index.js index 53bd881cca0..6b88110f8e9 100644 --- a/app/components/Views/Entry/index.js +++ b/app/components/Views/Entry/index.js @@ -100,13 +100,16 @@ class Entry extends PureComponent { } } - handleDeeplinks = ({ error, params }) => { - if (error) { + handleDeeplinks = a => { + const { error, params, uri } = a; + if (error && !uri) { Logger.error(error, 'Error from Branch'); return; } if (params['+non_branch_link']) { DeeplinkManager.parse(params['+non_branch_link']); + } else if (uri) { + DeeplinkManager.parse(uri); } }; From 450bf88b655b0a01c9263f583762921a060f78eb Mon Sep 17 00:00:00 2001 From: Esteban Mino Date: Mon, 8 Jun 2020 22:41:31 -0400 Subject: [PATCH 6/9] ios working --- android/app/build.gradle | 2 +- app/components/Views/Entry/index.js | 7 +++---- branch.json | 4 +++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 7f6bdb5f128..65a06773909 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -261,7 +261,7 @@ dependencies { implementation "com.facebook.react:react-native:+" // From node_modules implementation 'org.chromium:v8-android:+' - implementation "io.branch.sdk.android:library:4.1.2" + implementation "io.branch.sdk.android:library:5.+" implementation 'com.mixpanel.android:mixpanel-android:5.+' diff --git a/app/components/Views/Entry/index.js b/app/components/Views/Entry/index.js index 6b88110f8e9..53137770cf8 100644 --- a/app/components/Views/Entry/index.js +++ b/app/components/Views/Entry/index.js @@ -7,7 +7,6 @@ import Engine from '../../../core/Engine'; import LottieView from 'lottie-react-native'; import SecureKeychain from '../../../core/SecureKeychain'; import setOnboardingWizardStep from '../../../actions/wizard'; -// eslint-disable-next-line import/named import { NavigationActions } from 'react-navigation'; import { connect } from 'react-redux'; import { colors } from '../../../styles/common'; @@ -100,9 +99,9 @@ class Entry extends PureComponent { } } - handleDeeplinks = a => { - const { error, params, uri } = a; - if (error && !uri) { + handleDeeplinks = ({ error, params, uri }) => { + console.log('{ error, params, uri }', error, params, uri); + if (error) { Logger.error(error, 'Error from Branch'); return; } diff --git a/branch.json b/branch.json index 2e4615e34cb..0da89326ebc 100644 --- a/branch.json +++ b/branch.json @@ -2,5 +2,7 @@ "debugMode": true, "useTestInstance": true, "delayInitToCheckForSearchAds": false, - "appleSearchAdsDebugMode": false + "appleSearchAdsDebugMode": false, + "liveKey": "${MM_BRANCH_KEY_LIVE}", + "testKey": "${MM_BRANCH_KEY_TEST}" } From 48f35f4af12328c12eb447f911d49ea637ed6f82 Mon Sep 17 00:00:00 2001 From: Esteban Mino Date: Mon, 8 Jun 2020 23:50:10 -0400 Subject: [PATCH 7/9] ios and android working --- android/app/src/main/java/io/metamask/MainApplication.java | 3 ++- branch.json | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/android/app/src/main/java/io/metamask/MainApplication.java b/android/app/src/main/java/io/metamask/MainApplication.java index d5f4f98a07f..636e562a8ee 100644 --- a/android/app/src/main/java/io/metamask/MainApplication.java +++ b/android/app/src/main/java/io/metamask/MainApplication.java @@ -55,8 +55,9 @@ public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); - RNBranchModule.getAutoInstance(this); initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); + RNBranchModule.getAutoInstance(this); + } /** * Loads Flipper in React Native templates. Call this in the onCreate method with something like diff --git a/branch.json b/branch.json index 0da89326ebc..5f3115b6cad 100644 --- a/branch.json +++ b/branch.json @@ -3,6 +3,5 @@ "useTestInstance": true, "delayInitToCheckForSearchAds": false, "appleSearchAdsDebugMode": false, - "liveKey": "${MM_BRANCH_KEY_LIVE}", - "testKey": "${MM_BRANCH_KEY_TEST}" + "branchKey": "${MM_BRANCH_KEY_LIVE}" } From d13c830800971de5c4fb185869fd5901d0842641 Mon Sep 17 00:00:00 2001 From: Esteban Mino Date: Mon, 8 Jun 2020 23:51:25 -0400 Subject: [PATCH 8/9] modify script --- app/components/Views/Entry/index.js | 1 - scripts/build.sh | 4 ---- 2 files changed, 5 deletions(-) diff --git a/app/components/Views/Entry/index.js b/app/components/Views/Entry/index.js index 53137770cf8..172b4f774c0 100644 --- a/app/components/Views/Entry/index.js +++ b/app/components/Views/Entry/index.js @@ -100,7 +100,6 @@ class Entry extends PureComponent { } handleDeeplinks = ({ error, params, uri }) => { - console.log('{ error, params, uri }', error, params, uri); if (error) { Logger.error(error, 'Error from Branch'); return; diff --git a/scripts/build.sh b/scripts/build.sh index ef25369b8d6..ed0902be0ea 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -110,7 +110,6 @@ prebuild(){ # Import provider cp node_modules/@metamask/mobile-provider/dist/index.js app/core/InpageBridgeWeb3.js - source $ANDROID_ENV_FILE # Load JS specific env variables if [ "$PRE_RELEASE" = false ] ; then if [ -e $JS_ENV_FILE ] @@ -127,8 +126,6 @@ prebuild_ios(){ echo "" > ios/debug.xcconfig echo "" > ios/release.xcconfig fi - echo "$IOS_ENV" | tr "|" "\n" > ios/release.xcconfig - echo "$IOS_ENV" | tr "|" "\n" > ios/debug.xcconfig # Required to install mixpanel dep git submodule update --init --recursive } @@ -141,7 +138,6 @@ prebuild_android(){ yes | cp -rf app/core/InpageBridgeWeb3.js android/app/src/main/assets/. # Copy fonts with iconset yes | cp -rf ./app/fonts/Metamask.ttf ./android/app/src/main/assets/fonts/Metamask.ttf - source $ANDROID_ENV_FILE if [ "$PRE_RELEASE" = false ] ; then if [ -e $ANDROID_ENV_FILE ] then From 9fc58d1b27f0d0725f0a23e1a833089f6d05dc31 Mon Sep 17 00:00:00 2001 From: Esteban Mino Date: Tue, 9 Jun 2020 16:05:11 -0400 Subject: [PATCH 9/9] fix --- branch.json | 3 +-- ios/MetaMask/Info.plist | 7 +------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/branch.json b/branch.json index 5f3115b6cad..2e4615e34cb 100644 --- a/branch.json +++ b/branch.json @@ -2,6 +2,5 @@ "debugMode": true, "useTestInstance": true, "delayInitToCheckForSearchAds": false, - "appleSearchAdsDebugMode": false, - "branchKey": "${MM_BRANCH_KEY_LIVE}" + "appleSearchAdsDebugMode": false } diff --git a/ios/MetaMask/Info.plist b/ios/MetaMask/Info.plist index 4a2adc9eb78..db63a6fa452 100644 --- a/ios/MetaMask/Info.plist +++ b/ios/MetaMask/Info.plist @@ -115,12 +115,7 @@ UIViewControllerBasedStatusBarAppearance branch_key - - live - $(MM_BRANCH_KEY_LIVE) - test - $(MM_BRANCH_KEY_TEST) - + $(MM_BRANCH_KEY_LIVE) fox_code $(MM_FOX_CODE) mixpanel_token