Skip to content

Commit

Permalink
fix: updated testbed for correct share sheet navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanneff committed Jan 10, 2017
1 parent 25053e6 commit 96f7425
Showing 1 changed file with 16 additions and 25 deletions.
41 changes: 16 additions & 25 deletions testbed/www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ function BranchUniversalObject () {

// only canonicalIdentifier is required
var properties = {
canonicalIdentifier: '123',
canonicalUrl: 'http://example.com/123',
title: 'Content 123',
contentDescription: 'Content 123 ' + Date.now(),
canonicalIdentifier: 'content/123',
canonicalUrl: 'https://example.com/content/123',
title: 'Content 123 Title',
contentDescription: 'Content 123 Description ' + Date.now(),
contentImageUrl: 'http://lorempixel.com/400/400/',
price: 12.12,
currency: 'GBD',
Expand Down Expand Up @@ -169,17 +169,16 @@ function BranchDeepLink () {

// optional fields
var analytics = {
channel: 'channel',
feature: 'feature',
campaign: 'campaign',
stage: 'stage',
channel: 'facebook',
feature: 'onboarding',
campaign: 'content 123 launch',
stage: 'new user',
tags: ['one', 'two', 'three'],
alias: document.getElementById('alias').value
}

// optional fields
var properties = {
$fallback_url: 'http://www.example.com/example',
$desktop_url: 'http://www.example.com/desktop',
$android_url: 'http://www.example.com/android',
$ios_url: 'http://www.example.com/ios',
Expand All @@ -201,10 +200,10 @@ function BranchDeepLink () {
console.log(res)
document.getElementById('generated-url').placeholder = ''
document.getElementById('generated-url').value = res.url
alert(JSON.stringify(res.url))
alert(JSON.stringify('Response: ' + res.url))
}).catch(function (err) {
console.error(err)
alert(JSON.stringify(err))
alert(JSON.stringify('Error: ' + err))
})
}

Expand All @@ -213,20 +212,16 @@ function BranchShareSheet () {

// optional fields
var analytics = {
channel: 'channel',
feature: 'feature',
campaign: 'campaign',
stage: 'stage',
channel: 'facebook',
feature: 'onboarding',
campaign: 'content 123 launch',
stage: 'new user',
tags: ['one', 'two', 'three']
}

// optional fields
var properties = {
$fallback_url: 'http://www.example.com/example',
$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',
more_custom: 'data',
even_more_custom: true,
this_is_custom: 41231
Expand All @@ -243,20 +238,16 @@ function BranchShareSheet () {
branchUniversalObj.onShareSheetLaunched(function (res) {
// android only
console.log(res)
alert(JSON.stringify(res))
})
branchUniversalObj.onShareSheetDismissed(function (res) {
console.log(res)
alert(JSON.stringify(res))
})
branchUniversalObj.onLinkShareResponse(function (res) {
console.log(res)
alert(JSON.stringify(res))
})
branchUniversalObj.onChannelSelected(function (res) {
// android only
console.log(res)
alert(JSON.stringify(res))
})

// share sheet
Expand Down Expand Up @@ -293,8 +284,8 @@ function BranchReferralsLoad () {
function BranchReferralsRedeem () {
console.log('Trigger BranchReferralsRedeem()')

var reward = 1000
Branch.redeemRewards(reward).then(function (res) {
var amount = 100
Branch.redeemRewards(amount).then(function (res) {
console.log(res)
alert('Response: ' + JSON.stringify(res))
}).catch(function (err) {
Expand Down

0 comments on commit 96f7425

Please sign in to comment.