Releases: BranchMetrics/react-native-branch-deep-linking-attribution
Release 3.2.1
For use with react-native < 0.60
This release includes Branch native SDKs Android 5.0.0 and iOS 0.32.0.
Release 4.4.0
For use with react-native >= 0.60
- This release includes Branch native SDKs Android 4.3.2 and iOS 0.31.3.
- Introduced an
enableFacebookLinkCheck
Boolean parameter in branch.json. This results in callingenableFacebookAppLinkCheck()
on Android andregisterFacebookDeepLinkingClass:
on iOS for use withreact-native-fbsdk
. Advanced users: You can still call these methods in native code as before if your use case dictates.
Release 3.2.0
For use with react-native < 0.60
- This release includes Branch native SDKs Android 4.3.2 and iOS 0.31.3.
- Fixed a crash due to NPE on Android experienced by some users. Now an error should be properly reported.
- Introduced an
enableFacebookLinkCheck
Boolean parameter in branch.json. This results in callingenableFacebookAppLinkCheck()
on Android andregisterFacebookDeepLinkingClass:
on iOS for use withreact-native-fbsdk
. Advanced users: You can still call these methods in native code as before if your use case dictates.
Release 3.1.2
This release, for React Native < 0.60, updates native SDK support to Android 4.3.2 and iOS 0.31.3.
Release 4.3.0
Requires RN >= 0.60
Uses native Branch SDKs 4.3.2 (Android), 0.31.x (iOS).
SDK-802 accept PR to expose setMetadata at the JS layer
SDK-714 add plugin identifier
Addresses several github issues.
Release 4.2.1
Requires RN >= 0.60
Uses native Branch SDKs 4.1.0 (Android), 0.29.0 (iOS).
Added new Android API to handle foreground links.
Release 4.1.0
- Requires RN >= 0.60
- Added optional argument to getLatestReferringParams to allow deferring
promise resolution. - Uses native Branch SDKs 3.2.0 (Android), 0.27.1 (iOS).
Release 3.1.1
- Requires RN < 0.60
- Fix a runtime iOS issue in 3.1.0
- Uses native Branch SDKs 3.2.0 (Android), 0.27.1 (iOS).
Release 3.1.0
- Requires RN < 0.60
- Added optional argument to getLatestReferringParams to allow deferring
promise resolution. - Fix clicked_branch_link false positive (#466) from @sjchmiela.
- Uses native Branch SDKs 3.2.0 (Android), 0.27.1 (iOS).
Note: This release will throw a runtime error on iOS. Please use 3.1.1 instead.
Release 4.0.0
- Full support for React Native 0.60, AndroidX and autolinking
- Fix clicked_branch_link false positive (#466) from @sjchmiela.
- Uses native Branch SDKs 3.2.0 (Android), 0.27.1 (iOS).
react-native-branch 4.0
Updating from 3.x
React Native 0.60 required
The peer dependency on the react-native package for version 4.x is ^0.60.0.
It is not possible to build using older versions of react-native. Your app
must be updated to use react-native 0.60 or later.
AndroidX required
Android support requires converting your app to AndroidX.
CocoaPods required
CocoaPods is the mainstream integration path for iOS as of react-native 0.60.
Version 4.0.0 of this SDK may not work with any other option. This may be
revisited in the future, but it's not yet clear how feasible it would be to
support any other option. At any rate, if an RN 0.60 app is set up to use
CocoaPods with use_native_modules!
, the CocoaPods integration of
react-native-branch will be automatic. It might be necessary to disable
CocoaPods throughout a RN app in order to support any other solution for this
SDK.
Autolinking
The react-native link
command is no longer required. Once you have updated
your app to RN 0.60, run react-native unlink
once for every native dependency,
including this one:
react-native unlink react-native-branch
This will remove entries for this SDK from your Podfile, settings.gradle and
app/build.gradle. It will also remove some code from your MainApplication.java
if you are still using RNBranchPackage
. The entire getPackages()
method in
your MainApplication.java with RN 0.60 should look like this:
@Override
protected List<ReactPackage> getPackages() {
return new PackageList(this).getPackages();
}
No mention of RNBranch is necessary in that method. Note: The call to
RNBranchModule.getAutoInstance(this);
is still required in onCreate()
as
well as the integration steps in MainActivity.java.
After running react-native unlink react-native-branch
(and any other native
modules), it is necessary also to run:
cd ios
pod install
It may be necessary to run pod update
instead of pod install
if the version
number of anything under node_modules
has increased.
Update iOS imports
If you are using Objective-C, you can use:
#import <RNBranch/RNBranch.h>
This form is independent of other build options. Clang will automatically
convert it to @import RNBranch;
whenever possible. As of version 0.60.3,
react-native does not support use_frameworks!
in a Podfile. See
facebook/react-native#25349. Once that is
supported, the same #import <RNBranch/RNBranch.h>
will still work. However,
with use_frameworks!
you will also have the option to explicitly use
@import RNBranch;
.
Swift apps usually require use_frameworks!
. It is possible to use this SDK
with Swift and RN 0.60.3 by adding #import <RNBranch/RNBranch.h>
to a
bridging header. A Swift import statement will not work without
use_frameworks!
. Once that is supported, you can use import RNBranch
in
your Swift source code.
See webview_example_native_ios for
an example of a Swift app using a Swift pod with use_frameworks!
while
disabling that option for all native modules. It uses a bridging header to
import React and RNBranch.
The previous include path, react-native-branch
caused problems with Clang,
CocoaPods and React Native because of the hyphens.
branch.json
The postlink hook that added branch.json
to a project automatically when
running react-native link
has been removed. It is currently necessary to
integrate branch.json
manually as described here.
Note that if you run react-native unlink react-native-branch
after updating to
version 4.0.0, there is no postunlink hook, and branch.json will not be removed
from your project if found. Manual integration is only necessary for new projects.
New installations
In an app using RN 0.60, simply run:
yarn add react-native-branch
cd ios
pod install
Add branch.json to your project manually as described above if you wish.
Note you should not run react-native link
for this SDK.
Then follow the common Branch setup instructions.
Finally:
react-native run-ios
or
react-native run-android
Or use Xcode/AndroidStudio to open, build and run your app.