I am using react-native-image-picker to upload a video from the Android emulator. It works, the video uploads properly, it then shows in my app from the uploaded URI, I can even go to the address and view it in a browser, but that same uri doesn't show up on my iPhone. I can't play it in Safari/Chrome or my app from my iPhone. Is this a known issue with the emulator video? I upload photo and it works on all devices no problem, but not video. And this is whether I record video using react-native-camera or any method to get the video uploaded.
Uploaded video from Android emulator not showing up on real iPhone device
Endpoints aren't eligible in amazon pinpoint campaign creation
When I try to create a campaign in amazon pinpoint no eligible endpoints show up in the segment creation section. Even though I have a device successfully receiving push notifications from the test messaging section.
I have implemented iOS push notifications for my react-native app exactly as shown in the documentation (https://aws-amplify.github.io/docs/js/push-notifications). Everything works without any errors on the frontend and the backend. When I run the code:
PushNotification.onRegister((token) => console.log(token));
I successfully receive the app token. I can even receive push notifications from the test messaging section by using the token generated from the onRegister function.
However when I try to create a campaign in amazon pinpoint. I cannot get farther than the create segment section because despite there being 6 total endpoints, there are 0 eligible endpoints. Why are my endpoints ineligible? I have tested on a device. I have tested in a simulator. I tried changing the IAM access of my auth and un auth roles to
"mobiletargeting:*"
so that they have full access to pinpoint.
What am I missing? Why are my endpoints ineligible?
In all of the tutorials that I have gone through. The segment automatically recognizes that the test device is eligible. Why is this not working for my project?
How do you debug React Native?
How does one debug their React code with React Native while the app is running in app simulator?
react native google signin failed in iOS react native
I run the react-native upgrade to fix the play store base 64 issue. Android is working fine the only issue I am facing with iOS. React native google sing in failed when run for the build.
I have run the following commands:
react-native-upgrade@0.59.1
rm -rf node_modules && npm i
Upgrade the google sdk 4.4.0 to 5.0.0 and
cd ios && pod install && cd ..
Here are errors:
1) No visible @interface for 'GIDSignIn' declares the selector 'signInSilently'
[[GIDSignIn sharedInstance] signInSilently];
2) No visible @interface for 'GIDSignIn' declares the selector 'hasAuthInKeychain'
RCT_REMAP_METHOD(isSignedIn,
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)
{
BOOL isSignedIn = [[GIDSignIn sharedInstance] hasAuthInKeychain];
resolve([NSNumber numberWithBool:isSignedIn]);
}
3) No visible @interface for 'GIDSignIn' declares the selector 'handleURL:sourceApplication:annotation:'
+ (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation: (id)annotation {
return [[GIDSignIn sharedInstance] handleURL:url
sourceApplication:sourceApplication
annotation:annotation];
}
4) Use of undeclared identifier 'kGIDSignInErrorCodeNoSignInHandlersInstalled'
case kGIDSignInErrorCodeNoSignInHandlersInstalled:
Please let me know if anyone can help me with this...Thanks!
Communication between React Native app and iOS widget
I'm trying to figure out how to communicate between my React Native app and an iOS widget. I need some insights on how to do so, this is completely new for me so.
I'm using React Native 0.61, XCode 11.1 and Swift 5.
I already have a bridge between my React Native app and a file named Bridge.swift
. This file contains a variable string that needs to be displayed in my widget. But I really have no idea how to access that updated variable.
The Bridge.swift file is located in my main app while the TodayViewController is located in the widget target.
There is nothing wrong with the setup of my bridge, I checked that already.
I also tried doing Bridge.getStringToShow() in my TodayViewController but that is not possible.
Bridge.swift
import Foundation
import UIKit
@objc(Bridge)
class Bridge : NSObject {
var stringToShow : String = String()
@objc
static func requiresMainQueueSetup() -> Bool {
return true
}
@objc(strToShow:)
func setStringToShow(strToShow: String) -> Void {
stringToShow = strToShow
print(stringToShow)
}
@objc
func getStringToShow() -> String {
return stringToShow
}
}
TodayViewController.swift
import UIKit
import NotificationCenter
class TodayViewController: UIViewController, NCWidgetProviding {
var bridge : Bridge = Bridge()
override func viewDidLoad() {
// Do any additional setup after loading the view.
super.viewDidLoad()
renderBackground(file: "background")
loadTest()
}
@objc
func loadTest() {
let lblstr = createLabel(text: bridge.getStringToShow(), fontSize: 12)
view.addSubview(lblstr)
NSLayoutConstraint.activate([
lblstr.centerXAnchor.constraint(equalTo: view.centerXAnchor),
lblstr.centerYAnchor.constraint(equalTo: view.centerYAnchor)
])
}
}
When I press a button in my React Native project, it sets a variable in that file to "test". This works and I can print it in my console. But I want to show that on my widget, which does not work. It does not show anything because it is empty.
I think it is because in the TodayViewController I initialise the variable when the string that needs to be displayed is empty, and it does not update that existing variable because it is another instance.
But how can I pass something from my React Native app to my widget then??
Fetch data from php url to save to local sqlite in react native
So i want fetch data from url, example from json.php and then store that to local sqlite in React Native. But i cant any refference or any problem same like me
i tried find another database to get data from url and store to local database, but it seems i cant find any case like me.
[{
"username":"****",
"password":"*****",
"access":"1",
"name":"dwi",
"phone_number":"****",
"email":"**@***.com",
"score":null,"status":"0"
},
{
"username":"*****",
"password":"****",
"access":"1",
"name":"******",
"phone_number":"**********",
"email":"******@**.com",
"score":null,
"status":"0"
}]
React-native-camera - TypeError: undefined is not an object
I am trying to use the camera for a rect native app using 'react-native-camera'. I keep getting the following error when I'm trying to navigate to the camera screen.
Here's my code:
import React,{Component} from 'react';
import {SafeAreaView,StyleSheet,TouchableOpacity,TextInput,View,Text,StatusBar,Image} from 'react-native';
import {createAppContainer} from 'react-navigation';
import {createStackNavigator} from 'react-navigation-stack';
import UserMainScreen from './UserMainScreen.js';
import Camera from 'react-native-camera';
import {RNCamera} from 'react-native-camera';
class CameraScreen extends Component{
render(){
return(
<View style={cam_styles.container}>
<Camera ref={cam=>{this.camera = cam;}} style={cam_styles.preview} aspect = {Camera.constants.Aspect.fill}>
<Text style={cam_styles.capture} onPress={this.takePicture.bind(this)}>[CAPTURE]</Text>
</Camera>
</View>
);
}
takePicture(){
const options ={};
this.camera.capture({metadata: options})
.then(data=>console.log(data))
.catch(error=>console.log(error));
}
}
const cam_styles = StyleSheet.create({
container: {
flex:1,
flexDirection: 'row',
},
preview:{
flex:1,
justifyContent: 'flex-end',
alignItems:'center'
},
capture:{
flex:0,
backgroundColor: '#fff',
borderRadius: 5,
color:'#000',
padding:10,
margin:40
}
});
const MainNavigator = createStackNavigator({
Home: UserMainScreen,
Login : LoginScreen,
Camera : CameraScreen,
},
{
initialRouteName: 'Login',
headerMode: 'none',
}
);
const AppContainer = createAppContainer(MainNavigator);
class Login extends Component{
render (){
return (
<AppContainer />
);
}
}
export default Login;
This is the error I keep getting.I tried removing the aspect attribute but I get a Invariant Violation: Element type is invalid: expected a string (for built-in components) or class/function but got undefined. Check the render method of CameraScreen
With my current code this is the error log I get. How do I solve this?
TypeError: undefined is not an object (evaluating '_reactNativeCamera.Camera.constants')
This error is located at:
in CameraScreen (at SceneView.js:9)
in SceneView (at StackViewLayout.tsx:900)
in RCTView (at createAnimatedComponent.js:151)
in AnimatedComponent (at StackViewCard.tsx:106)
in RCTView (at createAnimatedComponent.js:151)
in AnimatedComponent (at screens.native.js:71)
in Screen (at StackViewCard.tsx:93)
in Card (at createPointerEventsContainer.tsx:95)
in Container (at StackViewLayout.tsx:975)
in RCTView (at screens.native.js:101)
in ScreenContainer (at StackViewLayout.tsx:384)
in RCTView (at createAnimatedComponent.js:151)
in AnimatedComponent (at StackViewLayout.tsx:374)
in PanGestureHandler (at StackViewLayout.tsx:367)
in StackViewLayout (at withOrientation.js:30)
in withOrientation (at StackView.tsx:104)
in RCTView (at Transitioner.tsx:267)
in Transitioner (at StackView.tsx:41)
in StackView (at createNavigator.js:80)
in Navigator (at createKeyboardAwareNavigator.js:12)
in KeyboardAwareNavigator (at createAppContainer.js:430)
in NavigationContainer (at Login.js:97)
in Login
in RCTView (at AppContainer.js:101)
in RCTView (at AppContainer.js:119)
in AppContainer (at renderApplication.js:39)
CameraScreen#render
Login.js:42:100
renderRoot
[native code]:0
runRootCallback
[native code]:0
unstable_runWithPriority
scheduler.development.js:643:23
callFunctionReturnFlushedQueue
[native code]:0
React native - How to implement iOS Settings
Wondering if someone could help me with this, or at least point me in the right direction.
I've been searching for documentation on how to get/set settings in a React Native iOS app so that those settings appear in the iOS Settings app listed under my app. I see that there is a Settings API, but it appears that the documentation is not complete. The function definitions are listed there, but that's it. No examples or anything.
Can anyone provide me with a simple example, or point me to a tutorial or something that will help me get going? I'm assuming I import Settings from react-native, just like I would do for other APIs, but beyond that I'm not sure where to go.
Thanks.
react-native Unable to resolve module 'warnOnce'
my English is little rusty, I'm sorry for that.
I have an error at the moment when I am starting react-native project on the iOS Simulator.
To rule out any conflict with my code, I started a new project
react-native init demo
react-native start
react-native run-ios --simulator="iPhone 6"
Now is when i get the message error
Loading dependency graph, done.
error: bundling failed: Error: Unable to resolve module `warnOnce` from `node_modules/react-native/Libraries/react-native/react-native-implementation.js`: warnOnce could not be found within the project.
If you are sure the module exists, try these steps:
1. Clear watchman watches: watchman watch-del-all
2. Delete node_modules: rm -rf node_modules and run yarn install
3. Reset Metro's cache: yarn start --reset-cache
4. Remove the cache: rm -rf /tmp/metro-*
at ModuleResolver.resolveDependency (/usr/local/lib/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:186:15)
at ResolutionRequest.resolveDependency (/usr/local/lib/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
at DependencyGraph.resolveDependency (/usr/local/lib/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph.js:282:16)
at Object.resolve (/usr/local/lib/node_modules/react-native/node_modules/metro/src/lib/transformHelpers.js:267:42)
at /usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:426:31
at Array.map (<anonymous>)
at resolveDependencies (/usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:423:18)
at /usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:275:33
at Generator.next (<anonymous>)
at asyncGeneratorStep (/usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:87:24)
I need to know if anybody have same problem and how fix it ?
My react-native version is 0.61.5
package.json
{
"name": "demo",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "16.9.0",
"react-native": "0.61.4"
},
"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/runtime": "^7.6.2",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.0",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}
Thank you for advance.
React-native: How to build for ios from windows
We are starting to work with react-native at my company. We have one mac and the rest of the team is running on windows.
Is there a way to write the app on windows with the ios device connected to the windows machine or local wifi. Then launch the build on the mac (from the windows pc) and get the app launched on the ios device ? So it would like using the mac only as a build/package server.
Hope i am clear enought.
Thanks.
Expo - reduce PDF filesize on iOS devices
I'm currently creating an A4 PDF within my Expo-App, using the "expo-print" API (printtofileasync). The PDF includes images (photos taken from the device) and some text. I've set the PDF size to 595 width, 842 height (A4 dimensions). Unfortunately the size of the PDF is too large for my requirements (1,9MB with only 1 image).
I was able to reduce the PDF size on Android by decreasing the image size, but that does not work on iOS. I have the suspicion that on iOS Expo is simply "making screenshots" of the page, therefore changing the image size has no effect. I've already tried to decrease the whole PDF size to A5, but that's not a solution, because the PDFs needs to be printed afterwards on A4.
Any help would be appreciated!
Passing data to custom picker
Currently I'm developing an app with a picker on it and I'm using picker component from react native but it doesn't work perfectly on iOS device so I found a custom picker using picker and modal it renders a modal on iOS only. Here is the code
class PickerWrapper extends React.Component {
constructor(props) {
super(props);
this.state = {
type_absen: '',
modal: false,
}
}
render() {
let picker;
let iosPickerModal = (
<Modal isVisible={this.state.modal} hideModalContentWhileAnimating={true} backdropColor={color.white} backdropOpacity={0.9} animationIn="zoomInDown" animationOut="zoomOutUp" animationInTiming={200} animationOutTiming={200} onBackButtonPress={() => this.setState({ modal: false })} onBackdropPress={() => this.setState({ modal: false })} ><View style={{ backgroundColor: color.white, width: 0.9 * windowWidth(), height: 0.3 * windowHeight(), justifyContent: 'center' }}><Picker
selectedValue={this.state.type_absen}
onValueChange={(itemValue, itemIndex) => {
this.setState({ type_absen: itemValue });
this.setState({ modal: false });
setTimeout(() => this.props.onSelect(itemValue), 1200);
}}>
{this.props.items.map((item, key) => <Picker.Item label={item} value={item} key={key} />)}</Picker></View></Modal>);
if (Platform.OS === 'ios')
return (<View style={this.props.style}>
{iosPickerModal}<TouchableOpacity onPress={() => this.setState({ modal: true })}><View style={{ flexDirection: 'row', height: this.props.height ? this.props.height : normalize(40), width: this.props.width ? this.props.width : 0.68 * windowWidth(), borderWidth: 1, borderColor: color.blue, alignItems: 'center', borderRadius: 5 }}><Text style={{ fontSize: fontSize.regular, marginRight: 30 }}> {this.state.type_absen}</Text><IconWrapper name='md-arrow-dropdown' type='ionicon' color={color.light_grey} size={20} onPress={() => this.setState({ modal: true })} style={{ position: 'absolute', right: 10 }} /></View></TouchableOpacity></View >);
else
return (<View style={this.props.style} ><Picker
selectedValue={this.state.type_absen}
style={{ height: this.props.height ? this.props.height : normalize(20), width: this.props.width ? this.props.width : normalize(150) }}
onValueChange={(itemValue, itemIndex) => {
this.setState({ type_absen: itemValue });
this.props.onSelect(itemValue);
}}>
{this.props.items.map((item, key) => <Picker.Item label={item} value={item} key={key} />)}</Picker></View>);
}
}
PickerWrapper.propTypes = {
onSelect: PropTypes.func.isRequired
}
export default PickerWrapper;
I successfully load the data from api, but I still confused on how to get the value from it, and here is my old code using picker component
<Picker
selectedValue={this.state.type_absen}
style={{backgroundColor:'white'}}
onValueChange={(val) => this.setState({ type_absen: val })}>
{
this.props.schedules ? this.props.schedules.map((item, key) => {
return <Picker.Item value={item.id} label {item.description} key={item.id} />})
:
[]
} </Picker>
and this is my new code using the PickerWrapper
export const mapStateToProps = state => ({
token: state.authReducer.token,
message: state.authReducer.message,
schedules: state.authReducer.schedules
});
export const mapDispatchToProps = (dispatch) => ({
actionsAuth: bindActionCreators(authAction, dispatch)
});
class Change extends Component {
constructor(){
super();
this.state={
type_absen: [],
}
}
onPickerValueChange=(value, index)=>{
this.setState({type_absen: value},
() => {
Alert.alert("type_absen", this.state.type_absen);
}
);
}
render() {
return (<View style={styles.container}><View style={styles.container}><View style={styles.innerContainer}> <PickerWrapper items={this.props.schedules.map((item) => item.description )} onSelect={this.onPickerValueChange} /></View> </View></View>
);
}
}
}
what I'm trying to do is get the item.id
. How do I do that in my PickerWrapper component?
React native ipa file generate with ad hoc wont work ios 13 real device
Hi my react native version is 59.1, Xcode version 10.3 and I use ad hoc and take out ipa my app, will work iPhone 6 (IOS 12.) but iPhone 8 (13.1.3) wont install my ipa file gives warning (app is wont installing, please try again) Is the reason my Xcode version or something like that, anything idea, thanks for helping
React-native-video not showing the video player
I am using react-native-video package to get video player in which i can play my youtube videos.
I tried this but only a empty space was coming instead of a video player.
import Video from 'react-native-video';
<Video source={{uri: 'https://www.youtube.com/watch?v=Gh2FaDqZp2g'}}
ref={(ref) => {
this.player = ref
}}
onBuffer={this.onBuffer}
onEnd={this.onEnd}
onError={this.videoError}
style={styles.backgroundVideo} />
style:
backgroundVideo: {
height:300,
width:'100%',
}
React Native showing cryptic stack trace instead of file names
The stack trace for my react native app has had the functions and component names and files replaced with what looks like compiled names instead of their given names.
Additionally, the file names are replaced with something starting with AppEntry.bundle
followed by a bunch of parameters. How do I revert back to proper stack traces?
Read Apple crash reports without OS
So I built an app on expo with react native that run perfectly on android, I am using a Windows pc for my code and also uploaded with application uploader, So I got an an error report from apple, first of all how do I understand what is the reason my app is crashing? there is a way to understand the errors without Mac pc? Thanks!
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000191632ebc 0x19160e000 + 151228
1 libsystem_pthread.dylib 0x000000019154e790 0x19154c000 + 10128
2 libsystem_c.dylib 0x00000001914a28a0 0x19142f000 + 473248
3 libsystem_c.dylib 0x00000001914a2830 0x19142f000 + 473136
4 libc++abi.dylib 0x00000001915fb7d4 0x1915fa000 + 6100
5 libc++abi.dylib 0x00000001915fb9c4 0x1915fa000 + 6596
6 libobjc.A.dylib 0x0000000191563358 0x19155d000 + 25432
7 libc++abi.dylib 0x0000000191608304 0x1915fa000 + 58116
8 libc++abi.dylib 0x000000019160829c 0x1915fa000 + 58012
9 libdispatch.dylib 0x0000000191508198 0x1914ac000 + 377240
10 libdispatch.dylib 0x00000001914bad14 0x1914ac000 + 60692
11 libdispatch.dylib 0x0000000191508184 0x1914ac000 + 377220
12 libdispatch.dylib 0x00000001914ba1d0 0x1914ac000 + 57808
13 CoreFoundation 0x00000001917b83c4 0x19170f000 + 693188
14 CoreFoundation 0x00000001917b33b8 0x19170f000 + 672696
15 CoreFoundation 0x00000001917b28bc 0x19170f000 + 669884
16 GraphicsServices 0x000000019b61e328 0x19b61b000 + 13096
17 UIKitCore 0x00000001958486d4 0x194e58000 + 10421972
18 ComGpLiminal 0x0000000100818658 0x100814000 + 18008
19 libdyld.dylib 0x000000019163d460 0x19163c000 + 5216
Thread 1:
0 libsystem_pthread.dylib 0x000000019155aad8 0x19154c000 + 60120
Thread 2:
0 libsystem_pthread.dylib 0x000000019155aad8 0x19154c000 + 60120
Thread 3:
0 libsystem_pthread.dylib 0x000000019155aad8 0x19154c000 + 60120
Thread 4:
0 libsystem_pthread.dylib 0x000000019155aad8 0x19154c000 + 60120
Thread 5 name: Dispatch queue: com.facebook.react.ExceptionsManagerQueue
Thread 5:
0 libsystem_kernel.dylib 0x00000001916338b0 0x19160e000 + 153776
1 libdispatch.dylib 0x00000001914aecfc 0x1914ac000 + 11516
2 libdispatch.dylib 0x00000001914aeae0 0x1914ac000 + 10976
3 libdispatch.dylib 0x00000001914baee4 0x1914ac000 + 61156
4 libdispatch.dylib 0x00000001914bab00 0x1914ac000 + 60160
5 ComGpLiminal 0x00000001009fa6b0 0x100814000 + 1992368
6 ComGpLiminal 0x00000001009e5c70 0x100814000 + 1907824
7 ComGpLiminal 0x0000000100ba92bc 0x100814000 + 3756732
8 ComGpLiminal 0x0000000100bdf33c 0x100814000 + 3978044
9 CoreFoundation 0x0000000191840d90 0x19170f000 + 1252752
10 CoreFoundation 0x0000000191710bd0 0x19170f000 + 7120
11 CoreFoundation 0x00000001917117a8 0x19170f000 + 10152
12 ComGpLiminal 0x0000000100c07860 0x100814000 + 4143200
13 ComGpLiminal 0x0000000100c0e0cc 0x100814000 + 4169932
14 ComGpLiminal 0x0000000100c0de2c 0x100814000 + 4169260
15 libdispatch.dylib 0x0000000191507610 0x1914ac000 + 374288
16 libdispatch.dylib 0x0000000191508184 0x1914ac000 + 377220
17 libdispatch.dylib 0x00000001914b4464 0x1914ac000 + 33892
18 libdispatch.dylib 0x00000001914b4e58 0x1914ac000 + 36440
19 libdispatch.dylib 0x00000001914be340 0x1914ac000 + 74560
20 libsystem_pthread.dylib 0x0000000191557fa4 0x19154c000 + 49060
21 libsystem_pthread.dylib 0x000000019155aae0 0x19154c000 + 60128
Thread 6:
0 libsystem_pthread.dylib 0x000000019155aad8 0x19154c000 + 60120
Thread 7 name: com.apple.uikit.eventfetch-thread
Thread 7:
0 libsystem_kernel.dylib 0x00000001916115f4 0x19160e000 + 13812
1 libsystem_kernel.dylib 0x0000000191610a60 0x19160e000 + 10848
2 CoreFoundation 0x00000001917b8068 0x19170f000 + 692328
3 CoreFoundation 0x00000001917b3188 0x19170f000 + 672136
4 CoreFoundation 0x00000001917b28bc 0x19170f000 + 669884
5 Foundation 0x0000000191af2994 0x191aeb000 + 31124
6 Foundation 0x0000000191af2874 0x191aeb000 + 30836
7 UIKitCore 0x00000001958e049c 0x194e58000 + 11043996
8 Foundation 0x0000000191c230b0 0x191aeb000 + 1278128
9 libsystem_pthread.dylib 0x00000001915571ec 0x19154c000 + 45548
10 libsystem_pthread.dylib 0x000000019155aaec 0x19154c000 + 60140
Thread 8 name: AVAudioSession Notify Thread
Thread 8:
0 libsystem_kernel.dylib 0x00000001916115f4 0x19160e000 + 13812
1 libsystem_kernel.dylib 0x0000000191610a60 0x19160e000 + 10848
2 CoreFoundation 0x00000001917b8068 0x19170f000 + 692328
3 CoreFoundation 0x00000001917b3188 0x19170f000 + 672136
4 CoreFoundation 0x00000001917b28bc 0x19170f000 + 669884
5 AVFAudio 0x000000019e213e68 0x19e1ae000 + 417384
6 AVFAudio 0x000000019e264df0 0x19e1ae000 + 749040
7 libsystem_pthread.dylib 0x00000001915571ec 0x19154c000 + 45548
8 libsystem_pthread.dylib 0x000000019155aaec 0x19154c000 + 60140
Thread 9:
0 libsystem_pthread.dylib 0x000000019155aad8 0x19154c000 + 60120
Thread 10 name: com.facebook.react.JavaScript
Thread 10:
0 libsystem_kernel.dylib 0x00000001916115f4 0x19160e000 + 13812
1 libsystem_kernel.dylib 0x0000000191610a60 0x19160e000 + 10848
2 CoreFoundation 0x00000001917b8068 0x19170f000 + 692328
3 CoreFoundation 0x00000001917b3188 0x19170f000 + 672136
4 CoreFoundation 0x00000001917b28bc 0x19170f000 + 669884
5 ComGpLiminal 0x0000000100bca6b4 0x100814000 + 3892916
6 Foundation 0x0000000191c230b0 0x191aeb000 + 1278128
7 libsystem_pthread.dylib 0x00000001915571ec 0x19154c000 + 45548
8 libsystem_pthread.dylib 0x000000019155aaec 0x19154c000 + 60140
Thread 11 name: com.apple.CoreMotion.MotionThread
Thread 11:
0 libsystem_kernel.dylib 0x00000001916115f4 0x19160e000 + 13812
1 libsystem_kernel.dylib 0x0000000191610a60 0x19160e000 + 10848
2 CoreFoundation 0x00000001917b8068 0x19170f000 + 692328
3 CoreFoundation 0x00000001917b3188 0x19170f000 + 672136
4 CoreFoundation 0x00000001917b28bc 0x19170f000 + 669884
5 CoreFoundation 0x00000001917b3608 0x19170f000 + 673288
6 CoreMotion 0x000000019e0d264c 0x19dfec000 + 943692
7 libsystem_pthread.dylib 0x00000001915571ec 0x19154c000 + 45548
8 libsystem_pthread.dylib 0x000000019155aaec 0x19154c000 + 60140
Thread 12 name: JavaScriptCore bmalloc scavenger
Thread 12:
0 libsystem_kernel.dylib 0x0000000191632c8c 0x19160e000 + 150668
1 libsystem_pthread.dylib 0x0000000191550204 0x19154c000 + 16900
2 libc++.1.dylib 0x00000001916847a8 0x191676000 + 59304
3 JavaScriptCore 0x00000001a04103fc 0x1a0388000 + 558076
4 JavaScriptCore 0x00000001a0413dcc 0x1a0388000 + 572876
5 JavaScriptCore 0x00000001a0413ab4 0x1a0388000 + 572084
6 JavaScriptCore 0x00000001a0414dc0 0x1a0388000 + 576960
7 libsystem_pthread.dylib 0x00000001915571ec 0x19154c000 + 45548
8 libsystem_pthread.dylib 0x000000019155aaec 0x19154c000 + 60140
Thread 13 name: com.apple.NSURLConnectionLoader
Thread 13:
0 libsystem_kernel.dylib 0x00000001916115f4 0x19160e000 + 13812
1 libsystem_kernel.dylib 0x0000000191610a60 0x19160e000 + 10848
2 CoreFoundation 0x00000001917b8068 0x19170f000 + 692328
3 CoreFoundation 0x00000001917b3188 0x19170f000 + 672136
4 CoreFoundation 0x00000001917b28bc 0x19170f000 + 669884
5 CFNetwork 0x0000000194a2de68 0x194a2c000 + 7784
6 Foundation 0x0000000191c230b0 0x191aeb000 + 1278128
7 libsystem_pthread.dylib 0x00000001915571ec 0x19154c000 + 45548
8 libsystem_pthread.dylib 0x000000019155aaec 0x19154c000 + 60140
Thread 14 name: Heap Helper Thread
Thread 14:
0 libsystem_kernel.dylib 0x0000000191632c8c 0x19160e000 + 150668
1 libsystem_pthread.dylib 0x0000000191550204 0x19154c000 + 16900
2 JavaScriptCore 0x00000001a03d4b6c 0x1a0388000 + 314220
3 JavaScriptCore 0x00000001a03baa18 0x1a0388000 + 207384
4 JavaScriptCore 0x00000001a03932d4 0x1a0388000 + 45780
5 JavaScriptCore 0x00000001a039365c 0x1a0388000 + 46684
6 JavaScriptCore 0x00000001a03d27a4 0x1a0388000 + 305060
7 JavaScriptCore 0x00000001a03d4314 0x1a0388000 + 312084
8 libsystem_pthread.dylib 0x00000001915571ec 0x19154c000 + 45548
9 libsystem_pthread.dylib 0x000000019155aaec 0x19154c000 + 60140
Thread 15 name: Heap Helper Thread
Thread 15:
0 libsystem_kernel.dylib 0x0000000191632c8c 0x19160e000 + 150668
1 libsystem_pthread.dylib 0x0000000191550204 0x19154c000 + 16900
2 JavaScriptCore 0x00000001a03d4b6c 0x1a0388000 + 314220
3 JavaScriptCore 0x00000001a03baa18 0x1a0388000 + 207384
4 JavaScriptCore 0x00000001a03932d4 0x1a0388000 + 45780
5 JavaScriptCore 0x00000001a039365c 0x1a0388000 + 46684
6 JavaScriptCore 0x00000001a03d27a4 0x1a0388000 + 305060
7 JavaScriptCore 0x00000001a03d4314 0x1a0388000 + 312084
8 libsystem_pthread.dylib 0x00000001915571ec 0x19154c000 + 45548
9 libsystem_pthread.dylib 0x000000019155aaec 0x19154c000 + 60140
Thread 16 name: JSC Heap Collector Thread
Thread 16:
0 libsystem_kernel.dylib 0x0000000191632c8c 0x19160e000 + 150668
1 libsystem_pthread.dylib 0x0000000191550204 0x19154c000 + 16900
2 JavaScriptCore 0x00000001a03d4b6c 0x1a0388000 + 314220
3 JavaScriptCore 0x00000001a03baa18 0x1a0388000 + 207384
4 JavaScriptCore 0x00000001a03932d4 0x1a0388000 + 45780
5 JavaScriptCore 0x00000001a039365c 0x1a0388000 + 46684
6 JavaScriptCore 0x00000001a03d27a4 0x1a0388000 + 305060
7 JavaScriptCore 0x00000001a03d4314 0x1a0388000 + 312084
8 libsystem_pthread.dylib 0x00000001915571ec 0x19154c000 + 45548
9 libsystem_pthread.dylib 0x000000019155aaec 0x19154c000 + 60140
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000000
x4: 0x0000000000000000 x5: 0x0000000000989680 x6: 0x000000000000006e x7: 0xffffffffffffffec
x8: 0x0000000102f69800 x9: 0x0000000000000000 x10: 0x00000000000003e8 x11: 0x000000000000000b
x12: 0x00000001c708b080 x13: 0x0000000000000001 x14: 0x0000000000000010 x15: 0x000000000000004c
x16: 0x0000000000000148 x17: 0x0000000000000000 x18: 0x0000000000000000 x19: 0x0000000000000006
x20: 0x0000000000000407 x21: 0x000000016f5ea5e0 x22: 0x0000000102f698e0 x23: 0x0000000102f698e0
x24: 0x0000000000000013 x25: 0x000000016f8a2390 x26: 0x0000000102f698e0 x27: 0x00000000000020ff
x28: 0x0000000002ffffff fp: 0x000000016f5ea500 lr: 0x000000019154e790
sp: 0x000000016f5ea4e0 pc: 0x0000000191632ebc cpsr: 0x40000000
esr: 0x56000080 Address size fault
onPanResponderRelease not working on android devices
When i am using panResponders on iOS devices it works properly but same code when i run on android devices it is not working as expected. Code is as below
componentWillMount() {
this._panResponder = PanResponder.create({
onStartShouldSetPanResponder: (evt, gestureState) => true,
onStartShouldSetPanResponderCapture: (evt, gestureState) => true,
onMoveShouldSetPanResponder: (evt, gestureState) => true,
onMoveShouldSetPanResponderCapture: (evt, gestureState) => true,
onPanResponderGrant: (evt, gestureState) => {
return true;
},
onPanResponderTerminationRequest: (evt, gestureState) => {
console.log('getting on android');
return false;
},
onPanResponderRelease: (evt, gestureState) => {
console.log('getting here')
return true;
},
onPanResponderTerminate : (evt, gestureState) => {
console.log('gets');
}
});
}
Also my scrollView snippet is as below.
<ScrollView
ref={ref => this.myScroll = ref }
{...this._panResponder.panHandlers}>
Scroll displacement on React Native with Expo
I got this screenshot from a user that says its scroll is displaced in the center as you can see in the image bellow.
I tried using simulator with iPhone XS Max and even my olds iPhone 7 but couldn't reproduce this in anyway. Maybe this is a known bug or something and I was wandering if someone could point me in the right direction.
About the code, I'm using a ScrollView component with the following props:
<View style={{flex: 1}}>
<ScrollView
style={{flexGrow: 1}}
contentContainerStyle={{flexGrow: 1}}
>
// content here
</ScrollView>
</View>
How to get JSON.parser value after save to AsyncStorage using Json.stringfy in react native?
I want to use the data from JSON.stringify that I save locally from async storage, so I can manage them locally (like user data for login)
I already save it to AsyncStorage
componentDidMount = async () => {
fetch('My_url', {
method: 'GET'
})
.then((response) => response.json())
.then((responseJson) => {
console.log(responseJson);
this.setState({
data: responseJson
})
})
.catch((error) => {
console.error(error);
});
}
saveData = async () => {
try {
await AsyncStorage.setItem('user', JSON.stringify(this.state.data));
Alert.alert('Saved', 'Successful');
} catch (error) {
Alert.alert('Error', 'There was an error.')
}
this is the JSON
0
username "admin2"
password "*****"
access "1"
name "dwi"
phone_number "087613721"
email "**@****.com"
score null
status "0"
1
username "admin3"
password "***"
access "1"
name "Satria"
phone_number "****"
email "*****3@*****.com"
score null
status "0"
and I try to get the value using this, but can't show anything in node console.log, it said "unidentified" (i just using press button on this)
displayData = async ()=>{
try{
let user = await AsyncStorage.getItem('user');
let parsed = JSON.parse(user);
console.log(parsed.email);
}
catch(error){
alert(error)
}
}
can some JSON parser output use like to be database function? like for login so we can log in and check the data user from json.parser that I store in the data using async storage? or output some data that we want to be used like in where statement in the SQL ?
How to change React-Native App name in stores?
We're doing a rebranding and therefore having to change the app name.
Of course, as this has to be done with changing the domain, it'll include changing the config, Keychain domain, bundleId, etc.
Is there a way, for a quick start, to only change app name on AppStore and google play without digging into configuration files and without changing domain itself (yet)?