0.2.1 • Published 2 years ago
react-native-covid-certificate v0.2.1
react-native-covid-certificate
This is the implementation of the CovidCertificate-SDK.
Installation
npm install react-native-covid-certificate
Usage
import CovidCertificate from "react-native-covid-certificate";
// ...
init('token', 'appVersion', 'environmentType');
[
environmentType:
"abn" -> SdkEnvironment.ABN
"prod" -> SdkEnvironment.PROD
else -> SdkEnvironment.DEV
]
registerLifecycle();
unregisterLifecycle();
const result = await verify('qrCodeData');
return value -> Promise<CovidCertificateData>
[
type CovidCertificateData = {
firstName: string;
lastName: string;
dateOfBirth: string;
isVerified: boolean;
verifyMsg: string;
};
]
const result = await getDetails('qrCodeData');
return value -> Promise<CovidCertificateDetails>
[
type CovidCertificateDetails = {
vaccinationData?: VaccinationData;
recoveryData?: RecoveryData;
testData?: TestData;
};
type VaccinationData = {
isFullyProtected: boolean;
vaccinations: [VaccineData];
};
type RecoveryData = {
recoveries: [SingleRecoveryData];
};
type TestData = {
tests: [SingleTestData];
};
type VaccineData = {
numberOverTotalDose: string;
diseaseName: string;
vaccineType: string;
vaccineName: string;
manufacturer: string;
vaccinationDate: string;
vaccinationCountry: string;
certificateIdentifier: string;
issuer: string;
};
type SingleRecoveryData = {
diseaseName: string;
dateOfFirstPositiveTest: string;
countryOfTest: string;
certificateIdentifier: string;
issuer: string;
};
type SingleTestData = {
diseaseName: string;
testResult: string;
testType: string;
manufacturer?: string;
dateOfSampleCollection?: string;
testCenter?: string;
countryOfTest: string;
certificateIdentifier: string;
issuer: string;
};
]
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT