Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

capacitor-branch-deep-links

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capacitor-branch-deep-links - npm Package Compare versions

Comparing version 0.0.1 to 1.0.0

2

package.json
{
"name": "capacitor-branch-deep-links",
"version": "0.0.1",
"version": "1.0.0",
"description": "Capacitor plugin for Branch.io deep links",

@@ -5,0 +5,0 @@ "main": "dist/esm/index.js",

@@ -5,4 +5,2 @@ # capacitor-branch-deep-links

> This is a work in progress and currently only Android is supported!
```sh

@@ -50,2 +48,21 @@ npm install capacitor-branch-deep-links

Follow the Branch docs to:
1. [Configure Branch](https://docs.branch.io/apps/android/#configure-branch)
Update `src/main/res/values/strings.xml` with your configuration:
```diff
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="app_name">Ionic Starter</string>
<string name="title_activity_main">Ionic Starter</string>
<string name="package_name">io.ionic.starter</string>
<string name="fileprovider_authority">io.ionic.starter.fileprovider</string>
+ <string name="custom_url_scheme">io.ionic.starter</string>
+ <string name="branch_key">key_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</string>
+ <string name="branch_test_key">key_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</string>
</resources>
```
Register the plugin in your Activity:

@@ -78,3 +95,3 @@

Add your Branch keys and register the install listener within `<application>`:
Provide your Branch config within `<application>`:

@@ -84,12 +101,6 @@ ```xml

<meta-data android:name="io.branch.sdk.BranchKey.test" android:value="@string/branch_test_key" />
<meta-data android:name="io.branch.sdk.TestMode" android:value="true" />
<receiver android:name="io.branch.referral.InstallListener" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<meta-data android:name="io.branch.sdk.TestMode" android:value="false" /> <!-- Set to true to use test key -->
```
Configure your Branch links as Android App links within `<application>`:
Add your Branch App Links (optional) in a new `<intent-filter>` within `<application>`:

@@ -105,1 +116,62 @@ ```xml

```
[Test that it works!](https://docs.branch.io/apps/android/#test-deep-link)
## iOS setup
Follow the Branch docs to:
1. [Configure Branch](https://docs.branch.io/apps/ios/#configure-branch)
2. [Configure bundle identifier](https://docs.branch.io/apps/ios/#configure-bundle-identifier)
3. [Configure associated domains](https://docs.branch.io/apps/ios/#configure-associated-domains)
4. [Configure entitlements](https://docs.branch.io/apps/ios/#configure-entitlements)
5. [Configure Info.plist](https://docs.branch.io/apps/ios/#configure-infoplist)
> You can use the [Branch wizard](https://dashboard.branch.io/start/existing-users/ios) to walk you through the process
(skip the *Get the SDK files* and *Start a Branch session* steps)
Add Branch to your `Podfile`:
```diff
target 'App' do
capacitor_pods
# Add your Pods here
+ pod 'Branch';
end
```
Update the project:
```bash
npx cap update ios
```
Make the following changes to your `AppDelegate.swift` file:
```diff
+ import Branch
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
+ Branch.setUseTestBranchKey(true) // if you are using the TEST key
+ Branch.getInstance()!.initSession(launchOptions: launchOptions)
return true
}
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
// Called when the app was launched with a url. Feel free to add additional processing here,
// but if you want the App API to support tracking app url opens, make sure to keep this call
+ Branch.getInstance()!.application(app, open: url, options: options)
return CAPBridge.handleOpenUrl(url, options)
}
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
// Called when the app was launched with an activity, including Universal Links.
// Feel free to add additional processing here, but if you want the App API to support
// tracking app url opens, make sure to keep this call
+ Branch.getInstance()!.continue(userActivity)
return CAPBridge.handleContinueActivity(userActivity, restorationHandler)
}
```
[Test that it works!](https://docs.branch.io/apps/ios/#test-deep-link)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc