diff --git a/android/src/main/java/com/reactlibrary/IndySdkModule.java b/android/src/main/java/com/reactlibrary/IndySdkModule.java index f42900d..3fbbe5b 100644 --- a/android/src/main/java/com/reactlibrary/IndySdkModule.java +++ b/android/src/main/java/com/reactlibrary/IndySdkModule.java @@ -906,6 +906,17 @@ public void verifierVerifyProof( } } + @ReactMethod + public void generateNonce(Promise promise) { + try { + String nonce = Anoncreds.generateNonce().get(); + promise.resolve(nonce); + } catch (Exception e) { + IndySdkRejectResponse rejectResponse = new IndySdkRejectResponse(e); + promise.reject(rejectResponse.getCode(), rejectResponse.toJson(), e); + } + } + @ReactMethod public void createRevocationState( int blobStorageReaderHandle, diff --git a/src/index.js b/src/index.js index fb4dd8b..5c7987d 100644 --- a/src/index.js +++ b/src/index.js @@ -707,9 +707,6 @@ const indy = { }, async generateNonce() { - if (Platform.OS === 'android') { - throw new Error(`Unsupported operation! Platform: ${Platform.OS}`) - } return IndySdk.generateNonce(); },