Skip to content

Commit

Permalink
Merge pull request #53 from BranchMetrics/fix/issue-49-plugin-does-no…
Browse files Browse the repository at this point in the history
…t-work-by-default

removed setDebug requirement for initSession in plugin
  • Loading branch information
aaustin committed Mar 3, 2016
2 parents a1927ff + 9c476fc commit bffb150
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions www/branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function executeCallback(method, callback) {
* @class Branch
*/
var Branch = function () {
this.debugMode = null;
this.debugMode = false;
};

/**
Expand All @@ -59,15 +59,7 @@ var Branch = function () {
* @return (Promise)
*/
Branch.prototype.initSession = function () {

if (this.debugMode !== null) {
return execute('initSession');
} else {
return new Promise (function (resolve, reject) {
reject('Please set debug mode first.');
});
}

return execute('initSession');
};

/**
Expand Down Expand Up @@ -182,7 +174,7 @@ Branch.prototype.userCompletedAction = function (action, metaData) {
* --------------------------------------------------------------
*/
Branch.prototype.createBranchUniversalObject = function (options) {

return new Promise(function (resolve, reject) {
execute('createBranchUniversalObject', [options]).then(function () {

Expand All @@ -202,7 +194,7 @@ Branch.prototype.createBranchUniversalObject = function (options) {

/**
* Generates a short url.
*
*
* @param (Object) options
* @param (Object) controlParameters
*
Expand All @@ -218,7 +210,7 @@ Branch.prototype.createBranchUniversalObject = function (options) {
* | stage | String | The link stage |
* | duration | Int | The link duration |
* --------------------------------------------------
*
*
* controlParameters:
* -------------------------------------------------------
* | KEY | TYPE | DESCRIPTION |
Expand All @@ -244,7 +236,7 @@ Branch.prototype.createBranchUniversalObject = function (options) {
*
* @param (Object) options
* @param (Object) controlParameters
*
*
* @return (Promise)
*
* options:
Expand All @@ -257,7 +249,7 @@ Branch.prototype.createBranchUniversalObject = function (options) {
* | stage | String | The link stage |
* | duration | Int | The link duration |
* --------------------------------------------------
*
*
* controlParameters:
* -------------------------------------------------------
* | KEY | TYPE | DESCRIPTION |
Expand Down Expand Up @@ -288,7 +280,7 @@ Branch.prototype.createBranchUniversalObject = function (options) {
executeCallback('onShareLinkDialogLaunched', callback);

};

/**
* Set on share sheet dismissed listener callback.
*
Expand All @@ -299,7 +291,7 @@ Branch.prototype.createBranchUniversalObject = function (options) {
executeCallback('onShareLinkDialogDismissed', callback);

};

/**
* Set on link share listener callback.
*
Expand Down

0 comments on commit bffb150

Please sign in to comment.