react-native#NativeModules JavaScript Examples
The following examples show how to use
react-native#NativeModules.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: network.js From RRWallet with MIT License | 6 votes |
fetch(url, params, type = WALLET_API) {
const relative = url;
const path = url.split("?")[0];
url = this.absoluteURL(url, type);
return new Promise(async (resolve, reject) => {
try {
const result = await NativeModules.RRRNNetwork.fetch(url, params);
handleResult(result, url);
resolve(result);
} catch (error) {
logger.breadcrumbs(relative, LOGGER_MODULE_NETWORK);
reject(error);
}
});
}
Example #2
Source File: store.js From covid-19-app with MIT License | 6 votes |
function getNativeLanguage() {
let lang = Platform.OS === "android" ? NativeModules.I18nManager.localeIdentifier : NativeModules.SettingsManager.settings.AppleLocale || NativeModules.SettingsManager.settings.AppleLanguages[0]
switch (lang.slice(0, 2)) {
case "tr":
{
moment.locale("tr")
return tr
}
case "en":
{
moment.locale("en")
return en
}
default:
return en;
}
}
Example #3
Source File: NativeCode.js From hugin-mobile with GNU Affero General Public License v3.0 | 6 votes |
export async function generateRingSignatures(
transactionPrefixHash,
keyImage,
inputKeys,
privateKey,
realIndex) {
return NativeModules.TurtleCoin.generateRingSignatures(
transactionPrefixHash, keyImage, inputKeys, privateKey, { realIndex }
);
}
Example #4
Source File: utils.js From lx-music-mobile with Apache License 2.0 | 6 votes |
{ UtilsModule } = NativeModules
Example #5
Source File: index.test.js From mixpanel-react-native with Apache License 2.0 | 6 votes |
test(`it calls MixpanelReactNative registerSuperProperties`, async () => {
const mixpanel = await Mixpanel.init("token");
mixpanel.registerSuperProperties({
"super property": "super property value",
"super property1": "super property value1",
});
expect(NativeModules.MixpanelReactNative.registerSuperProperties).toBeCalledWith("token", {
"super property": "super property value",
"super property1": "super property value1",
});
});
Example #6
Source File: nfcCardSigningBox.js From sdk-samples with Apache License 2.0 | 6 votes |
async getPublicKey() {
console.log('>>> Before public key')
Toast.show('>>> Before public key')
let runRetries = 5
if (!this.publicKey) {
console.log('>>> Request public key')
Toast.show('>>> Request public key')
for (let n = 0; n < runRetries; n++) {
try {
alert("Hold the card near you smartphone/iPhone.. And wait about ~ 20 sec to read its public key. \n Be sure the card is near your phone until you will see the key!")
await new Promise(r => setTimeout(r, 20000));
this.publicKey = await NativeModules.NfcCardModule.getPublicKeyForDefaultPath();
console.log(' ✓')
alert("Signing box got Public key from card = " + this.publicKey + ". Please remove security card for now. \n And please wait!")
await new Promise(r => setTimeout(r, 5000))
break
} catch (err) {
console.log(err.message)
if (n < runRetries - 1) {
console.log(`Run next try request pub key #${n + 1}`)
await new Promise(r => setTimeout(r, 30000));
} else {
throw err
}
}
}
}
console.log('>>> Got public key', this.publicKey)
Toast.show('>>> Got public key ' + this.publicKey)
return this.publicKey;
}
Example #7
Source File: service.js From bluezone-app with GNU General Public License v3.0 | 5 votes |
TraceCovid =
Platform.OS === 'ios'
? NativeModules.ScannerManager
: NativeModules.TraceCovid
Example #8
Source File: react-native.js From fuel-js with Apache License 2.0 | 5 votes |
{ RNSecureRandom } = NativeModules
Example #9
Source File: index.js From react-native-in-app-review with MIT License | 5 votes |
{InAppReviewModule, RNInAppReviewIOS} = NativeModules
Example #10
Source File: OnboardingWrapper.js From haven with MIT License | 5 votes |
{ ModuleWithEmitter } = NativeModules
Example #11
Source File: CacheManager.js From react-native-audio-video-tools with MIT License | 5 votes |
{ RNAudioVideoTools } = NativeModules
Example #12
Source File: index.android.js From react-snap-kit with MIT License | 5 votes |
RNSnapchatKit = NativeModules.SnapchatLogin
Example #13
Source File: AppInfo.js From RRWallet with MIT License | 5 votes |
RRRNDevice = NativeModules.RRRNDevice
Example #14
Source File: AndroidKeyboardAvoidingView.android.js From actual with MIT License | 5 votes |
{ StatusBarHeight } = NativeModules
Example #15
Source File: index.js From web3-react-native with MIT License | 5 votes |
{ Web3: RNWeb3 } = NativeModules
Example #16
Source File: AR.js From rn-webrtc-arkit-integration with MIT License | 5 votes |
{ injectARSession, revertARSession, } = NativeModules.ExampleARSCNViewManager
Example #17
Source File: index.js From platform-colors with Apache License 2.0 | 5 votes |
{ KLAPlatformColors } = NativeModules
Example #18
Source File: NativeCode.js From hugin-mobile with GNU Affero General Public License v3.0 | 5 votes |
export async function generateKeyImage(
publicEphemeral,
privateEphemeral) {
return NativeModules.TurtleCoin.generateKeyImage(
publicEphemeral, privateEphemeral,
);
}
Example #19
Source File: cache.js From lx-music-mobile with Apache License 2.0 | 5 votes |
{ CacheModule } = NativeModules
Example #20
Source File: index.js From react-native-ultimate-config with MIT License | 5 votes |
{ UltimateConfig } = NativeModules
Example #21
Source File: index.test.js From mixpanel-react-native with Apache License 2.0 | 5 votes |
test(`it calls MixpanelReactNative initialize`, async () => {
const mixpanel = await Mixpanel.init("token");
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", false, {"$lib_version": "1.5.0", "mp_lib": "react-native"});
});