|
1 | 1 | import React, { useEffect } from 'react'; |
2 | 2 | import { StyleSheet, ScrollView, View, Button } from 'react-native'; |
3 | | -import { installPlugin, listPlugins } from '../../src/protocols/fxblox'; |
| 3 | +import { installPlugin, listPlugins, getInstallOutput, getInstallStatus } from '../../src/protocols/fxblox'; |
4 | 4 |
|
5 | 5 | import { |
6 | 6 | fula, |
@@ -1164,6 +1164,74 @@ const App = () => { |
1164 | 1164 | color={inprogress ? 'green' : 'blue'} |
1165 | 1165 | /> |
1166 | 1166 | </View> |
| 1167 | + |
| 1168 | + <View style={styles.section}> |
| 1169 | + <Button |
| 1170 | + title={inprogress ? 'Getting...' : 'Test Get Output Plugins'} |
| 1171 | + onPress={async () => { |
| 1172 | + try { |
| 1173 | + if (initComplete) { |
| 1174 | + fula.checkConnection().then((r: any) => { |
| 1175 | + console.log('connection check'); |
| 1176 | + console.log(r); |
| 1177 | + if (r) { |
| 1178 | + console.log( |
| 1179 | + 'initialization is completed. send getInstallOutput plugin' |
| 1180 | + ); |
| 1181 | + fxblox |
| 1182 | + .getInstallOutput('streamr-node', 'contractAddress') |
| 1183 | + .then((res: any) => { |
| 1184 | + console.log('getInstallOutput plugins received'); |
| 1185 | + console.log(res); |
| 1186 | + }) |
| 1187 | + .catch((e: any) => { |
| 1188 | + console.log('getInstallOutput plugins failed'); |
| 1189 | + console.log(e); |
| 1190 | + }); |
| 1191 | + } |
| 1192 | + }); |
| 1193 | + } else { |
| 1194 | + console.log('wait for init to complete'); |
| 1195 | + } |
| 1196 | + } catch (e) {} |
| 1197 | + }} |
| 1198 | + color={inprogress ? 'green' : 'blue'} |
| 1199 | + /> |
| 1200 | + </View> |
| 1201 | + |
| 1202 | + <View style={styles.section}> |
| 1203 | + <Button |
| 1204 | + title={inprogress ? 'Getting...' : 'Test Get Install Status Plugins'} |
| 1205 | + onPress={async () => { |
| 1206 | + try { |
| 1207 | + if (initComplete) { |
| 1208 | + fula.checkConnection().then((r: any) => { |
| 1209 | + console.log('connection check'); |
| 1210 | + console.log(r); |
| 1211 | + if (r) { |
| 1212 | + console.log( |
| 1213 | + 'initialization is completed. send getInstallStatus plugin' |
| 1214 | + ); |
| 1215 | + fxblox |
| 1216 | + .getInstallStatus('streamr-node') |
| 1217 | + .then((res: any) => { |
| 1218 | + console.log('getInstallStatus plugins received'); |
| 1219 | + console.log(res); |
| 1220 | + }) |
| 1221 | + .catch((e: any) => { |
| 1222 | + console.log('getInstallStatus plugins failed'); |
| 1223 | + console.log(e); |
| 1224 | + }); |
| 1225 | + } |
| 1226 | + }); |
| 1227 | + } else { |
| 1228 | + console.log('wait for init to complete'); |
| 1229 | + } |
| 1230 | + } catch (e) {} |
| 1231 | + }} |
| 1232 | + color={inprogress ? 'green' : 'blue'} |
| 1233 | + /> |
| 1234 | + </View> |
1167 | 1235 | </ScrollView> |
1168 | 1236 | ); |
1169 | 1237 | }; |
|
0 commit comments