Closed nsingh-branch closed 1 year ago
getBranchQRCode()
qrCode
public async createQRCode() { // optional fields var analytics = { channel: 'facebook', feature: 'onboarding', campaign: 'content 123 launch', stage: 'new user', tags: ['one', 'two', 'three'] } // optional fields var properties = { $desktop_url: 'http://www.example.com/desktop', $android_url: 'http://www.example.com/android', $ios_url: 'http://www.example.com/ios', $ipad_url: 'http://www.example.com/ipad', $match_duration: 2000, custom_string: 'data', custom_integer: Date.now(), custom_boolean: true } var settings = { width: 2000, codeColor: "#3b2016", backgroundColor: "#c79200", centerLogo: "https://cdn.britannica.com/95/156695-131-FF89C9FA/oak-tree.jpg", margin: 3, imageFormat: "PNG" } BranchDeepLinks.getBranchQRCode({analytics, properties, settings}).then((res) => { this.picToView = "data:image/png;base64," + res.qrCode; }).catch(function (err) { alert('Error getting QR code: ' + JSON.stringify(err) + err) }) }
Added a new function,
getBranchQRCode()
, to generate Branch QR codes.qrCode
that is a base64 encoded string of the generated QR code imageSample Code