Releases: BranchMetrics/react-native-branch-deep-linking-attribution
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.
Release 3.0.1
- Added Carthage/Build/iOS to Framework Search Paths for Carthage support.
- Uses native Branch SDKs 3.2.0 (Android), 0.27.0 (iOS).
Release 3.0.0
- Changed
implementation
toapi
in build.gradle. This exposes the native
Branch SDK to native code and avoids the need to import
io.branch.sdk.android:library
in theapp/build.gradle
, which
introduces the potential for conflicts. Theapp/build.gradle
import
viaimplementation 'io.branch.sdk.android:library:3.1.2'
is no longer necessary and should be removed. - Uses native Branch SDKs 3.1.2 (Android), 0.27.0 (iOS).
Release 3.0.0-rc.1
- Removed docs folder from distro.
- Updated to iOS SDK 0.26.0, Android 3.1.1.
- Removed Branch-SDK & react-native-branch-segment podspecs. Removed Branch
iOS SDK source code from distribution in favor of using CocoaPods. - Renamed cached_initial_event parameter +rn_cached_initial_event.
- Updated all examples to RN 0.59.6, React 16.8.6.
- NPM is not currently supported (#433). package-lock.json removed from all
examples. NPM removed from instructions in docs.
Updating to 3.0.0
- If using the
cached_initial_event
parameter, change it to
+rn_cached_initial_event
. - [Android] Add
implementation 'io.branch.sdk.android:library:3.+'
toapp/build.gradle
. - [Android] Change the call to
Branch.getAutoInstance
inApplication.onCreate
to
RNBranchModule.getAutoInstance
. - [iOS] Add version 0.26.0 of the Branch pod to your Podfile:
Pure RN app with react-native link
-
If you already have a Podfile, add
pod 'Branch', '0.26.0'
. Then run
pod install
. -
If you don't have a Podfile, add one to your
ios
subdirectory using
these contents:platform :ios, "9.0" use_frameworks! pod "Branch", "0.26.0" target "MyApp"
Change
MyApp
to the name of your application target. Install CocoaPods
if necessary: https://guides.cocoapods.org/using/getting-started.html#installation.
Runpod install
in the ios subdirectory. Note that this creates a workspace called
MyApp.xcworkspace
in the same directory. From now on, open the workspace,
not the project. -
Note that if your local podspec repo is quite old, you may need to update
it to get the current version of the Branch SDK. Do this by running
pod install --repo-update
or by runningpod repo update
before
pod install
.
Native iOS app with the react-native-branch pod
- Remove
pod 'Branch-SDK'
from your Podfile. Runpod install
.
Release 2.3.5
- Remove docs folder from distro.
- Updated native iOS SDK to 0.26.0.
Release 3.0.0-beta.3
Added react-native-branch-segment.podspec for use with the Segment integration.