Skip to content

Commit

Permalink
Fix branch (#1621)
Browse files Browse the repository at this point in the history
* env android

* working

* android working

* handle from entry

* handle ios|

* ios working

* ios and android working

* modify script

* fix
  • Loading branch information
estebanmino authored Jun 9, 2020
1 parent b41d78e commit 3890e17
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 40 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.+'

Expand Down
4 changes: 2 additions & 2 deletions android/app/src/main/java/io/metamask/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -56,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
Expand Down
5 changes: 2 additions & 3 deletions app/components/Views/BrowserTab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 4 additions & 3 deletions app/components/Views/Entry/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -100,13 +99,15 @@ class Entry extends PureComponent {
}
}

handleDeeplinks = async ({ error, params }) => {
handleDeeplinks = ({ error, params, uri }) => {
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']);
} else if (uri) {
DeeplinkManager.parse(uri);
}
};

Expand Down
2 changes: 1 addition & 1 deletion ios/MetaMask/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import <React/RCTPushNotificationManager.h>

#import <react-native-branch/RNBranch.h>
#import <RNBranch/RNBranch.h>

#if DEBUG
#import <FlipperKit/FlipperClient.h>
Expand Down
7 changes: 1 addition & 6 deletions ios/MetaMask/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,7 @@
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>branch_key</key>
<dict>
<key>live</key>
<string>$(MM_BRANCH_KEY_LIVE)</string>
<key>test</key>
<string>$(MM_BRANCH_KEY_TEST)</string>
</dict>
<string>$(MM_BRANCH_KEY_LIVE)</string>
<key>fox_code</key>
<string>$(MM_FOX_CODE)</string>
<key>mixpanel_token</key>
Expand Down
14 changes: 7 additions & 7 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -586,7 +586,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
Branch: edf6cab0cecb437d6a6abba3a25d0a0fa6f277ec
Branch: 770a23c04d3f5410cf9231db099a444dd3060784
CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845
CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 0 additions & 13 deletions patches/react-native-branch+3.1.1.patch

This file was deleted.

7 changes: 4 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 3890e17

Please sign in to comment.