Skip to content

Commit 20d1eb8

Browse files
committed
[other] show how to use staging
1 parent e2b3837 commit 20d1eb8

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ dist
3535
dev
3636
.nyc_output
3737
test-results.json
38+
.idea/

dist/build.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3109,6 +3109,7 @@ Branch.prototype.link = wrap(callback_params.CALLBACK_ERR_DATA, function(a, b) {
31093109
});
31103110
});
31113111
Branch.prototype.qrCode = wrap(callback_params.CALLBACK_ERR_DATA, function(a, b, c, d) {
3112+
console.log("Fuck!")
31123113
utils.cleanLinkData(b).qr_code_settings = safejson.stringify(utils.convertObjectValuesToString(c || {}));
31133114
this._api(resources.qrCode, utils.cleanLinkData(b), function(e, f) {
31143115
function g() {

example.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ <h4>QR Code</h4>
8383
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
8484
<script type="text/javascript">
8585
(function(b,r,a,n,c,h,_,s,d,k){if(!b[n]||!b[n]._q){for(;s<_.length;)c(h,_[s++]);d=r.createElement(a);d.async=1;d.src="https://cdn.branch.io/branch-latest.min.js";k=r.getElementsByTagName(a)[0];k.parentNode.insertBefore(d,k);b[n]=h}})(window,document,"script","branch",function(b,r){b[r]=function(){b._q.push([r,arguments])}},{_q:[],_v:1},"addListener banner closeBanner closeJourney data deepview deepviewCta first init link logout removeListener setBranchViewData setIdentity track trackCommerceEvent logEvent disableTracking getBrowserFingerprintId crossPlatformIds lastAttributedTouchData setAPIResponseCallback qrCode setRequestMetaData setDMAParamsForEEA setAPIUrl getAPIUrl".split(" "), 0);
86+
branch.setAPIUrl("https://api.stage.branch.io");
8687

8788
branch.setAPIResponseCallback(function(url, method, requestBody, error, status, responseBody) {
8889
console.log('Request: ' + method + ' ' + url + ' body=' + JSON.stringify(requestBody));
@@ -266,6 +267,9 @@ <h4>QR Code</h4>
266267
}
267268
};
268269
branch.qrCode(qrCodeParams, qrCodeSettings, function(err, qrCode) {
270+
console.log("before err!")
271+
console.log(err)
272+
console.log("yogaba!")
269273
response.html('<img src="data:image/png;charset=utf-8;base64,' + qrCode.base64() + '" width="500" height="500">');
270274
});
271275
});

src/6_branch.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ Branch.prototype._api = function(resource, obj, callback) {
222222
if (resource.endpoint !== '/_r') {
223223
resource.destination = config.api_endpoint;
224224
}
225+
console.log("gabayo!")
225226
return this._server.request(resource, obj, this._storage, function(err, data) {
227+
console.log("callback!")
226228
callback(err, data);
227229
});
228230
};
@@ -1342,7 +1344,7 @@ Branch.prototype['qrCode'] = wrap(
13421344
utils.cleanLinkData(linkData),
13431345
function(error, rawBuffer) {
13441346
function QrCode() { }
1345-
1347+
console.log("sugma")
13461348
if (!error) {
13471349
QrCode['rawBuffer'] = rawBuffer;
13481350
QrCode['base64'] = function() {
@@ -1353,6 +1355,7 @@ Branch.prototype['qrCode'] = wrap(
13531355
throw Error('QrCode.rawBuffer is empty.');
13541356
};
13551357
}
1358+
console.log("sugmadone")
13561359
return done(error || null, QrCode || null);
13571360
}
13581361
);

0 commit comments

Comments
 (0)