Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Android: buildGetAcceptanceMechanismsRequest throws CommonInvalidParam4 Error #10

Open
jakubkoci opened this issue Jul 19, 2021 · 0 comments

Comments

@jakubkoci
Copy link
Contributor

This has been copied from AbsaOSS/rn-indy-sdk#36

@TheArhaam wrote:

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))
  },
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant