
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
branch-react-native-sdk
Advanced tools
This is a repository of our open source React Native SDK. Huge shoutout to our friends at Dispatcher, Inc. for their help in compiling the initial version of this SDK.
Tested with React Native 0.21.0.
Supports iOS and Android.
Limited Functionality!
The React Native SDK currently implements a subset of Branch features. We plan to add further functionality soon, and would gladly accept pull requests!
Wish List:
- Implement a
getShortUrl
method (getShortUrlWithLinkProperties
in iOS andgenerateShortUrl
in Android native SDKs).- Allow defining link control parameters (
addControlParam
in iOS andaddControlParameter
in Android native SDKs).- Support full set of link analytics labels and BranchUniversalObject parameters.
The SDK is available as a package on NPM. To get it, use these commands:
npm install rnpm -g
npm install --save branch-react-native-sdk
rnpm link branch-react-native-sdk
cd node_modules/branch-react-native-sdk
pod install #Only required for iOS
Sometimes rnpm
link creates incorrect relative paths, leading to compilation errors. Ensure that the following files look as described and all linked paths are correct:
// file: android/settings.gradle
...
include ':branch-react-native-sdk', ':app'
// The relative path to the branch-react-native-sdk directory tends to often be prefixed with one too many "../"s
project(':branch-react-native-sdk').projectDir = new File(rootProject.projectDir, '../node_modules/branch-react-native-sdk/android')
// file: android/app/build.gradle
...
dependencies {
...
compile project(':branch-react-native-sdk')
}
cd node_modules/branch-react-native-sdk
.pod install
.libBranch.a
Product from Pods.xcodeproj into your the Link Binary with Libraries section of Build Phases for your project’s target. Please see our main SDK Integration Guide for complete setup instructions.
var branch = require('branch-react-native-sdk');
//Receives the initSession's result as soon as it becomes available
branch.getInitSessionResultPatiently(({params, error}) => { });
branch.setDebug();
branch.getLatestReferringParams((params) => { });
branch.getFirstReferringParams((params) => { });
branch.setIdentity("Your User's ID");
branch.userCompletedAction("Purchased Item", {item: 123});
var shareOptions = {messageHeader: "Check this out!", messageBody: "Check this cool thing out: "};
var branchUniversalObject = {metadata: {prop1: "test", prop2: "abc"}, canonicalIdentifier: "RNBranchSharedObjectId", contentTitle: "Cool Content!", contentDescription: "Cool Content Description", contentImageUrl: ""};
var linkProperties = {feature: 'share', channel: 'RNApp'};
branch.showShareSheet(shareOptions, branchUniversalObject, linkProperties, ({channel, completed, error}) => {});
branch.logout();
FAQs
Branch Metrics React Native SDK
We found that branch-react-native-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.