Skip to content

Commit

Permalink
πŸ› fix: NativeModules on Android (#5)
Browse files Browse the repository at this point in the history
* Fix NativeModules on Android

* Use `getNativeModule()` for `BundleInfo`
  • Loading branch information
PalmDevs authored Jan 24, 2025
1 parent 66f4832 commit 17f8fa3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/api/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getNativeModule } from '@api/native';

export type * from '@typings/api/fs';

const FileManager: FileManagerType = getNativeModule('DCDFileManager', 'RTNFileManager');
const FileManager: FileManagerType = getNativeModule('NativeFileModule', 'DCDFileManager', 'RTNFileManager');

export const Documents = FileManager.DocumentsDirPath;

Expand Down
4 changes: 2 additions & 2 deletions src/api/native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { NativeModules, TurboModuleRegistry } from 'react-native';

export type * from '@typings/api/native';

export const BundleInfo: BundleInfoType = NativeModules.InfoDictionaryManager ?? NativeModules.RTNClientInfoManager;
export const BundleInfo: BundleInfoType = getNativeModule('NativeClientInfoModule', 'InfoDictionaryManager', 'RTNClientInfoManager');
export const BundleManager: BundleManagerType = getNativeModule('BundleUpdaterManager');
export const DeviceInfo: DeviceInfoType = getNativeModule('DCDDeviceManager');
export const DeviceInfo: DeviceInfoType = getNativeModule('NativeDeviceModule', 'DCDDeviceManager');

export async function reload(instant = true) {
if (instant) {
Expand Down

0 comments on commit 17f8fa3

Please sign in to comment.