react-native-android

React native Async Storage Limit on Android

旧时模样 提交于 2019-12-07 19:39:30
问题 I'm developing a React Native app which will easily exceed the 6mb limit. According to this, I should be able to use the method setMaximumSize, however I'm not sure of where or how I should invoke it in my project. A practical example would be welcome. EDIT: For anyone who needs this in the future here's how you do it: // MainApplication.getPackages() long size = 50L * 1024L * 1024L; // 50 MB com.facebook.react.modules.storage.ReactDatabaseSupplier.getInstance(getApplicationContext())

com.facebook.react.uimanager.IllegalViewOperationException: Trying to add unknown view tag

与世无争的帅哥 提交于 2019-12-07 17:50:44
问题 com.facebook.react.uimanager.IllegalViewOperationException: Trying to add unknown view tag: 1122 How to resole this bug,How to find where cause this crash? 回答1: This happened because of missing piece of code in ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java reactRootView.removeAllViews(); reactRootView.setId(View.NO_ID); This is fixed in RN 0.48.0 in c639a1f 回答2: I managed to spot exactly what's causing that problem in react-native . So what happens behind the scenes

React-native dev options not showing up on mobile app installed on Xiaomi Phone

风格不统一 提交于 2019-12-07 13:08:45
问题 When I try installing react-native app on my redmi note 3 mobile phone, It pops up an error which doesn't happen when I use any other mobile phone. I fixed this issue by disabling MIUI optimization. But after I did this, I'm not getting dev options when I shake my mobile. 回答1: Ok, for anyone that like me didn't know what to do. The first answer is correct, but I if you are wondering what to do, just like I did, do the following. Open Security (an app installed by default on Note 3 phone)

React-Native Native Android Module - Toast Example

北城余情 提交于 2019-12-07 11:49:39
问题 I'm trying to learn to work with android native module and using the toast example in the react-native docs. (https://facebook.github.io/react-native/docs/native-modules-android). However, I am facing an issue where the native module that I was trying to export was unable to be resolved/undefine. My directory structure is as followed: example -android -app -src -main - java -com -example -CustomToastPackage.java -ToastModule.java -MainActivity.java -MainApplication.java - res -

How to call Two functions in a event on React-Native?

ぃ、小莉子 提交于 2019-12-07 11:17:28
I would try : Source ( Two function in a event on React-Native ) onValueChange={(selected) => { this.setState({selected}); this.state.eventOnChange(); }} But that's Not work That executes the first function , but not the second. Component.setState() is asynchronous and may be locked on the second call while it is still doing the first. Do the second call in a callback like this: this.setState({selected},() => { this.state.eventOnChange(); }); Try to log a console after all functions onValueChange={(selected) => { this.setState({selected}); this.state.eventOnChange(); console.log('it works!');

How to open Other app from ReactNative?

独自空忆成欢 提交于 2019-12-07 07:51:30
问题 How to open other apps (Gmail, Camera) from ReactNative. How can I pass data from current scene to other app? 回答1: I found this npm library react-native-app-link which can open other apps. This is based on deep linking, if you have any deep links then this library can help. This doesn't open apps just by giving the android package name or ios app id. https://github.com/FiberJW/react-native-app-link 回答2: you can mange opening other apps using Linking 回答3: Code sample for opening the dialer

Unable to resolve module 'react-navigation'

点点圈 提交于 2019-12-07 06:13:17
问题 Here is the error I get: package.json { "name": "LoginApp2", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest" }, "dependencies": { "react": "16.0.0-alpha.12", "react-native": "0.48.3" }, "devDependencies": { "babel-jest": "21.2.0", "babel-preset-react-native": "4.0.0", "jest": "21.2.1", "react-test-renderer": "16.0.0-alpha.12" }, "jest": { "preset": "react-native" } } index.js import React, { Component } from

How do I request multiple permissions at once in react native

无人久伴 提交于 2019-12-07 05:19:45
问题 I'd like to request permissions on one page instead of waiting for each particular situation. However, I do not want multiple popups. Is there a way to ask for permissions with a single popup/modal. On the android side I found this post and this, which look promising, but I have yet to find something for iOS. 回答1: In Android First add permissions in to the AndroidManifest.xml file and then if (Platform.OS === 'android') { PermissionsAndroid.requestMultiple( [PermissionsAndroid.PERMISSIONS

How to turn off overlay permission on android

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 03:56:01
问题 https://facebook.github.io/react-native/docs/integration-with-existing-apps.html https://medium.com/react-native-development/fixing-problems-in-react-native-caused-by-new-permission-model-on-android-1e547f754b8 talks about overlay permission. They add the permission check code to the activity which hosts react native view. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (!Settings.canDrawOverlays(this)) { Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse

React-native-maps Blank page Only google logo

孤街浪徒 提交于 2019-12-07 03:33:58
问题 I've been trying to install google maps for react-native for a week an still no success. I've searched and tried the solutions in the react-native-maps github issue but still I get a blank page. What I do: react-native init myapp npm install yarn add react-native-maps react-native link react-native-maps In Google Console APIs -> Create new Project -> Enable Google Maps Android API, Google Maps JavaScript API and Places API -> Create credentials In AndroidManifest.xml <application> .... <meta