mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-08 05:03:56 -05:00
* [INJIMOB-891]: add a wrapper for tuvali to use native artifacts Signed-off-by: Alka Prasad <prasadalka1998@gmail.com> * [INJIMOB-891]: add a wrapper for tuvali in ios to consume ios native artifact Signed-off-by: Alka Prasad <prasadalka1998@gmail.com> * [INJIMOB-891]: add tuvali native dependency Signed-off-by: Alka Prasad <prasadalka1998@gmail.com> * [INJIMOB-891]: use function available in constant for platform check Signed-off-by: Alka Prasad <prasadalka1998@gmail.com> * [INJIMOB-891]: update the Podfile.lock file Signed-off-by: Alka Prasad <prasadalka1998@gmail.com> * [INJIMOB-891] add native ios tuvali in inji Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-891] add missing RN files Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-891] package.resolved changes Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-891] refactor changes Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-891]: bring back some lost changes related to version details of tuvali Signed-off-by: Alka Prasad <prasadalka1998@gmail.com> * [INJIMOB-891]: rename setup file to index file Signed-off-by: Alka Prasad <prasadalka1998@gmail.com> --------- Signed-off-by: Alka Prasad <prasadalka1998@gmail.com> Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> Co-authored-by: Alka Prasad <prasadalka1998@gmail.com>
52 lines
1.2 KiB
TypeScript
52 lines
1.2 KiB
TypeScript
import {getVersion} from 'react-native-device-info';
|
|
import ShortUniqueId from 'short-unique-id';
|
|
import {APP_ID_LENGTH, isIOS} from './constants';
|
|
import {NativeModules} from 'react-native';
|
|
|
|
function getTuvaliPackageDetails() {
|
|
return isIOS() ? 'unknown' : NativeModules.VersionModule.getVersion();
|
|
}
|
|
export class __AppId {
|
|
private static value: string;
|
|
|
|
public static getValue(): string {
|
|
return __AppId.value;
|
|
}
|
|
|
|
public static setValue(value: string) {
|
|
this.value = value;
|
|
}
|
|
}
|
|
export class __TuvaliVersion {
|
|
private static packageDetails = getTuvaliPackageDetails();
|
|
|
|
public static getpackageVersion(): string {
|
|
return __TuvaliVersion.packageDetails;
|
|
}
|
|
|
|
public static getValue(): string {
|
|
return this.getpackageVersion();
|
|
}
|
|
}
|
|
export class __InjiVersion {
|
|
private static value = getVersion();
|
|
|
|
public static getValue(): string {
|
|
return __InjiVersion.value;
|
|
}
|
|
}
|
|
export class __SessionId {
|
|
private static value = generateSessionId();
|
|
|
|
public static getValue(): string {
|
|
return __SessionId.value;
|
|
}
|
|
}
|
|
|
|
function generateSessionId() {
|
|
const shortUUID = new ShortUniqueId({
|
|
length: APP_ID_LENGTH,
|
|
});
|
|
return shortUUID.randomUUID() + Date.now();
|
|
}
|