react-native-native-module

How to add a thirdparty SDK (multiple .framework files) to react native library module?

蓝咒 提交于 2020-12-13 03:59:08
问题 I have built a react native library module (with RN 0.63). This module depends on some thirdparty SDKs. When integrated with Android (using .aar files) it works just fine. In case of iOS, I have been able to get the library module working without the SDK (using swift hence with the bridging header). On adding the SDK, I am getting errors such as .h is not avaialble. This is my directory My directory structure: react-native-lib --android --ios ----MyCls.swift ----MyCls.m ----react-native-lib

How to add a thirdparty SDK (multiple .framework files) to react native library module?

ぃ、小莉子 提交于 2020-12-13 03:58:07
问题 I have built a react native library module (with RN 0.63). This module depends on some thirdparty SDKs. When integrated with Android (using .aar files) it works just fine. In case of iOS, I have been able to get the library module working without the SDK (using swift hence with the bridging header). On adding the SDK, I am getting errors such as .h is not avaialble. This is my directory My directory structure: react-native-lib --android --ios ----MyCls.swift ----MyCls.m ----react-native-lib

How to implement a React Native UI component method in Android

南笙酒味 提交于 2019-12-06 05:12:01
问题 It's clear to me that for react-native native modules we can use the @ReactMethod to export a method and call it from JSX, but how do we do the same thing in react-native native UI components? In the documentation I only see @ReactProp being mentioned. If @ReactMethod is not working, how do I access a property of my native UI component from JSX then? (On iOS this can be done on native ui components with RCT_EXPORT_METHOD but on Android is something similar possible?) Thank you. 回答1: Ok I

React Native Get battery status / level Using Native Modules

陌路散爱 提交于 2019-12-04 20:02:56
问题 I am writing a react native app to get IOS and Android Battery status. I search through the net and found few libraries which can get battery level of the phone. https://github.com/robinpowered/react-native-device-battery https://github.com/remobile/react-native-battery-status https://github.com/oojr/react-native-battery Every library has issues when I try that and not much support for the developer when ask a question on git hub. Can any one provide me better solution or library to get

How to implement a React Native UI component method in Android

匆匆过客 提交于 2019-12-04 10:10:27
It's clear to me that for react-native native modules we can use the @ReactMethod to export a method and call it from JSX, but how do we do the same thing in react-native native UI components? In the documentation I only see @ReactProp being mentioned. If @ReactMethod is not working, how do I access a property of my native UI component from JSX then? (On iOS this can be done on native ui components with RCT_EXPORT_METHOD but on Android is something similar possible?) Thank you. Ok I ended up creating a Module, and passing a UI Component reference on it's constructor: Here's my UI component :

React Native Get battery status / level Using Native Modules

蹲街弑〆低调 提交于 2019-12-03 13:10:02
I am writing a react native app to get IOS and Android Battery status. I search through the net and found few libraries which can get battery level of the phone. https://github.com/robinpowered/react-native-device-battery https://github.com/remobile/react-native-battery-status https://github.com/oojr/react-native-battery Every library has issues when I try that and not much support for the developer when ask a question on git hub. Can any one provide me better solution or library to get Battery status of IOS and Android. Thanks in advance Sameera Chathuranga I wrote my own IOS and Android