Skip to content

Commit bffb150

Browse files
committed
Merge pull request #53 from BranchMetrics/fix/issue-49-plugin-does-not-work-by-default
removed setDebug requirement for initSession in plugin
2 parents a1927ff + 9c476fc commit bffb150

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

www/branch.js

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function executeCallback(method, callback) {
5050
* @class Branch
5151
*/
5252
var Branch = function () {
53-
this.debugMode = null;
53+
this.debugMode = false;
5454
};
5555

5656
/**
@@ -59,15 +59,7 @@ var Branch = function () {
5959
* @return (Promise)
6060
*/
6161
Branch.prototype.initSession = function () {
62-
63-
if (this.debugMode !== null) {
64-
return execute('initSession');
65-
} else {
66-
return new Promise (function (resolve, reject) {
67-
reject('Please set debug mode first.');
68-
});
69-
}
70-
62+
return execute('initSession');
7163
};
7264

7365
/**
@@ -182,7 +174,7 @@ Branch.prototype.userCompletedAction = function (action, metaData) {
182174
* --------------------------------------------------------------
183175
*/
184176
Branch.prototype.createBranchUniversalObject = function (options) {
185-
177+
186178
return new Promise(function (resolve, reject) {
187179
execute('createBranchUniversalObject', [options]).then(function () {
188180

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

203195
/**
204196
* Generates a short url.
205-
*
197+
*
206198
* @param (Object) options
207199
* @param (Object) controlParameters
208200
*
@@ -218,7 +210,7 @@ Branch.prototype.createBranchUniversalObject = function (options) {
218210
* | stage | String | The link stage |
219211
* | duration | Int | The link duration |
220212
* --------------------------------------------------
221-
*
213+
*
222214
* controlParameters:
223215
* -------------------------------------------------------
224216
* | KEY | TYPE | DESCRIPTION |
@@ -244,7 +236,7 @@ Branch.prototype.createBranchUniversalObject = function (options) {
244236
*
245237
* @param (Object) options
246238
* @param (Object) controlParameters
247-
*
239+
*
248240
* @return (Promise)
249241
*
250242
* options:
@@ -257,7 +249,7 @@ Branch.prototype.createBranchUniversalObject = function (options) {
257249
* | stage | String | The link stage |
258250
* | duration | Int | The link duration |
259251
* --------------------------------------------------
260-
*
252+
*
261253
* controlParameters:
262254
* -------------------------------------------------------
263255
* | KEY | TYPE | DESCRIPTION |
@@ -288,7 +280,7 @@ Branch.prototype.createBranchUniversalObject = function (options) {
288280
executeCallback('onShareLinkDialogLaunched', callback);
289281

290282
};
291-
283+
292284
/**
293285
* Set on share sheet dismissed listener callback.
294286
*
@@ -299,7 +291,7 @@ Branch.prototype.createBranchUniversalObject = function (options) {
299291
executeCallback('onShareLinkDialogDismissed', callback);
300292

301293
};
302-
294+
303295
/**
304296
* Set on link share listener callback.
305297
*

0 commit comments

Comments
 (0)