@@ -3,7 +3,7 @@ import { ScrollView, StyleSheet, Text, View } from 'react-native'
33
44import Button from './Button'
55
6- import branch from 'react-native-branch'
6+ import branch , { RegisterViewEvent } from 'react-native-branch'
77
88const defaultBUO = {
99 title : 'wallo'
@@ -42,18 +42,6 @@ class BranchMethods extends Component {
4242 }
4343 }
4444
45- registerView = async ( ) => {
46- if ( ! this . buo ) await this . createBranchUniversalObject ( )
47- try {
48- let result = await this . buo . registerView ( )
49- console . log ( 'registerView' , result )
50- this . addResult ( 'success' , 'registerView' , result )
51- } catch ( err ) {
52- console . log ( 'registerView err' , err . toString ( ) )
53- this . addResult ( 'error' , 'registerView' , err . toString ( ) )
54- }
55- }
56-
5745 listOnSpotlight = async ( ) => {
5846 if ( ! this . buo ) await this . createBranchUniversalObject ( )
5947 try {
@@ -111,6 +99,18 @@ class BranchMethods extends Component {
11199 }
112100 }
113101
102+ userCompletedAction = async ( ) => {
103+ if ( ! this . buo ) await this . createBranchUniversalObject ( )
104+ try {
105+ let result = await this . buo . userCompletedAction ( RegisterViewEvent )
106+ console . log ( 'userCompletedAction' , result )
107+ this . addResult ( 'success' , 'userCompletedAction' , result )
108+ } catch ( err ) {
109+ console . log ( 'userCompletedAction err' , err . toString ( ) )
110+ this . addResult ( 'error' , 'userCompletedAction' , err . toString ( ) )
111+ }
112+ }
113+
114114 addResult ( type , slug , payload ) {
115115 let result = { type, slug, payload }
116116 this . setState ( {
@@ -138,8 +138,8 @@ class BranchMethods extends Component {
138138 < Text style = { styles . header } > METHODS</ Text >
139139 < ScrollView style = { styles . buttonsContainer } >
140140 < Button onPress = { this . createBranchUniversalObject } > createBranchUniversalObject</ Button >
141+ < Button onPress = { this . userCompletedAction } > userCompletedAction</ Button >
141142 < Button onPress = { this . generateShortUrl } > generateShortUrl</ Button >
142- < Button onPress = { this . registerView } > registerView</ Button >
143143 < Button onPress = { this . listOnSpotlight } > listOnSpotlight</ Button >
144144 < Button onPress = { this . showShareSheet } > showShareSheet</ Button >
145145 < Button onPress = { this . redeemRewards . bind ( this , '' ) } > redeemRewards</ Button >
0 commit comments