From 2e4273309bb73600732d43b0643630e1253743aa Mon Sep 17 00:00:00 2001 From: shwang-branch <55446014+shwang-branch@users.noreply.github.com> Date: Thu, 31 Oct 2019 15:56:46 -0400 Subject: [PATCH 01/18] Remove android-prefix from branch-config As of version 2.7.1 android-prefix is no longer used --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 9ba6029c..bb575583 100644 --- a/README.md +++ b/README.md @@ -727,7 +727,6 @@ _Questions? [Contact us](https://support.branch.io/support/tickets/new)_ - ``` From 6c24393eeb67165013eaa8a1c8cb627faeeeb728 Mon Sep 17 00:00:00 2001 From: codinronan Date: Mon, 20 Jan 2020 03:21:50 -0600 Subject: [PATCH 02/18] 465: add associated domains entitlements in correct place --- src/scripts/hooks/beforePrepare.js | 4 +- src/scripts/ios/enableEntitlements.js | 110 --------------------- src/scripts/ios/updateAssociatedDomains.js | 22 +---- 3 files changed, 4 insertions(+), 132 deletions(-) delete mode 100644 src/scripts/ios/enableEntitlements.js diff --git a/src/scripts/hooks/beforePrepare.js b/src/scripts/hooks/beforePrepare.js index 91027b13..a5c8053c 100644 --- a/src/scripts/hooks/beforePrepare.js +++ b/src/scripts/hooks/beforePrepare.js @@ -1,9 +1,8 @@ -(function() { +(function () { // properties const configPreferences = require("../npm/processConfigXml.js"); const iosPlist = require("../ios/updatePlist.js"); - const iosCapabilities = require("../ios/enableEntitlements.js"); const iosAssociatedDomains = require("../ios/updateAssociatedDomains.js"); const IOS = "ios"; @@ -18,7 +17,6 @@ platforms.forEach(platform => { if (platform === IOS) { iosPlist.addBranchSettings(preferences); - iosCapabilities.enableAssociatedDomains(preferences); iosAssociatedDomains.addAssociatedDomains(preferences); } }); diff --git a/src/scripts/ios/enableEntitlements.js b/src/scripts/ios/enableEntitlements.js deleted file mode 100644 index 4cfb93f8..00000000 --- a/src/scripts/ios/enableEntitlements.js +++ /dev/null @@ -1,110 +0,0 @@ -(function() { - // properties - - const path = require("path"); - const compare = require("node-version-compare"); - const IOS_DEPLOYMENT_TARGET = "8.0"; - const COMMENT_KEY = /_comment$/; - const DEBUGCODESIGNIDENTITY = "iPhone Developer"; - const RELEASECODESIGNIDENTITY = "iPhone Distribution"; - - // entry - module.exports = { - enableAssociatedDomains: enableAssociatedDomains - }; - - // updates the xcode preferences to allow associated domains - function enableAssociatedDomains(preferences) { - const entitlementsFile = path.join( - preferences.projectRoot, - "platforms", - "ios", - preferences.projectName, - "Resources", - `${preferences.projectName}.entitlements` - ); - - activateAssociativeDomains( - preferences.iosProjectModule.xcode, - entitlementsFile - ); - addPbxReference(preferences.iosProjectModule.xcode, entitlementsFile); - preferences.iosProjectModule.write(); - } - - // adds entitlement files to the xcode project - function activateAssociativeDomains(xcodeProject, entitlementsFile) { - const configurations = removeComments( - xcodeProject.pbxXCBuildConfigurationSection() - ); - let config; - let configurationConfig; - let buildSettings; - - for (config in configurations) { - configurationConfig = configurations[config]; - buildSettings = configurationConfig.buildSettings; - - buildSettings.CODE_SIGN_ENTITLEMENTS = `"${entitlementsFile}"`; - - if (configurationConfig.name === 'Release') { - buildSettings.CODE_SIGN_IDENTITY = `"${RELEASECODESIGNIDENTITY}"`; - } else { - buildSettings.CODE_SIGN_IDENTITY = `"${DEBUGCODESIGNIDENTITY}"`; - } - - // if deployment target is less then the required one - increase it - if (buildSettings.IPHONEOS_DEPLOYMENT_TARGET) { - const buildDeploymentTarget = buildSettings.IPHONEOS_DEPLOYMENT_TARGET.toString(); - if (compare(buildDeploymentTarget, IOS_DEPLOYMENT_TARGET) === -1) { - buildSettings.IPHONEOS_DEPLOYMENT_TARGET = IOS_DEPLOYMENT_TARGET; - } - } else { - buildSettings.IPHONEOS_DEPLOYMENT_TARGET = IOS_DEPLOYMENT_TARGET; - } - } - } - - function addPbxReference(xcodeProject, entitlementsFile) { - const fileReferenceSection = removeComments( - xcodeProject.pbxFileReferenceSection() - ); - - if (isPbxReferenceAlreadySet(fileReferenceSection, entitlementsFile)) - return; - xcodeProject.addResourceFile(path.basename(entitlementsFile)); - } - - function isPbxReferenceAlreadySet(fileReferenceSection, entitlementsFile) { - let isAlreadyInReferencesSection = false; - let uuid; - let fileRefEntry; - - for (uuid in fileReferenceSection) { - fileRefEntry = fileReferenceSection[uuid]; - if ( - fileRefEntry.path && - fileRefEntry.path.indexOf(entitlementsFile) > -1 - ) { - isAlreadyInReferencesSection = true; - break; - } - } - - return isAlreadyInReferencesSection; - } - - // removes comments from .pbx file - function removeComments(obj) { - const keys = Object.keys(obj); - const newObj = {}; - - for (let i = 0, len = keys.length; i < len; i++) { - if (!COMMENT_KEY.test(keys[i])) { - newObj[keys[i]] = obj[keys[i]]; - } - } - - return newObj; - } -})(); diff --git a/src/scripts/ios/updateAssociatedDomains.js b/src/scripts/ios/updateAssociatedDomains.js index f921a819..eddb7563 100644 --- a/src/scripts/ios/updateAssociatedDomains.js +++ b/src/scripts/ios/updateAssociatedDomains.js @@ -1,10 +1,12 @@ -(function() { +(function () { // properties const path = require("path"); const fs = require("fs"); const plist = require("plist"); const mkpath = require("mkpath"); + // TODO [codinronan 15.01.2020]: Read these from {preferences.projectName}.plist -- + // most people don't change them, but some do, and more importantly, some people add new ones! const BUILD_TYPES = ["Debug", "Release"]; const ASSOCIATED_DOMAINS = "com.apple.developer.associated-domains"; @@ -29,24 +31,6 @@ // get the xcode .entitlements and provisioning profile .plist function getEntitlementFiles(preferences) { const files = []; - const entitlements = path.join( - preferences.projectRoot, - "platforms", - "ios", - preferences.projectName, - "Resources", - `${preferences.projectName}.entitlements` - ); - files.push( - path.join( - preferences.projectRoot, - "platforms", - "ios", - preferences.projectName, - `${preferences.projectName}.entitlements` - ) - ); - files.push(entitlements); for (let i = 0; i < BUILD_TYPES.length; i++) { const buildType = BUILD_TYPES[i]; From 60d7f81057401068defce80c1516bfecf2ea7cec Mon Sep 17 00:00:00 2001 From: codinronan Date: Mon, 20 Jan 2020 03:57:59 -0600 Subject: [PATCH 03/18] 604, 605 - Update Android, iOS sdk versions to address build issues --- package.json | 4 ++-- plugin.xml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c8fd9adf..e7234e54 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "branch-cordova-sdk", "description": "Branch Metrics Cordova SDK", "main": "src/index.js", - "version": "4.0.0", + "version": "4.0.1", "homepage": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking", "repository": { "type": "git", @@ -17,7 +17,7 @@ ], "license": "MIT", "engines": [ - { + { "name": "cordova", "version": ">=9.0.0" } diff --git a/plugin.xml b/plugin.xml index 2184665e..fba193fa 100644 --- a/plugin.xml +++ b/plugin.xml @@ -36,7 +36,7 @@ SOFTWARE. - + @@ -62,7 +62,7 @@ SOFTWARE. - + @@ -86,7 +86,7 @@ SOFTWARE. - + From 4a692b5d7f158398c9ad5b2c989329029d83786c Mon Sep 17 00:00:00 2001 From: codinronan Date: Mon, 20 Jan 2020 05:06:53 -0600 Subject: [PATCH 04/18] 601, 604: Fix build of branch ios SDK --- plugin.xml | 4 ++-- src/ios/BranchSDK.m | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugin.xml b/plugin.xml index fba193fa..cc7e6be8 100644 --- a/plugin.xml +++ b/plugin.xml @@ -24,7 +24,7 @@ SOFTWARE. + version="4.0.1"> branch-cordova-sdk @@ -85,7 +85,7 @@ SOFTWARE. - + diff --git a/src/ios/BranchSDK.m b/src/ios/BranchSDK.m index d0f9a307..25d8b6dc 100644 --- a/src/ios/BranchSDK.m +++ b/src/ios/BranchSDK.m @@ -746,7 +746,7 @@ - (void)listOnSpotlight:(CDVInvokedUrlCommand*)command { - (void)crossPlatformIds:(CDVInvokedUrlCommand *)command { NSMutableDictionary *json = [NSMutableDictionary new]; - + Branch *branch = [self getInstance]; [branch crossPlatformIdDataWithCompletion:^(BranchCrossPlatformID *cpid) { CDVPluginResult* pluginResult = nil; @@ -760,9 +760,9 @@ - (void)crossPlatformIds:(CDVInvokedUrlCommand *)command { for (BranchProbabilisticCrossPlatformID *tmp in cpid.probabiliticCrossPlatformIDs) { if (tmp.crossPlatformID && tmp.score) { NSMutableDictionary *pair = [NSMutableDictionary new]; - [pair setObject:tmp.crossPlatformID forKey:@"id"]; + [pair setObject:tmp.crossPlatformID forKey:@"id"]; [pair setObject:tmp.score forKey:@"probability"]; - [probCPIDs addObject:pair]; + [probCPIDs addObject:pair]; } } [json setObject:probCPIDs forKey:@"prob_cross_platform_ids"]; @@ -777,9 +777,9 @@ - (void)crossPlatformIds:(CDVInvokedUrlCommand *)command { - (void)lastAttributedTouchData:(CDVInvokedUrlCommand *)command { NSMutableDictionary *json = [NSMutableDictionary new]; - + Branch *branch = [self getInstance]; - [branch lastTouchAttributedDataWithCompletion:^(BranchLastAttributedTouchData * _Nullable latd) { + [branch lastAttributedTouchDataWithAttributionWindow:30 completion:^(BranchLastAttributedTouchData * _Nullable latd) { CDVPluginResult* pluginResult = nil; if (latd) { [json setObject:latd.attributionWindow forKey:@"attribution_window"]; From 7f54041c442288041d626118b5bebceeb77f61de Mon Sep 17 00:00:00 2001 From: codinronan Date: Mon, 20 Jan 2020 20:18:31 -0600 Subject: [PATCH 05/18] fix(capacitor): add explicit reference to cordova headers for capacitor builds --- src/ios/AppDelegate+BranchSdk.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ios/AppDelegate+BranchSdk.m b/src/ios/AppDelegate+BranchSdk.m index 91a968f5..d09670ca 100644 --- a/src/ios/AppDelegate+BranchSdk.m +++ b/src/ios/AppDelegate+BranchSdk.m @@ -8,6 +8,9 @@ #import #endif +// Provides Ionic Capacitor compatibility +#import + @interface AppDelegate (BranchSDK) - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler; From 4c9e4ddab4ec6896cc04d3c924164cc597031675 Mon Sep 17 00:00:00 2001 From: codinronan Date: Mon, 20 Jan 2020 20:42:41 -0600 Subject: [PATCH 06/18] feat(readme): update readme with build requirements and additional troubleshooting --- README.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/README.md b/README.md index 9ba6029c..bb6373d7 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,8 @@ _Questions? [Contact us](https://support.branch.io/support/tickets/new)_ * [Compiling: Updating the Branch SDK](#compiling-updating-the-branch-sdk) * [Compiling: Incompatible Plugins](#compiling-incompatible-plugins) * [Compiling: Errors](#compiling-errors) + * [Compiling: Capacitor](#compiling-capacitor) + * [AppStore: iOS](#appstore-ios) ## Getting Started @@ -1348,3 +1350,59 @@ _Questions? [Contact us](https://support.branch.io/support/tickets/new)_ ``` * Add `` to your `config.xml` + + * error + + ```sh + Branch.h not found + ``` + If that is the ONLY error you see, this can be fixed by upgrading dependencies. + Ensure you are using version 4.0.1 of this plugin or higher and have updated your Xcode, Cordova, and other dependencies (listed below) to the latest versions. This error arose due to an inability in CocoaPods and cordova-ios to resolve dependencies that was later fixed. + + Sometimes this error occurs when a build error occurs in the Pod project; since Branch is usually the first pod alphabetically, it'll show up as the error when attempting to build the main project (since the Pod didn't get built), even though the real error is elsewhere. Make sure to read your build log to find the original error that prevented building the Pod project. + + * error: ios build fails with Pods and CONFIGURATION_BUILD_DIR configured + + Command-line builds result in the above error. Please see the section below [Compiling: Capacitor](#compiling-capacitor) for the full list of up-to-date dependencies needed for CLI builds to work. + +* #### Compiling: Capacitor + + * ##### Version 4.0.1 of this plugin works with Ionic 4 + Cordova and Ionic 4 + Capacitor, with the following caveats: + + * We strongly recommend Node >= 10.15. Node 8 might work, but it is not tested. + * For BOTH Cordova and Capacitor, you must use Xcode >= 11.1, CocoaPods >= 1.8.4, Cordova >= 9.0.0, Ionic-CLI >= 5.1, cordova-ios >= 5.1.0 + * Every single one of these dependencies has fixes that allow the command line build, and the pod dependency resolution to work correctly + * When using Capacitor, you must add the following entries yourself to `ios/App/App/Info.plist`: + ```sh + CFBundleURLTypes + + + CFBundleURLName + com.getcapacitor.capacitor + CFBundleURLSchemes + + capacitor + + + + CFBundleURLName + branch-cordova-sdk + CFBundleURLSchemes + + [YOUR URL SCHEME HERE] + + + + branch_key + [YOUR BRANCH LIVE KEY] + branch_app_domain + [YOUR DOMAIN].app.link + ``` + * When using Capacitor, you must add your Associated Domains entitlements via the Xcode entitlement editor yourself + * This MUST be done using Xcode - this is part of Capacitor's philosophy whereby you are in control of every config file change + * Open the "Signing & Entitlements" tab in Xcode, add the Associated Domains entitlement, and add the urls found on your Branch dashboard. + +* #### AppStore: iOS + + * #### App rejected because it uses push notification features but does not declare the aps-environment key + When branch-cordova-sdk moved to use CocoaPods, a change was introduced in Cordova 9 where the separate entitlement files were no longer flattened together. This issue has been fixed in version 4.0.1 of this plugin. From de0770cc617b3bd9e2315a238b9f59c7abb2a279 Mon Sep 17 00:00:00 2001 From: codinronan Date: Mon, 20 Jan 2020 20:47:42 -0600 Subject: [PATCH 07/18] feat(readme): require minimum capacitor-ios version --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index bb6373d7..277a6169 100644 --- a/README.md +++ b/README.md @@ -1372,6 +1372,7 @@ _Questions? [Contact us](https://support.branch.io/support/tickets/new)_ * We strongly recommend Node >= 10.15. Node 8 might work, but it is not tested. * For BOTH Cordova and Capacitor, you must use Xcode >= 11.1, CocoaPods >= 1.8.4, Cordova >= 9.0.0, Ionic-CLI >= 5.1, cordova-ios >= 5.1.0 * Every single one of these dependencies has fixes that allow the command line build, and the pod dependency resolution to work correctly + * You MUST use @capacitor/ios >= 1.4.0. Versions prior to that version did not federate the OpenURL notifications to other plugins, including Branch. * When using Capacitor, you must add the following entries yourself to `ios/App/App/Info.plist`: ```sh CFBundleURLTypes From b60574853e682ecf3a247672c9b2b165dc0dbd2f Mon Sep 17 00:00:00 2001 From: codinronan Date: Mon, 20 Jan 2020 20:53:20 -0600 Subject: [PATCH 08/18] feat(readme): document removal of use_frameworks from cocoapods --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 277a6169..0e2ca274 100644 --- a/README.md +++ b/README.md @@ -1373,6 +1373,7 @@ _Questions? [Contact us](https://support.branch.io/support/tickets/new)_ * For BOTH Cordova and Capacitor, you must use Xcode >= 11.1, CocoaPods >= 1.8.4, Cordova >= 9.0.0, Ionic-CLI >= 5.1, cordova-ios >= 5.1.0 * Every single one of these dependencies has fixes that allow the command line build, and the pod dependency resolution to work correctly * You MUST use @capacitor/ios >= 1.4.0. Versions prior to that version did not federate the OpenURL notifications to other plugins, including Branch. + * `use_frameworks` has been removed from this plugin and will now be statically built. If the other podfile uses `use_frameworks` that is fine but this plugin no longer flags itself as dynamic. * When using Capacitor, you must add the following entries yourself to `ios/App/App/Info.plist`: ```sh CFBundleURLTypes From f8e1c8ad130f8ff96d22fbcbe49e898687a221f6 Mon Sep 17 00:00:00 2001 From: Adrian Marquez Date: Thu, 23 Jan 2020 20:02:51 -0600 Subject: [PATCH 09/18] bug(cpid-latd): stub cpid latd calls due to caching issue --- src/android/io/branch/BranchSDK.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/android/io/branch/BranchSDK.java b/src/android/io/branch/BranchSDK.java index 95b96d6d..ecc380bc 100644 --- a/src/android/io/branch/BranchSDK.java +++ b/src/android/io/branch/BranchSDK.java @@ -260,11 +260,15 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo } public void crossPlatformIds(CallbackContext callbackContext) { - this.instance.getCrossPlatformIds(new BranchCPIDListener(callbackContext)); + // stub call from known issue with caching + // this.instance.getCrossPlatformIds(new BranchCPIDListener(callbackContext)); + callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, false)); } public void lastAttributedTouchData(CallbackContext callbackContext) { - this.instance.getLastAttributedTouchData(new BranchLATDListener(callbackContext), 30); + // stub call from known issue with caching + // this.instance.getLastAttributedTouchData(new BranchLATDListener(callbackContext), 30); + callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, false)); } ////////////////////////////////////////////////// From 7e3fe952e23185c3c71be218dc489d3708b3e951 Mon Sep 17 00:00:00 2001 From: bklastaitis-branch Date: Tue, 28 Jan 2020 23:14:02 -0800 Subject: [PATCH 10/18] stash changes --- .idea/codeStyles/Project.xml | 116 +++++++++ ...onegap-branch-deep-linking-attribution.iml | 9 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 240 ++++++++++++++++++ plugin.xml | 2 +- src/android/.idea/android.iml | 9 + src/android/.idea/codeStyles/Project.xml | 116 +++++++++ src/android/.idea/modules.xml | 8 + src/android/.idea/vcs.xml | 6 + src/android/.idea/workspace.xml | 112 ++++++++ src/android/io/branch/BranchSDK.java | 140 +++++----- 12 files changed, 706 insertions(+), 66 deletions(-) create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/cordova-ionic-phonegap-branch-deep-linking-attribution.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 src/android/.idea/android.iml create mode 100644 src/android/.idea/codeStyles/Project.xml create mode 100644 src/android/.idea/modules.xml create mode 100644 src/android/.idea/vcs.xml create mode 100644 src/android/.idea/workspace.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 00000000..681f41ae --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,116 @@ + + + + + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
+
+
\ No newline at end of file diff --git a/.idea/cordova-ionic-phonegap-branch-deep-linking-attribution.iml b/.idea/cordova-ionic-phonegap-branch-deep-linking-attribution.iml new file mode 100644 index 00000000..d6ebd480 --- /dev/null +++ b/.idea/cordova-ionic-phonegap-branch-deep-linking-attribution.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..5c6ef1a6 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..715a554e --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BranchCrossPlatformId + BranchCPIDListener + getauto + PrefHelper + initsess + enable + API_CLASS + instance + getAutoInstance + BranchUtil + Override + initSession + this.instance.initSession + initsession + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1578681774928 + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/android/io/branch/BranchSDK.java b/src/android/io/branch/BranchSDK.java index 95b96d6d..775c8d72 100644 --- a/src/android/io/branch/BranchSDK.java +++ b/src/android/io/branch/BranchSDK.java @@ -20,6 +20,8 @@ import io.branch.indexing.BranchUniversalObject; import io.branch.referral.Branch; +import io.branch.referral.BranchUtil; +import io.branch.referral.PrefHelper; import io.branch.referral.BranchError; import io.branch.referral.BranchViewHandler; import io.branch.referral.SharingHelper; @@ -31,8 +33,8 @@ import io.branch.referral.util.ProductCategory; import io.branch.referral.util.ShareSheetStyle; -import io.branch.referral.util.BranchCrossPlatformId; -import io.branch.referral.util.BranchLastAttributedTouchData; +//import io.branch.referral.util.BranchCrossPlatformId; +//import io.branch.referral.util.BranchLastAttributedTouchData; public class BranchSDK extends CordovaPlugin { @@ -70,8 +72,13 @@ protected void pluginInitialize() { this.activity = this.cordova.getActivity(); Branch.disableInstantDeepLinking(true); - Branch.getAutoInstance(this.activity.getApplicationContext()); - + BranchUtil.setPluginType(BranchUtil.PluginType.CordovaIonic); + if (this.instance == null) { + this.instance = Branch.getAutoInstance(this.activity.getApplicationContext()); + PrefHelper.Debug("pluginInitialize, creating new Branch instance"); + } else { + PrefHelper.Debug("pluginInitialize, Branch instance already exists"); + } } /** @@ -260,11 +267,11 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo } public void crossPlatformIds(CallbackContext callbackContext) { - this.instance.getCrossPlatformIds(new BranchCPIDListener(callbackContext)); +// this.instance.getCrossPlatformIds(new BranchCPIDListener(callbackContext)); } public void lastAttributedTouchData(CallbackContext callbackContext) { - this.instance.getLastAttributedTouchData(new BranchLATDListener(callbackContext), 30); +// this.instance.getLastAttributedTouchData(new BranchLATDListener(callbackContext), 30); } ////////////////////////////////////////////////// @@ -288,7 +295,8 @@ private void initSession(CallbackContext callbackContext) { } this.sessionListener = new SessionListener(callbackContext); - this.instance = Branch.getAutoInstance(this.activity.getApplicationContext()); + Branch.enableLogging(); + PrefHelper.Debug("BranchSDK.initSession"); this.instance.initSession(this.sessionListener, data, activity); } @@ -298,6 +306,7 @@ private void reInitSession() { } this.activity = this.cordova.getActivity(); + PrefHelper.Debug("BranchSDK.reInitSession"); this.instance.reInitSession(this.activity, this.sessionListener); } @@ -609,10 +618,8 @@ private void setCookieBasedMatching(String linkDomain, CallbackContext callbackC this.activity = this.cordova.getActivity(); - Branch instance = Branch.getAutoInstance(this.activity.getApplicationContext()); - if (linkDomain != null) { - instance.enableCookieBasedMatching(linkDomain); + Branch.enableCookieBasedMatching(linkDomain); } callbackContext.success("Success"); @@ -627,7 +634,7 @@ private void setCookieBasedMatching(String linkDomain, CallbackContext callbackC */ private void setDebug(boolean isEnable, CallbackContext callbackContext) { this.activity = this.cordova.getActivity(); - Branch.getAutoInstance(this.activity.getApplicationContext()).setDebug(); + Branch.enableDebugMode(); callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, isEnable)); } @@ -641,7 +648,8 @@ private void setDebug(boolean isEnable, CallbackContext callbackContext) { */ private void disableTracking(boolean isEnable, CallbackContext callbackContext) { this.activity = this.cordova.getActivity(); - Branch.getAutoInstance(this.activity.getApplicationContext()).disableTracking(isEnable); + + this.instance.disableTracking(isEnable); callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, isEnable)); } @@ -888,59 +896,59 @@ public BranchUniversalObjectWrapper(BranchUniversalObject branchUniversalObj) { //----------- INNER CLASS LISTENERS ------------// ////////////////////////////////////////////////// - protected class BranchCPIDListener implements BranchCrossPlatformId.BranchCrossPlatformIdListener { - private CallbackContext _callbackContext; - - public BranchCPIDListener(CallbackContext callbackContext) { - this._callbackContext = callbackContext; - } - - @Override - public void onDataFetched(BranchCrossPlatformId.BranchCPID branchCPID, BranchError error) { - if (error != null) { - Log.d(LCAT, "CPID unavailable"); - this._callbackContext.error("CPID unavailable"); - } else { - - JSONObject jsonObject = new JSONObject(); - try { - jsonObject.put("developer_identity", branchCPID.getDeveloperIdentity()); - jsonObject.put("cross_platform_id", branchCPID.getCrossPlatformID()); - jsonObject.put("past_cross_platform_ids", branchCPID.getPastCrossPlatformIds()); - jsonObject.put("prob_cross_platform_ids", branchCPID.getProbabilisticCrossPlatformIds()); - } catch (JSONException e) { - // just send back and empty object on json error - jsonObject = new JSONObject(); - } - - Log.d(LCAT, jsonObject.toString()); - - PluginResult result = new PluginResult(PluginResult.Status.OK, jsonObject); - this._callbackContext.sendPluginResult(result); - } - } - } - - protected class BranchLATDListener implements BranchLastAttributedTouchData.BranchLastAttributedTouchDataListener { - private CallbackContext _callbackContext; - - public BranchLATDListener(CallbackContext callbackContext) { - this._callbackContext = callbackContext; - } - - @Override - public void onDataFetched(JSONObject jsonObject, BranchError error) { - if (error != null) { - Log.d(LCAT, "LATD unavailable"); - this._callbackContext.error("LATD unavailable"); - } else { - Log.d(LCAT, jsonObject.toString()); - - PluginResult result = new PluginResult(PluginResult.Status.OK, jsonObject); - this._callbackContext.sendPluginResult(result); - } - } - } +// protected class BranchCPIDListener implements BranchCrossPlatformId.BranchCrossPlatformIdListener { +// private CallbackContext _callbackContext; +// +// public BranchCPIDListener(CallbackContext callbackContext) { +// this._callbackContext = callbackContext; +// } +// +// @Override +// public void onDataFetched(BranchCrossPlatformId.BranchCPID branchCPID, BranchError error) { +// if (error != null) { +// Log.d(LCAT, "CPID unavailable"); +// this._callbackContext.error("CPID unavailable"); +// } else { +// +// JSONObject jsonObject = new JSONObject(); +// try { +// jsonObject.put("developer_identity", branchCPID.getDeveloperIdentity()); +// jsonObject.put("cross_platform_id", branchCPID.getCrossPlatformID()); +// jsonObject.put("past_cross_platform_ids", branchCPID.getPastCrossPlatformIds()); +// jsonObject.put("prob_cross_platform_ids", branchCPID.getProbabilisticCrossPlatformIds()); +// } catch (JSONException e) { +// // just send back and empty object on json error +// jsonObject = new JSONObject(); +// } +// +// Log.d(LCAT, jsonObject.toString()); +// +// PluginResult result = new PluginResult(PluginResult.Status.OK, jsonObject); +// this._callbackContext.sendPluginResult(result); +// } +// } +// } +// +// protected class BranchLATDListener implements BranchLastAttributedTouchData.BranchLastAttributedTouchDataListener { +// private CallbackContext _callbackContext; +// +// public BranchLATDListener(CallbackContext callbackContext) { +// this._callbackContext = callbackContext; +// } +// +// @Override +// public void onDataFetched(JSONObject jsonObject, BranchError error) { +// if (error != null) { +// Log.d(LCAT, "LATD unavailable"); +// this._callbackContext.error("LATD unavailable"); +// } else { +// Log.d(LCAT, jsonObject.toString()); +// +// PluginResult result = new PluginResult(PluginResult.Status.OK, jsonObject); +// this._callbackContext.sendPluginResult(result); +// } +// } +// } protected class BranchViewEventsListener implements BranchViewHandler.IBranchViewEvents { @@ -986,6 +994,7 @@ public void onInitFinished(JSONObject referringParams, BranchError error) { if (error == null && referringParams != null) { if (this._callbackContext != null) { + PrefHelper.Debug("success returning referringParams = " + referringParams); this._callbackContext.success(referringParams); } } else { @@ -996,6 +1005,7 @@ public void onInitFinished(JSONObject referringParams, BranchError error) { e.printStackTrace(); } if (this._callbackContext != null) { + PrefHelper.Debug("fail returning error = " + error.getMessage()); this._callbackContext.error(message); } } From bd60ff2270502a8e35bb0da7cc1e2c1bc089dfcf Mon Sep 17 00:00:00 2001 From: bklastaitis-branch Date: Thu, 30 Jan 2020 01:20:29 -0800 Subject: [PATCH 11/18] remove .idea folder changes --- .idea/codeStyles/Project.xml | 116 --------- ...onegap-branch-deep-linking-attribution.iml | 9 - .idea/modules.xml | 8 - .idea/vcs.xml | 6 - .idea/workspace.xml | 240 ------------------ src/android/.idea/android.iml | 9 - src/android/.idea/codeStyles/Project.xml | 116 --------- src/android/.idea/modules.xml | 8 - src/android/.idea/vcs.xml | 6 - src/android/.idea/workspace.xml | 112 -------- 10 files changed, 630 deletions(-) delete mode 100644 .idea/codeStyles/Project.xml delete mode 100644 .idea/cordova-ionic-phonegap-branch-deep-linking-attribution.iml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml delete mode 100644 src/android/.idea/android.iml delete mode 100644 src/android/.idea/codeStyles/Project.xml delete mode 100644 src/android/.idea/modules.xml delete mode 100644 src/android/.idea/vcs.xml delete mode 100644 src/android/.idea/workspace.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 681f41ae..00000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - -
- - - - xmlns:android - - ^$ - - - -
-
- - - - xmlns:.* - - ^$ - - - BY_NAME - -
-
- - - - .*:id - - http://schemas.android.com/apk/res/android - - - -
-
- - - - .*:name - - http://schemas.android.com/apk/res/android - - - -
-
- - - - name - - ^$ - - - -
-
- - - - style - - ^$ - - - -
-
- - - - .* - - ^$ - - - BY_NAME - -
-
- - - - .* - - http://schemas.android.com/apk/res/android - - - ANDROID_ATTRIBUTE_ORDER - -
-
- - - - .* - - .* - - - BY_NAME - -
-
-
-
-
-
\ No newline at end of file diff --git a/.idea/cordova-ionic-phonegap-branch-deep-linking-attribution.iml b/.idea/cordova-ionic-phonegap-branch-deep-linking-attribution.iml deleted file mode 100644 index d6ebd480..00000000 --- a/.idea/cordova-ionic-phonegap-branch-deep-linking-attribution.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 5c6ef1a6..00000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1ddf..00000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 715a554e..00000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - BranchCrossPlatformId - BranchCPIDListener - getauto - PrefHelper - initsess - enable - API_CLASS - instance - getAutoInstance - BranchUtil - Override - initSession - this.instance.initSession - initsession - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1578681774928 - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 49406ca8ea4c39d03028085e6e2e834c358bcfe1 Mon Sep 17 00:00:00 2001 From: bklastaitis-branch Date: Thu, 30 Jan 2020 01:24:45 -0800 Subject: [PATCH 12/18] a bit of cleanup, move enableLogging to pluginInitialize, add idea folders to gitignore --- .gitignore | 2 ++ src/android/io/branch/BranchSDK.java | 7 ++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index e717bade..f3485004 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ package-lock.json npm-debug.log* yarn-error.log* .vscode +.idea +src/android/.idea \ No newline at end of file diff --git a/src/android/io/branch/BranchSDK.java b/src/android/io/branch/BranchSDK.java index 775c8d72..d9657dd2 100644 --- a/src/android/io/branch/BranchSDK.java +++ b/src/android/io/branch/BranchSDK.java @@ -68,16 +68,14 @@ public BranchSDK() { */ @Override protected void pluginInitialize() { + PrefHelper.Debug("pluginInitialize"); this.activity = this.cordova.getActivity(); - + Branch.enableLogging(); Branch.disableInstantDeepLinking(true); BranchUtil.setPluginType(BranchUtil.PluginType.CordovaIonic); if (this.instance == null) { this.instance = Branch.getAutoInstance(this.activity.getApplicationContext()); - PrefHelper.Debug("pluginInitialize, creating new Branch instance"); - } else { - PrefHelper.Debug("pluginInitialize, Branch instance already exists"); } } @@ -295,7 +293,6 @@ private void initSession(CallbackContext callbackContext) { } this.sessionListener = new SessionListener(callbackContext); - Branch.enableLogging(); PrefHelper.Debug("BranchSDK.initSession"); this.instance.initSession(this.sessionListener, data, activity); } From 6dfa4971c80049ebc184122f4ce08928e388a940 Mon Sep 17 00:00:00 2001 From: bklastaitis-branch Date: Thu, 30 Jan 2020 02:15:41 -0800 Subject: [PATCH 13/18] fix reInitSession, still need to fix coming back from recent apps --- src/android/io/branch/BranchSDK.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/android/io/branch/BranchSDK.java b/src/android/io/branch/BranchSDK.java index d9657dd2..75097b05 100644 --- a/src/android/io/branch/BranchSDK.java +++ b/src/android/io/branch/BranchSDK.java @@ -71,7 +71,7 @@ protected void pluginInitialize() { PrefHelper.Debug("pluginInitialize"); this.activity = this.cordova.getActivity(); - Branch.enableLogging(); +// Branch.enableLogging(); Branch.disableInstantDeepLinking(true); BranchUtil.setPluginType(BranchUtil.PluginType.CordovaIonic); if (this.instance == null) { @@ -83,7 +83,7 @@ protected void pluginInitialize() { * Called when the activity receives a new intent. */ public void onNewIntent(Intent intent) { - + intent.putExtra("branch_force_new_session", true); this.activity.setIntent(intent); this.reInitSession(); From ceae29efdb11b35527f505b4f3825c80098cb8b3 Mon Sep 17 00:00:00 2001 From: bklastaitis-branch Date: Thu, 30 Jan 2020 13:45:22 -0800 Subject: [PATCH 14/18] fix signatures for cpid and latd --- src/android/io/branch/BranchSDK.java | 115 ++++++++++++++------------- 1 file changed, 58 insertions(+), 57 deletions(-) diff --git a/src/android/io/branch/BranchSDK.java b/src/android/io/branch/BranchSDK.java index 75097b05..638c4311 100644 --- a/src/android/io/branch/BranchSDK.java +++ b/src/android/io/branch/BranchSDK.java @@ -33,8 +33,9 @@ import io.branch.referral.util.ProductCategory; import io.branch.referral.util.ShareSheetStyle; -//import io.branch.referral.util.BranchCrossPlatformId; -//import io.branch.referral.util.BranchLastAttributedTouchData; +import io.branch.referral.ServerRequestGetLATD.BranchLastAttributedTouchDataListener; +import io.branch.referral.ServerRequestGetCPID.BranchCrossPlatformIdListener; +import io.branch.referral.util.BranchCPID; public class BranchSDK extends CordovaPlugin { @@ -265,11 +266,11 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo } public void crossPlatformIds(CallbackContext callbackContext) { -// this.instance.getCrossPlatformIds(new BranchCPIDListener(callbackContext)); + this.instance.getCrossPlatformIds(new BranchCPIDListener(callbackContext)); } public void lastAttributedTouchData(CallbackContext callbackContext) { -// this.instance.getLastAttributedTouchData(new BranchLATDListener(callbackContext), 30); + this.instance.getLastAttributedTouchData(new BranchLATDListener(callbackContext), 30); } ////////////////////////////////////////////////// @@ -893,59 +894,59 @@ public BranchUniversalObjectWrapper(BranchUniversalObject branchUniversalObj) { //----------- INNER CLASS LISTENERS ------------// ////////////////////////////////////////////////// -// protected class BranchCPIDListener implements BranchCrossPlatformId.BranchCrossPlatformIdListener { -// private CallbackContext _callbackContext; -// -// public BranchCPIDListener(CallbackContext callbackContext) { -// this._callbackContext = callbackContext; -// } -// -// @Override -// public void onDataFetched(BranchCrossPlatformId.BranchCPID branchCPID, BranchError error) { -// if (error != null) { -// Log.d(LCAT, "CPID unavailable"); -// this._callbackContext.error("CPID unavailable"); -// } else { -// -// JSONObject jsonObject = new JSONObject(); -// try { -// jsonObject.put("developer_identity", branchCPID.getDeveloperIdentity()); -// jsonObject.put("cross_platform_id", branchCPID.getCrossPlatformID()); -// jsonObject.put("past_cross_platform_ids", branchCPID.getPastCrossPlatformIds()); -// jsonObject.put("prob_cross_platform_ids", branchCPID.getProbabilisticCrossPlatformIds()); -// } catch (JSONException e) { -// // just send back and empty object on json error -// jsonObject = new JSONObject(); -// } -// -// Log.d(LCAT, jsonObject.toString()); -// -// PluginResult result = new PluginResult(PluginResult.Status.OK, jsonObject); -// this._callbackContext.sendPluginResult(result); -// } -// } -// } -// -// protected class BranchLATDListener implements BranchLastAttributedTouchData.BranchLastAttributedTouchDataListener { -// private CallbackContext _callbackContext; -// -// public BranchLATDListener(CallbackContext callbackContext) { -// this._callbackContext = callbackContext; -// } -// -// @Override -// public void onDataFetched(JSONObject jsonObject, BranchError error) { -// if (error != null) { -// Log.d(LCAT, "LATD unavailable"); -// this._callbackContext.error("LATD unavailable"); -// } else { -// Log.d(LCAT, jsonObject.toString()); -// -// PluginResult result = new PluginResult(PluginResult.Status.OK, jsonObject); -// this._callbackContext.sendPluginResult(result); -// } -// } -// } + protected class BranchCPIDListener implements BranchCrossPlatformIdListener { + private CallbackContext _callbackContext; + + public BranchCPIDListener(CallbackContext callbackContext) { + this._callbackContext = callbackContext; + } + + @Override + public void onDataFetched(BranchCPID branchCPID, BranchError error) { + if (error != null) { + Log.d(LCAT, "CPID unavailable"); + this._callbackContext.error("CPID unavailable"); + } else { + + JSONObject jsonObject = new JSONObject(); + try { + jsonObject.put("developer_identity", branchCPID.getDeveloperIdentity()); + jsonObject.put("cross_platform_id", branchCPID.getCrossPlatformID()); + jsonObject.put("past_cross_platform_ids", branchCPID.getPastCrossPlatformIds()); + jsonObject.put("prob_cross_platform_ids", branchCPID.getProbabilisticCrossPlatformIds()); + } catch (JSONException e) { + // just send back and empty object on json error + jsonObject = new JSONObject(); + } + + Log.d(LCAT, jsonObject.toString()); + + PluginResult result = new PluginResult(PluginResult.Status.OK, jsonObject); + this._callbackContext.sendPluginResult(result); + } + } + } + + protected class BranchLATDListener implements BranchLastAttributedTouchDataListener { + private CallbackContext _callbackContext; + + public BranchLATDListener(CallbackContext callbackContext) { + this._callbackContext = callbackContext; + } + + @Override + public void onDataFetched(JSONObject jsonObject, BranchError error) { + if (error != null) { + Log.d(LCAT, "LATD unavailable"); + this._callbackContext.error("LATD unavailable"); + } else { + Log.d(LCAT, jsonObject.toString()); + + PluginResult result = new PluginResult(PluginResult.Status.OK, jsonObject); + this._callbackContext.sendPluginResult(result); + } + } + } protected class BranchViewEventsListener implements BranchViewHandler.IBranchViewEvents { From 4aabbc4d823561493a360e622b3e18a62a7bf057 Mon Sep 17 00:00:00 2001 From: bklastaitis-branch Date: Thu, 30 Jan 2020 13:56:06 -0800 Subject: [PATCH 15/18] removed logging statements --- src/android/io/branch/BranchSDK.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/android/io/branch/BranchSDK.java b/src/android/io/branch/BranchSDK.java index 638c4311..c02876fd 100644 --- a/src/android/io/branch/BranchSDK.java +++ b/src/android/io/branch/BranchSDK.java @@ -69,10 +69,8 @@ public BranchSDK() { */ @Override protected void pluginInitialize() { - PrefHelper.Debug("pluginInitialize"); this.activity = this.cordova.getActivity(); -// Branch.enableLogging(); Branch.disableInstantDeepLinking(true); BranchUtil.setPluginType(BranchUtil.PluginType.CordovaIonic); if (this.instance == null) { @@ -294,7 +292,6 @@ private void initSession(CallbackContext callbackContext) { } this.sessionListener = new SessionListener(callbackContext); - PrefHelper.Debug("BranchSDK.initSession"); this.instance.initSession(this.sessionListener, data, activity); } @@ -304,7 +301,6 @@ private void reInitSession() { } this.activity = this.cordova.getActivity(); - PrefHelper.Debug("BranchSDK.reInitSession"); this.instance.reInitSession(this.activity, this.sessionListener); } @@ -992,7 +988,6 @@ public void onInitFinished(JSONObject referringParams, BranchError error) { if (error == null && referringParams != null) { if (this._callbackContext != null) { - PrefHelper.Debug("success returning referringParams = " + referringParams); this._callbackContext.success(referringParams); } } else { @@ -1003,7 +998,6 @@ public void onInitFinished(JSONObject referringParams, BranchError error) { e.printStackTrace(); } if (this._callbackContext != null) { - PrefHelper.Debug("fail returning error = " + error.getMessage()); this._callbackContext.error(message); } } From 5b6215b75720cdf767158ba89e8b28fdbcb23bf5 Mon Sep 17 00:00:00 2001 From: bklastaitis-branch Date: Mon, 3 Feb 2020 14:47:24 -0800 Subject: [PATCH 16/18] added plugin type and version on iOS, added plugin version on Android --- src/android/io/branch/BranchSDK.java | 3 +++ src/ios/BranchSDK.m | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/android/io/branch/BranchSDK.java b/src/android/io/branch/BranchSDK.java index 5c64255b..9490e393 100644 --- a/src/android/io/branch/BranchSDK.java +++ b/src/android/io/branch/BranchSDK.java @@ -44,6 +44,8 @@ static class BranchLinkProperties extends io.branch.referral.util.LinkProperties // Standard Debugging Variables private static final String LCAT = "CordovaBranchSDK"; + // todo pick up plugin version dynamically + private static final String BRANCH_PLUGIN_VERSION = "4.0.1"; // Private Method Properties private ArrayList branchObjectWrappers; @@ -73,6 +75,7 @@ protected void pluginInitialize() { this.activity = this.cordova.getActivity(); Branch.disableInstantDeepLinking(true); BranchUtil.setPluginType(BranchUtil.PluginType.CordovaIonic); + BranchUtil.setPluginVersion(BRANCH_PLUGIN_VERSION); if (this.instance == null) { this.instance = Branch.getAutoInstance(this.activity.getApplicationContext()); } diff --git a/src/ios/BranchSDK.m b/src/ios/BranchSDK.m index 25d8b6dc..6931e034 100644 --- a/src/ios/BranchSDK.m +++ b/src/ios/BranchSDK.m @@ -1,5 +1,7 @@ #import "BranchSDK.h" +NSString * const pluginVersion = @"4.0.1"; + @interface BranchSDK() @property (strong, nonatomic) NSString *deepLinkUrl; @@ -77,6 +79,7 @@ - (void)continueUserActivity:(CDVInvokedUrlCommand*)command - (void)initSession:(CDVInvokedUrlCommand*)command { + [[Branch getInstance] registerPluginName:"CordovaIonic" versio:pluginVersion]; [[Branch getInstance] initSessionWithLaunchOptions:nil andRegisterDeepLinkHandler:^(NSDictionary *params, NSError *error) { NSString *resultString = nil; From 6223747be128c49aec0af55a0066b00937d7ef4b Mon Sep 17 00:00:00 2001 From: bklastaitis-branch Date: Mon, 3 Feb 2020 16:00:40 -0800 Subject: [PATCH 17/18] manually bump up minor version to 4.1.0 --- plugin.xml | 2 +- src/android/io/branch/BranchSDK.java | 2 +- src/ios/BranchSDK.m | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin.xml b/plugin.xml index 4965c111..ca56879d 100644 --- a/plugin.xml +++ b/plugin.xml @@ -24,7 +24,7 @@ SOFTWARE. + version="4.1.0"> branch-cordova-sdk diff --git a/src/android/io/branch/BranchSDK.java b/src/android/io/branch/BranchSDK.java index 9490e393..9c7760d4 100644 --- a/src/android/io/branch/BranchSDK.java +++ b/src/android/io/branch/BranchSDK.java @@ -45,7 +45,7 @@ static class BranchLinkProperties extends io.branch.referral.util.LinkProperties // Standard Debugging Variables private static final String LCAT = "CordovaBranchSDK"; // todo pick up plugin version dynamically - private static final String BRANCH_PLUGIN_VERSION = "4.0.1"; + private static final String BRANCH_PLUGIN_VERSION = "4.1.0"; // Private Method Properties private ArrayList branchObjectWrappers; diff --git a/src/ios/BranchSDK.m b/src/ios/BranchSDK.m index 6931e034..199a7191 100644 --- a/src/ios/BranchSDK.m +++ b/src/ios/BranchSDK.m @@ -1,6 +1,6 @@ #import "BranchSDK.h" -NSString * const pluginVersion = @"4.0.1"; +NSString * const pluginVersion = @"4.1.0"; @interface BranchSDK() From a565c9d861f67bce30882de0c5263b29a2a364d3 Mon Sep 17 00:00:00 2001 From: bklastaitis-branch Date: Mon, 3 Feb 2020 16:00:50 -0800 Subject: [PATCH 18/18] change version to 4.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e7234e54..defab6d4 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "branch-cordova-sdk", "description": "Branch Metrics Cordova SDK", "main": "src/index.js", - "version": "4.0.1", + "version": "4.1.0", "homepage": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking", "repository": { "type": "git",