Skip to content

Commit

Permalink
Merge pull request #17 from mjmayank/branch-integration
Browse files Browse the repository at this point in the history
setup branch
  • Loading branch information
Nnanyielugo committed May 23, 2022
2 parents ccc5e4d + 6ebbf5a commit bdea8cf
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 43 deletions.
9 changes: 9 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@
<data android:scheme="zentacle"/>
<data android:scheme="https" android:host="www.zentacle.com" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="zentacle.app.link" />
<data android:scheme="https" android:host="zentacle-alternate.app.link" />
</intent-filter>
</activity>

<meta-data android:name="io.branch.sdk.BranchKey" android:value="@string/BRANCH_KEY"/>
</application>
</manifest>
18 changes: 18 additions & 0 deletions android/app/src/main/java/com/zentacle/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import android.os.Bundle;
import com.facebook.react.ReactActivity;
import org.devio.rn.splashscreen.SplashScreen;
import io.branch.rnbranch.*;
import android.content.Intent;

public class MainActivity extends ReactActivity {
@Override
Expand All @@ -18,4 +20,20 @@ protected void onCreate(Bundle savedInstanceState) {
protected String getMainComponentName() {
return "Zentacle";
}

@Override
protected void onStart() {
super.onStart();
RNBranchModule.initSession(getIntent().getData(), this);
}

@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
if (intent != null &&
intent.hasExtra("branch_force_new_session") &&
intent.getBooleanExtra("branch_force_new_session",false)) {
RNBranchModule.onNewIntent(intent);
}
}
}
2 changes: 2 additions & 0 deletions android/app/src/main/java/com/zentacle/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import io.branch.rnbranch.RNBranchModule;

public class MainApplication extends Application implements ReactApplication {

Expand Down Expand Up @@ -45,6 +46,7 @@ public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
RNBranchModule.getAutoInstance(this);
}

/**
Expand Down
36 changes: 0 additions & 36 deletions ios/GoogleService-Info.plist

This file was deleted.

1 change: 1 addition & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ target 'Zentacle' do
pod 'react-native-google-maps', :path => rn_maps_path
pod 'GoogleMaps'
pod 'Google-Maps-iOS-Utils'
pod 'react-native-branch', path: '../node_modules/react-native-branch'

use_react_native!(
:path => config[:reactNativePath],
Expand Down
12 changes: 11 additions & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ PODS:
- AppAuth/Core (1.4.0)
- AppAuth/ExternalUserAgent (1.4.0)
- boost (1.76.0)
- Branch (1.41.0)
- BVLinearGradient (2.5.6):
- React
- CocoaAsyncSocket (7.6.5)
Expand Down Expand Up @@ -337,6 +338,9 @@ PODS:
- React-jsinspector (0.66.4)
- React-logger (0.66.4):
- glog
- react-native-branch (5.4.0):
- Branch (= 1.41.0)
- React-Core
- react-native-config (1.4.5):
- react-native-config/App (= 1.4.5)
- react-native-config/App (1.4.5):
Expand Down Expand Up @@ -518,6 +522,7 @@ DEPENDENCIES:
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- react-native-branch (from `../node_modules/react-native-branch`)
- react-native-config (from `../node_modules/react-native-config`)
- react-native-date-picker (from `../node_modules/react-native-date-picker`)
- react-native-fbsdk-next (from `../node_modules/react-native-fbsdk-next`)
Expand Down Expand Up @@ -556,6 +561,7 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- AppAuth
- Branch
- CocoaAsyncSocket
- FBAEMKit
- FBSDKCoreKit
Expand Down Expand Up @@ -634,6 +640,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/jsinspector"
React-logger:
:path: "../node_modules/react-native/ReactCommon/logger"
react-native-branch:
:path: "../node_modules/react-native-branch"
react-native-config:
:path: "../node_modules/react-native-config"
react-native-date-picker:
Expand Down Expand Up @@ -706,6 +714,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
AppAuth: 31bcec809a638d7bd2f86ea8a52bd45f6e81e7c7
boost: a7c83b31436843459a1961bfd74b96033dc77234
Branch: bd6c472d6cab03206877ac86c1241327a3f217d1
BVLinearGradient: e3aad03778a456d77928f594a649e96995f1c872
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
Expand Down Expand Up @@ -754,6 +763,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: 94ce921e1d8ce7023366873ec371f3441383b396
React-jsinspector: d0374f7509d407d2264168b6d0fad0b54e300b85
React-logger: 933f80c97c633ee8965d609876848148e3fef438
react-native-branch: 5b20bf032b3a1a20d2b76e57215bd3254a137dd5
react-native-config: 6502b1879f97ed5ac570a029961fc35ea606cd14
react-native-date-picker: dc87b284b1c94327a00d2d9da1514eed75b2ee85
react-native-fbsdk-next: 3a9545d174f16ec343e7bcaf12f970fdc82feed2
Expand Down Expand Up @@ -790,6 +800,6 @@ SPEC CHECKSUMS:
Yoga: e7dc4e71caba6472ff48ad7d234389b91dadc280
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 1ad80d5c8061923165f77f426cbb964dd0ea920a
PODFILE CHECKSUM: 690daa5262e94aa35253fd8e840d0ebedc51389c

COCOAPODS: 1.10.1
2 changes: 1 addition & 1 deletion ios/Zentacle-Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//

#import <RNBranch/RNBranch.h>
10 changes: 6 additions & 4 deletions ios/Zentacle.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/* Begin PBXBuildFile section */
00E356F31AD99517003FC87E /* ZentacleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ZentacleTests.m */; };
0E0E8CB727E3813A002D79ED /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0E0E8CB627E3813A002D79ED /* GoogleService-Info.plist */; };
0E35FE66278F3E8D0080B9BF /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0E35FE65278F3E8D0080B9BF /* Launch Screen.storyboard */; };
0E992FA627E9C6DD0043CDB2 /* Config.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 0E992FA527E9C6DD0043CDB2 /* Config.xcconfig */; };
0E9C3D25279A4D410020D871 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E9C3D24279A4D410020D871 /* File.swift */; };
0EAE369A283ABF4E00A2B760 /* Zentacle.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = 0E4642132799D6E400EE1D9F /* Zentacle.entitlements */; };
0EAE369C283B0D2900A2B760 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0EAE369B283B0D2900A2B760 /* GoogleService-Info.plist */; };
0EB1366F28233FA000530DD2 /* AppTrackingTransparency.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0EB1366D28233F7300530DD2 /* AppTrackingTransparency.framework */; };
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
Expand All @@ -35,11 +36,11 @@
00E356EE1AD99517003FC87E /* ZentacleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZentacleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* ZentacleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZentacleTests.m; sourceTree = "<group>"; };
0E0E8CB627E3813A002D79ED /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
0E35FE65278F3E8D0080B9BF /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
0E4642132799D6E400EE1D9F /* Zentacle.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = Zentacle.entitlements; path = Zentacle/Zentacle.entitlements; sourceTree = "<group>"; };
0E992FA527E9C6DD0043CDB2 /* Config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; };
0E9C3D24279A4D410020D871 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = "<group>"; };
0EAE369B283B0D2900A2B760 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
0EB1366D28233F7300530DD2 /* AppTrackingTransparency.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppTrackingTransparency.framework; path = System/Library/Frameworks/AppTrackingTransparency.framework; sourceTree = SDKROOT; };
0ED8D8F3279A1E2F00944708 /* Zentacle-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Zentacle-Bridging-Header.h"; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* Zentacle.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Zentacle.app; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -132,9 +133,9 @@
isa = PBXGroup;
children = (
0E992FA527E9C6DD0043CDB2 /* Config.xcconfig */,
0EAE369B283B0D2900A2B760 /* GoogleService-Info.plist */,
0E9C3D24279A4D410020D871 /* File.swift */,
0ED8D8F3279A1E2F00944708 /* Zentacle-Bridging-Header.h */,
0E0E8CB627E3813A002D79ED /* GoogleService-Info.plist */,
0E35FE65278F3E8D0080B9BF /* Launch Screen.storyboard */,
13B07FAE1A68108700A75B9A /* Zentacle */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
Expand Down Expand Up @@ -267,11 +268,12 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0EAE369A283ABF4E00A2B760 /* Zentacle.entitlements in Resources */,
0E35FE66278F3E8D0080B9BF /* Launch Screen.storyboard in Resources */,
0E992FA627E9C6DD0043CDB2 /* Config.xcconfig in Resources */,
0E0E8CB727E3813A002D79ED /* GoogleService-Info.plist in Resources */,
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
0EAE369C283B0D2900A2B760 /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
3 changes: 3 additions & 0 deletions ios/Zentacle/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#import <RNGoogleSignin/RNGoogleSignin.h>
#import <GoogleMaps/GoogleMaps.h>
#import "ReactNativeConfig.h"
#import <RNBranch/RNBranch.h>

#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
Expand All @@ -35,6 +36,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
{
NSString* mapsApiKey = [ReactNativeConfig envFor:@"GOOGLE_MAPS_API_KEY"];
[GMSServices provideAPIKey:mapsApiKey];
[RNBranch initSessionWithLaunchOptions:launchOptions isReferrable:YES]; // <-- add this
NSURL *jsCodeLocation;
#ifdef FB_SONARKIT_ENABLED
InitializeFlipper(application);
#endif
Expand Down
4 changes: 4 additions & 0 deletions ios/Zentacle/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,9 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>branch_app_domain</key>
<string>$(BRANCH_APP_DOMAIN)</string>
<key>branch_key</key>
<string>$(BRANCH_KEY)</string>
</dict>
</plist>
5 changes: 4 additions & 1 deletion ios/Zentacle/Zentacle.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<string>Default</string>
</array>
<key>com.apple.developer.associated-domains</key>
<array/>
<array>
<string>zentacle.app.link</string>
<string>zentacle-alternate.app.link</string>
</array>
</dict>
</plist>
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"react-final-form-arrays": "^3.1.3",
"react-i18next": "^11.16.5",
"react-native": "0.66.4",
"react-native-branch": "^5.4.0",
"react-native-config": "^1.4.5",
"react-native-date-picker": "^4.1.3",
"react-native-fbsdk-next": "^6.2.0",
Expand Down

0 comments on commit bdea8cf

Please sign in to comment.