AbsaOSS / rn-indy-sdk

This code was starting point of https://github.com/hyperledger/indy-sdk-react-native where the work continues.
Apache License 2.0
11 stars 6 forks source link

Android: buildGetAcceptanceMechanismsRequest throws CommonInvalidParam4 Error #36

Closed TheArhaam closed 3 years ago

TheArhaam commented 3 years ago

buildGetAcceptanceMechanismsRequest throws CommonInvalidParam4, caused by Invalid pointer has been passed

IndySdkModule.java

@ReactMethod
    public void buildGetAcceptanceMechanismsRequest(String submitterDid, int timestamp, String version, Promise promise) {
        try {
            String request = Ledger.buildGetAcceptanceMechanismsRequest(submitterDid, timestamp, version).get();
            promise.resolve(request);
        } catch (Exception e) {
            IndySdkRejectResponse rejectResponse = new IndySdkRejectResponse(e);
            promise.reject(rejectResponse.getCode(), rejectResponse.toJson(), e);
        }
    }

index.js

async buildGetAcceptanceMechanismsRequest(submitterDid: Did, timestamp: number, version: string): Promise<string> {
    if (Platform.OS === 'ios') {
      throw new Error(`Unsupported operation! Platform: ${Platform.OS}`)
    }
    return JSON.parse(await IndySdk.buildGetAcceptanceMechanismsRequest(submitterDid, typeof timestamp == 'undefined' ? -1 : timestamp, typeof version == 'undefined' ? null : version))
  },
jakubkoci commented 3 years ago

Is related to #33

jakubkoci commented 3 years ago

I'm closing the issue in favor of hyperledger/indy-sdk-react-native#10. This repository is being archived.