File tree Expand file tree Collapse file tree 5 files changed +25
-2
lines changed
src/main/java/app/akiles/reactnative Expand file tree Collapse file tree 5 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
8787dependencies {
8888 implementation " com.facebook.react:react-android"
8989 implementation " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
90- implementation ' app.akiles:sdk:2.0.0-g9ea73de '
90+ implementation ' app.akiles:sdk:2.0.0-g682a88a '
9191}
9292
9393react {
Original file line number Diff line number Diff line change @@ -69,7 +69,11 @@ class AkilesModule(reactContext: ReactApplicationContext) :
6969 .emit(eventName, params)
7070 }
7171
72- // Add override to all methods that are in the NativeAkilesSpec (matching the TypeScript Spec)
72+ @ReactMethod
73+ override fun getVersion (): String {
74+ return akiles.version
75+ }
76+
7377 @ReactMethod
7478 override fun getSessionIDs (promise : Promise ) {
7579 try {
Original file line number Diff line number Diff line change @@ -58,8 +58,10 @@ export default function App() {
5858 const [ cardEmulationSupported , setCardEmulationSupported ] = useState <
5959 boolean | null
6060 > ( null ) ;
61+ const [ sdkVersion , setSdkVersion ] = useState < string > ( '' ) ;
6162
6263 useEffect ( ( ) => {
64+ setSdkVersion ( ak . getVersion ( ) ) ;
6365 setBluetoothSupported ( ak . isBluetoothSupported ( ) ) ;
6466 ak . isCardEmulationSupported ( ) . then ( setCardEmulationSupported ) ;
6567 } , [ ] ) ;
@@ -336,6 +338,12 @@ export default function App() {
336338 keyboardShouldPersistTaps = "handled"
337339 >
338340 < View style = { styles . container } >
341+ { /* Show SDK Version */ }
342+ < Text style = { styles . label } >
343+ Akiles SDK Version:{ ' ' }
344+ < Text style = { { color : '#b0bec5' } } > { sdkVersion || 'Loading...' } </ Text >
345+ </ Text >
346+
339347 { /* Show Bluetooth and Card Emulation support */ }
340348 < Text style = { styles . label } >
341349 Bluetooth Supported:{ ' ' }
Original file line number Diff line number Diff line change @@ -362,6 +362,7 @@ export interface ScheduleRange {
362362}
363363
364364export interface Spec extends TurboModule {
365+ getVersion ( ) : string ;
365366 getSessionIDs ( ) : Promise < { error ?: ErrorInfo ; data ?: string [ ] } > ;
366367 addSession ( token : string ) : Promise < { error ?: ErrorInfo ; data ?: string } > ;
367368 removeSession ( id : string ) : Promise < { error ?: ErrorInfo } > ;
Original file line number Diff line number Diff line change @@ -512,7 +512,17 @@ function convertError(e: ErrorInfo): AkilesError {
512512 return error ;
513513}
514514
515+ /**
516+ * Get the version of the Akiles SDK.
517+ *
518+ * @returns The version string of the SDK.
519+ */
520+ export function getVersion ( ) : string {
521+ return Akiles . getVersion ( ) ;
522+ }
523+
515524export default {
525+ getVersion,
516526 getSessionIDs,
517527 addSession,
518528 removeSession,
You can’t perform that action at this time.
0 commit comments