Skip to content

Instantly share code, notes, and snippets.

View hurali97's full-sized avatar
🎯
Focusing

Hur Ali hurali97

🎯
Focusing
View GitHub Profile
@hurali97
hurali97 / MainApplicationReactNativeHost.java
Last active July 19, 2022 20:54
Updated getPackages method for MainApplicationReactNativeHost
import com.facebook.react.TurboReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.module.model.ReactModuleInfoProvider;
import com.facebook.react.module.model.ReactModuleInfo;
import java.util.HashMap;
import java.util.Map;
import com.rearchdemo.custommodules.Dlog;
import androidx.annotation.Nullable;
@hurali97
hurali97 / Android.mk
Last active July 19, 2022 19:29
Updated configuration
THIS_DIR := $(call my-dir)
include $(REACT_ANDROID_DIR)/Android-prebuilt.mk
# If you wish to add a custom TurboModule or Fabric component in your app you
# will have to include the following autogenerated makefile.
include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk
include $(CLEAR_VARS)
LOCAL_PATH := $(THIS_DIR)
#include "MainApplicationModuleProvider.h"
#include <rncore.h>
#include <CustomModules.h> // Add this line
namespace facebook {
namespace react {
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
const std::string moduleName,
"codegenConfig": {
"libraries": [
{
"name": "CustomModules",
"type": "modules",
"jsSrcsDir": "src/custom-modules/specs/"
}
]
}
#import "CustomModules/CustomModules.h"
@interface RCTDlog: NSObject <NativeDlogSpec>
@end
#import "RCTDlog.h"
@implementation RCTDlog
RCT_EXPORT_MODULE(Dlog);
- (void)log:(NSString *)message {
NSLog(@"%@",message);
}
@hurali97
hurali97 / App.tsx
Created February 13, 2024 07:26
App file for Callstack Blog
import React, {useState} from 'react';
import {
SafeAreaView,
StatusBar,
StyleSheet,
Text,
TouchableOpacity,
useColorScheme,
useWindowDimensions,
View,