feat: Add native module and package for custom functionality

This commit is contained in:
2025-12-12 23:45:12 +05:30
parent 801725edf3
commit 8613fd7d30
4 changed files with 51 additions and 6 deletions

View File

@@ -5,7 +5,7 @@ import {
StyleSheet,
Text,
TouchableOpacity,
Alert,
Alert, NativeModules
} from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { useState, useEffect } from 'react';
@@ -14,6 +14,7 @@ import Register from './src/components/Register';
import { authAPI } from './src/services/authAPI';
import { networkService } from './src/services/networkService';
type Screen = 'login' | 'register' | 'home';
const { MyNativeModule } = NativeModules;
function App() {
const isDarkMode = useColorScheme() === 'dark';
@@ -25,6 +26,10 @@ function App() {
// Initialize app
useEffect(() => {
initializeApp();
console.log("MyNativeModule", MyNativeModule);
MyNativeModule.greet("John").then((msg: any) => {
console.log(msg);
});
// Listen for network changes
const unsubscribe = networkService.addListener((networkState) => {