Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all 16564 articles
Browse latest View live

Error React Native IOS Exception '-[__NSDictionaryM length]: unrecognised selector sent to

$
0
0

I am new to IOS development and i have developed and build an app for IOS & Android in React Native and the app is fully working in Android. I have also installed the app on the iPhone simulator for testing, and after successfull build when the apps opens then it crashes and Xcode shows the stack of error.

Stack Trace

2018-03-26 17:18:59.537548+0530 VwWoocommerceAppMain[57934:681649] -[__NSDictionaryM length]: unrecognized selector sent to instance 0x60000023abc0
2018-03-26 17:18:59.555 [fatal][tid:com.facebook.react.AsyncLocalStorageQueue] Exception '-[__NSDictionaryM length]: unrecognized selector sent to instance 0x60000023abc0' was thrown while invoking multiSet on target AsyncLocalStorage with params (
        (
                (
            cart,
                        {
            }
        )
    ),
    5873
)
callstack: (
	0   CoreFoundation                      0x0000000103f8212b __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x0000000102874f41 objc_exception_throw + 48
	2   CoreFoundation                      0x0000000104003024 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x0000000103f04f78 ___forwarding___ + 1432
	4   CoreFoundation                      0x0000000103f04958 _CF_forwarding_prep_0 + 120
	5   VwWoocommerceAppMain                0x0000000101956824 -[RCTAsyncLocalStorage _writeEntry:changedManifest:] + 258
	6   VwWoocommerceAppMain                0x0000000101957104 -[RCTAsyncLocalStorage multiSet:callback:] + 436
	7   CoreFoundation                      0x0000000103f0636c __invoking___ + 140
	8   CoreFoundation                      0x0000000103f06240 -[NSInvocation invoke] + 320
	9   CoreFoundation                      0x0000000103f1ec26 -[NSInvocation invokeWithTarget:] + 54
	10  VwWoocommerceAppMain                0x0000000101966929 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 602
	11  VwWoocommerceAppMain                0x00000001019ac7a8 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 266
	12  VwWoocommerceAppMain                0x00000001019ac522 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78
	13  libdispatch.dylib                   0x0000000108bf32f7 _dispatch_call_block_and_release + 12
	14  libdispatch.dylib                   0x0000000108bf433d _dispatch_client_callout + 8
	15  libdispatch.dylib                   0x0000000108bfc855 _dispatch_queue_serial_drain + 1162
	16  libdispatch.dylib                   0x0000000108bfd1ea _dispatch_queue_invoke + 336
	17  libdispatch.dylib                   0x0000000108bf8f7c _dispatch_queue_override_invoke + 733
	18  libdispatch.dylib                   0x0000000108c00102 _dispatch_root_queue_drain + 772
	19  libdispatch.dylib                   0x0000000108bffda0 _dispatch_worker_thread3 + 132
	20  libsystem_pthread.dylib             0x00000001091465a2 _pthread_wqthread + 1299
	21  libsystem_pthread.dylib             0x000000010914607d start_wqthread + 13
)
2018-03-26 17:18:59.558030+0530 VwWoocommerceAppMain[57934:681649] Exception '-[__NSDictionaryM length]: unrecognized selector sent to instance 0x60000023abc0' was thrown while invoking multiSet on target AsyncLocalStorage with params (
        (
                (
            cart,
                        {
            }
        )
    ),
    5873
)
callstack: (
	0   CoreFoundation                      0x0000000103f8212b __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x0000000102874f41 objc_exception_throw + 48
	2   CoreFoundation                      0x0000000104003024 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x0000000103f04f78 ___forwarding___ + 1432
	4   CoreFoundation                      0x0000000103f04958 _CF_forwarding_prep_0 + 120
	5   VwWoocommerceAppMain                0x0000000101956824 -[RCTAsyncLocalStorage _writeEntry:changedManifest:] + 258
	6   VwWoocommerceAppMain                0x0000000101957104 -[RCTAsyncLocalStorage multiSet:callback:] + 436
	7   CoreFoundation                      0x0000000103f0636c __invoking___ + 140
	8   CoreFoundation                      0x0000000103f06240 -[NSInvocation invoke] + 320
	9   CoreFoundation                      0x0000000103f1ec26 -[NSInvocation invokeWithTarget:] + 54
	10  VwWoocommerceAppMain                0x0000000101966929 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 602
	11  VwWoocommerceAppMain                0x00000001019ac7a8 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 266
	12  VwWoocommerceAppMain                0x00000001019ac522 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78
	13  libdispatch.dylib                   0x0000000108bf32f7 _dispatch_call_block_and_release + 12
	14  libdispatch.dylib                   0x0000000108bf433d _dispatch_client_callout + 8
	15  libdispatch.dylib                   0x0000000108bfc855 _dispatch_queue_serial_drain + 1162
	16  libdispatch.dylib                   0x0000000108bfd1ea _dispatch_queue_invoke + 336
	17  libdispatch.dylib                   0x0000000108bf8f7c _dispatch_queue_override_invoke + 733
	18  libdispatch.dylib                   0x0000000108c00102 _dispatch_root_queue_drain + 772
	19  libdispatch.dylib                   0x0000000108bffda0 _dispatch_worker_thread3 + 132
	20  libsystem_pthread.dylib             0x00000001091465a2 _pthread_wqthread + 1299
	21  libsystem_pthread.dylib             0x000000010914607d start_wqthread + 13
)
2018-03-26 17:18:59.561965+0530 VwWoocommerceAppMain[57934:681649] *** Terminating app due to uncaught exception 'RCTFatalException: Exception '-[__NSDictionaryM length]: unrecognized selector sent to instance 0x60000023abc0' was thrown while invoking multiSet on target AsyncLocalStorage with params (
        (
                (
            cart,
                        {
            }
        )
    ),
    5873
)
callstack: (
	0   CoreFoundation                      0x0000000103f8212b __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x0000000102874f41 objc_exception_throw + 48
	2   CoreFoundation                      0x0000000104003024 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x0000000103f04f78 ___forwarding___ + 1432
	4   CoreFoundation                      0x0000000103f04958 _CF_forwarding_prep_0 + 120
	5   VwWoocommerceAppMain                0x0000000101956824 -[RCTAsyncLocalStorage _writeEntry:changedManifest:] + 258
	6   VwWoocommerceAppMain                0x0000000101957104 -[RCTAsyncLocalStorage multiSet:callback:] + 436
	7   CoreFoundation                      0x0000000103f0636c __invoking___ + 140
	8   CoreFoundation                      0x0000000103f06240 -[NSInvocation invoke] + 320
	9   CoreFoundation                      0x0000000103f1ec26 -[NSInvocation invokeWithTarget:] + 54
	10  VwWoocommerceAppMain                0x0000000101966929 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 602
	11  VwWoocommerceAppMain                0x00000001019ac7a8 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 266
	12  VwWoocommerceAppMain                0x00000001019ac522 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78
	13  libdispatch.dylib                   0x0000000108bf32f7 _dispatch_call_block_and_release + 12
	14  libdispatch.dylib                   0x0000000108bf433d _dispatch_client_callout + 8
	15  libdispatch.dylib                   0x0000000108bfc855 _dispatch_queue_serial_drain + 1162
	16  libdispatch.dylib                   0x0000000108bfd1ea _dispatch_queue_invoke + 336
	17  libdispatch.dylib                   0x0000000108bf8f7c _dispatch_queue_override_invoke + 733
	18  libdispatch.dylib                   0x0000000108c00102 _dispatch_root_queue_drain + 772
	19  libdispatch.dylib                   0x0000000108bffda0 _dispatch_worker_thread3 + 132
	20  libsystem_pthread.dylib             0x00000001091465a2 _pthread_wqthread + 1299
	21  libsystem_pthread.dylib             0x000000010914607d start_wqthread + 13
)', reason: 'Exception '-[__NSDictionaryM length]: unrecognized selector sent to instanc...'
*** First throw call stack:
(
	0   CoreFoundation                      0x0000000103f8212b __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x0000000102874f41 objc_exception_throw + 48
	2   VwWoocommerceAppMain                0x0000000101953a22 RCTFormatError + 0
	3   VwWoocommerceAppMain                0x00000001019ac9bc _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 798
	4   VwWoocommerceAppMain                0x00000001019ac522 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78
	5   libdispatch.dylib                   0x0000000108bf32f7 _dispatch_call_block_and_release + 12
	6   libdispatch.dylib                   0x0000000108bf433d _dispatch_client_callout + 8
	7   libdispatch.dylib                   0x0000000108bfc855 _dispatch_queue_serial_drain + 1162
	8   libdispatch.dylib                   0x0000000108bfd1ea _dispatch_queue_invoke + 336
	9   libdispatch.dylib                   0x0000000108bf8f7c _dispatch_queue_override_invoke + 733
	10  libdispatch.dylib                   0x0000000108c00102 _dispatch_root_queue_drain + 772
	11  libdispatch.dylib                   0x0000000108bffda0 _dispatch_worker_thread3 + 132
	12  libsystem_pthread.dylib             0x00000001091465a2 _pthread_wqthread + 1299
	13  libsystem_pthread.dylib             0x000000010914607d start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

If anyone knows please help.


Getting error Unrecognized font family 'din-next-lt-w23-regular' in react-native 0.61.4 only for iOS

$
0
0

i am using fonts in my app. So i need to add the font din-next-lt-w23-regular in my app. But i am getting error in iOS i.e., Unrecognized font family 'din-next-lt-w23-regular'. I added .ttf files in ios/Resources and info.plist. Here is my code react-native.config.js

module.exports = {
  project: {
    ios: {},
    android: {},
  },
  assets: ['./assets/fonts/'], 
};

Screenshot:- enter image description here

Cocoapods always install old React (0.11.0)

$
0
0

I have a problem when I run pod install Pod always downgrade React Installing React 0.11.0 (was 0.55.4)

my pod file:

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '9.0'
project 'BunteMobile.xcodeproj'
target 'BunteMobile' do
  # Comment this line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for BunteMobile
  pod 'Adjust', '~> 4.8.3'
  pod 'Google-Mobile-Ads-SDK'
  pod 'GoogleAds-IMA-iOS-SDK', '~> 3.7'
  pod 'Fabric', '~> 1.7.0'
  pod 'Crashlytics', '~>  3.9'

  pod 'lottie-ios', :path => '../node_modules/lottie-ios'

  pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'

  target 'BunteMobileTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

I read about some solution when I defined react folder from node_modules but this solution doesn't work for me too.

I put into podfile this:

pod 'yoga', path: './node_modules/react-native/ReactCommon/yoga'
pod 'React', :path => '../node_modules/react-native'

but still doesn't work. Downgrade disappear but when I try to build it, I have this error:

/node_modules/react-native/React/Base/RCTConvert.h:17:9: could not build module 'yoga'

I tried the same profile as official RN doc (https://facebook.github.io/react-native/docs/integration-with-existing-apps.html) but still same error.


Solution

I added this into my podfile:

# Pods for React-Native start
  pod 'React', :path => '../node_modules/react-native'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'

(update 2019)Solution 2 (react-native 0.61+): add this to pod file

  # Pods for React-Native start
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

How can I present a native UIViewController in React Native?

$
0
0

I am trying to use mpandroidchart's IOS version package in RN native IOS, This is how I tried to implement it.

ChartManager.m

#import "React/RCTViewManager.h"

@interface RCT_EXTERN_MODULE(RNTChartManager, RCTViewManager)

@end

ChartManager.swift

import Foundation
import UIKit
import React

@objc(RNTChartManager)
class RNTChartManager: RCTViewManager {
  override func view() -> UIView! {
    let label = UILabel()
    label.text = "Hello world"
    label.textAlignment = .center
    return label
  }
}

ChartViewController.swift

import Foundation
import UIKit
import Charts
import React

class BarChartViewController: UIViewController {

  @IBOutlet weak var barChartView: BarChartView!

    override func viewDidLoad() {
        super.viewDidLoad()
        barChartView.noDataText = "You need to provide data for the chart."
    }

}

AppName-Bridging-Header.h

#ifndef Investor_Bridging_Header_h
#define Investor_Bridging_Header_h
#import "React/RCTBridgeModule.h"
#import "React/RCTViewManager.h"
#import "React/RCTBundleURLProvider.h"

#endif

How would I do this in React Native? I can't write a bridged UI component since it's a UIViewController, not a UIView. Thanks in advance

Module RCTEventEmitter is not a registered callable module

$
0
0

This problem has already been addressed, but in my case it seems to be of a different type.

App.js Code:

import React, {Component} from 'react';
import { AppRegistry,StyleSheet, Text, View} from 'react-native';


export default class MainApp extends React.Component{

  static navigationOptions = () => ({
    title: "Home",
    headerTintColor:"white",

  })

  render(){
    return(
      <View>
        <Text>Hello World !</Text>
      </View>
    )
  }
}

I have import react native elements and react navigation as libraries using yarn.

React Native drag down to open a top to bottom sliding sheet, drawer, modal, etc

$
0
0

A bottom sheet, drawer, etc. (lots of names, I'll be calling it sheet) is used a lot in apps and there are a lot of RN packages for it. I need one top-down, not bottom-up. The video below shows what I need, but top-down instead of bottom-up.

https://youtu.be/lMo3KI1-9Ps

The image below is a screenshot of the app. The red bar at the top needs to be pulled down to open a second window (this may be a modal). The sheet must be over the tab navigator at the bottom (Home, Subjects, etc.), and must be able to navigate to another page and back. This bar currently sits on a custom header that's loaded via React Navigation's header object. This header receives the navigation prop from the page it's loaded in from. It's no issue if it basically extends the total height of the header to the full page (this will probably the easiest solution). Must work on both android and iOS. We're using expo.

enter image description here

I noticed this package has a height offset which may be quite useful.

EDIT: We're currently testing react-native-slide-down. We'll update the post when we have any results on it.

Implement drawer from native base in react native app

$
0
0

I need to use drawer from native base into react native app for both android ios et android. Here is the link for native base http://nativebase.io/docs/v2.0.0/components#drawer and below you'll find my code :

import { Container, Header, Title, Content, Button, Icon, Left,  Body, Text } from 'native-base';
import { Drawer } from 'native-base';    
import SideBar from '../components/SideBar';   
class App extends Component {
        closeDrawer = () => {
        this._drawer._root.close();
    }
    openDrawer = () => {
        alert('open');
        this._drawer._root.open();
    }
    render() {   
        return (
            <Container>
                <Header style={{ backgroundColor: '#C0C0C0' }}>
                    <Left>
                        <Button transparent onPress={this.openDrawer.bind(this)}>
                            <Icon style={style.icon} name='menu'  />
                        </Button>    
                    </Left>
                    <Body style={style.body}>
                    <Title style={{ color: '#FFF'}}> title </Title>
                    </Body>   
                </Header>
                 <Content>
                     <Drawer
                    ref={(ref) => { this._drawer = ref; }}
                    content={<SideBar />} >
                    </Drawer>
                </Content>

            </Container>
        );
    }

the alert in the method open drawer is working fine, so i know it's not a problem in the button.

react native - Camera Roll returned uri does not have file's extension

$
0
0

React native has a good lib like CameraRoll which allow us to access the media files of phones. However, the returned uri is missing the extension:

{ node: 
  { timestamp: 1344461389.8,
   type: 'image', <= it is used to be 'image/png' instead of 'image'
   group_name: 'Camera Roll',
   location: 
    { altitude: 0,
      longitude: -14.538611666666666,
      latitude: 64.752895,
      heading: 0,
      speed: 0.8999988197665498 },
   image: 
    { width: 1668,
      uri: 'ph://99D53A1F-FEEF-40E1-8BB3-7DD55A43C8B7/L0/001', <= there is no file's extension
      height: 2500,
      isStored: true,
      playableDuration: 0 } } },

If you know a way to get the extension or any work around in this case, please let me know.

Thank you in advance!


How do I paging in foreach with react-native

$
0
0

Learn the width of the elements to be rendered. If the sum of the width exceeds the width of the device screen, I want to wrap it with an and return it.

Is there a way I would like to make data dynamic with.

react-native for :

getItem() {
    return item.map(item => {
        return (
            <View><Text>{item.name}</Text></View>
        )
    })
}

React Native bridge EventEmitters from UIViewController

$
0
0

So I’m using an SDK that returns a view. Right now I have it as a UIViewController and then I'm creating an instance of that in another class that's an RCTViewManager and returning the instance view to bridge it. How would you bridge EventEmitters from the ViewController to React Native with an RCTViewManager in the middle of them? Thanks so much for your time!

This is my RCTViewManager that's exporting my view and functions, I just need Event Emitters now

import Foundation
import UIKit

@objc(MapViewManager)
class MapViewManager : RCTViewManager {
  var viewController:SDKViewController? = SDKViewController.init()


  @objc(functionOne)
  func functionOne(){
    DispatchQueue.main.async {
       self.viewController?.functionOne()
    }
  }
  @objc(functionTwo)
  func functionTwo(){
    DispatchQueue.main.async {
       self.viewController?.functionTwo()
    }
  }
  override func view() -> UIView! {
    return self.SDKViewController?.view
  }

  }


Cropped image is very small in react-native

$
0
0

I would like to crop my image and I used @react-native-community/image-editor I want to crop the image from the base64 image so I used RNFetchBlob too. Here is my code.

const file_path =
      RNFetchBlob.fs.dirs.DocumentDir + '/' + new Date().getTime() + '.jpg';
RNFetchBlob.fs
      .writeFile(file_path, this.state.image, 'base64')
      .then(res => {
        console.log(res);
        ImageEditor.cropImage(
          'file:///' + file_path,
          {
            offset: {x: topX, y: topY},
            size: {width: bottomX - topX, height: bottomY - topY},
            displaySize: {width: bottomX - topX, height: bottomY - topY},
          },
          'PNG',
        ).then(url => {
          console.log(url);
          this.setState({visible: true, cropedImage: url});
        });
      });

It's working on Android but in iOS it's very small like 20*20 pixel even I set the size as more than 1000 pixel. I should upload cropped image to the server so I need the file of the cropped image. Thank you for your answer.

Expo: After upgrading from expo 33 to 35 I got error, only in IOS "Native module cannot be null"

$
0
0

I saw a lot of question asking similar to this but I don't know which libraries causing the error. Its been a while since I tried running my app on IOS, I already installed a lot of libraries so I can't trace back which module/libraries are causing the error. Before its working, in android its working fine.

enter image description here

React Native: How can I detect if my code is running in the Simulator?

$
0
0

In a Obj-C iOS app I can use #if (TARGET_IPHONE_SIMULATOR) to write simulator-only code.

In react native I can use:

if (__DEV__) {
 .. do something special
}

.. to detect development mode.

We can use Platform.OS === 'ios' to detect the platform (Android/iOS). See here for more info Platform Docs

But how do we detect if the app is running in the simulator?

The reason I ask is that my app uses the camera to scan barcodes, and this isn't supported in the iOS Simulator.

Selectively stopping the push notification listener or toggling the _displayInForeground for Expo Push Notifications

$
0
0

Expo Push Notification has the _displayInForeground property that can be set to allow receiving push notifications when the app in the foreground. Currently, I have the notification listener activated upon mounting the home screen, which is the very first screen.

Is there a way to either turn off the listener or toggle the _displayInForeground only when the user is in the chat screen? I don't want the push notifications for the chat messages coming in while the user is on the chat screen.

Expo on iOS is constantly refreshing my React Native app on MacOS, caused by Dropbox / iCloud

$
0
0

I'm building a simple React Native app and using the Expo iOS app to run it. But Expo is constantly refreshing my app, making it unusable / untestable. It refreshes every few seconds, sometimes multiple times a second, when I haven't changed anything. The only times when there is enough of a break between refreshes for me to test out the app is when, in my terminal, the app decides to rebuild (Again, nothing changed) and takes a few seconds to rebuild the bundle.

I set up the app using create-react-native-app and run it with npm start -- I've changed nothing else, besides adding a few components.

I've tried quitting my IDE (Sublime) and changing to a stronger wifi network.

I'm developing on macOS Sierra 10.12.2 and running on an iPhone 6S.


iOS back button cell color behaviour

$
0
0

I'm looking for the name of the behaviour where when you are in a subview, and when you press the back button the cell you pressed has the tap state color for a short time. Is there a name for this behaviour? I see this in many iOS native apps. For example in Notes.app, when I'm in a note (Test2) and go back the cell looks like this for a very short time.

Example screenshot

enter image description here

Is this behaviour also possible in React Native?

Customise tabs of native base

$
0
0

I need to customise tabs (change their background color ) from native base in my react native application, like shown in the image enter image description here

I've already tried this style={{ backgroundColor: '#C0C0C0' }} but i keep getting the default theme.

React-Native geolocation works on Android device but not on iPhone

$
0
0

Using react-native's geolocation module on android works fine but on iphone device it doesn't work either error message of any of the module's functions

I tried using the direct method on the page component as a function that makes it asynchronous but it didn't work, using the action that goes through the saga middleware doesn't work either. I tried all the module methods and none of them I have an answer

Componente Position(Page)

import React, {useState, useEffect} from 'react';
import {useDispatch, useSelector} from 'react-redux';

import {Container, Image} from './styles';

import * as PositionActions from '../../store/modules/position/action';

import Header from '../../components/Header';
import Button from '../../components/Button';
import ButtonGroup from '../../components/ButtonGroup';
import Fundo from '../../../assets/images/FundoPosicionamento.png';

export default function Position() {

  const dispatch = useDispatch();

  function handlePositionDot(dot) {
    dispatch(PositionActions.PositionRequest(dot));
  }

  return (
    <Container>
      <Image source={Fundo} resizeMode="stretch">
        <Header buttonExist={false} />
        <ButtonGroup

          functionOnPressA={() => handlePositionDot(true)}
        />
      </Image>
    </Container>
  );
}

Actions position

export function PositionRequest(dot) {
  return {
    type: '@position/REQUEST_POSITION',
    payload: {
      dot,
    },
  };
}

Sagas position

import Geolocation from '@react-native-community/geolocation';

function getCurrentPosition() {
  return new Promise((resolve, reject) => {
    Geolocation.getCurrentPosition(resolve, reject, {
      enableHighAccuracy: true,
      timeout: 15000,
      maximumAge: 500,
    });
  });
}

function* requestPosition(action) {
  yield put(
    PositionLoadingActivityOnDot('gravando informações...', action.payload.dot)
  );
  try {
    const position = yield call(getCurrentPosition);
    console.tron.log(position)
    const {accuracy, altitude, longitude, latitude} = position.coords;
    yield put(
      PositionRequestSuccess(
        'coletada localização com sucesso',
        action.payload.dot,
        accuracy,
        altitude,
        longitude,
        latitude
      )
    );
  } catch (err) {
    yield put(
      PositionRequestFailure(
        '005-erro de localização verifique seu smartphone',
        action.payload.dot
      )
    );
  }
}

pakcage.json

"dependencies": {
    "@react-native-community/async-storage": "^1.6.1",
    "@react-native-community/geolocation": "^2.0.2",
    "axios": "^0.19.0",
    "immer": "^4.0.0",
    "prop-types": "^15.7.2",
    "react": "16.8.6",
    "react-native": "0.60.5",
    "react-native-gesture-handler": "^1.4.1",
    "react-native-masked-text": "^1.13.0",
    "react-native-reanimated": "^1.2.0",
    "react-native-vector-icons": "^6.6.0",
    "react-navigation": "^4.0.3",
    "react-navigation-stack": "^1.5.5",
    "react-redux": "^7.1.1",
    "reactotron-react-native": "^3.6.5",
    "reactotron-redux": "^3.1.1",
    "reactotron-redux-saga": "^4.2.2",
    "redux": "^4.0.4",
    "redux-saga": "^1.0.5",
    "styled-components": "^4.3.2"
}

info system

System:
    OS: macOS High Sierra 10.13.6
    CPU: (8) x64 Intel(R) Core(TM) i7-2675QM CPU @ 2.20GHz
    Memory: 33.22 MB / 4.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.16.0 - /usr/local/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    Android SDK:
      API Levels: 26, 27, 28, 29
      Build Tools: 27.0.3, 28.0.3, 29.0.0
      System Images: android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.2 AI-181.5540.7.32.5056338
    Xcode: 10.1/10B61 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6
    react-native: 0.60.5 => 0.60.5
  npmGlobalPackages:
    react-native-cli: 2.0.1

info.pslist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN""http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>Betta Hidroturbinas</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSExceptionDomains</key>
        <dict>
            <key>localhost</key>
            <dict>
                <key>NSExceptionAllowsInsecureHTTPLoads</key>
                <true/>
            </dict>
        </dict>
    </dict>
    <key>NSLocationAlwaysUsageDescription</key>
    <string>NSLocationAlwaysAndWhenInUseUsageDescription</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string></string>
    <key>UIAppFonts</key>
    <array>
        <string>Roboto-Black.ttf</string>
        <string>Roboto-BlackItalic.ttf</string>
        <string>Roboto-Bold.ttf</string>
        <string>Roboto-BoldItalic.ttf</string>
        <string>Roboto-Light.ttf</string>
        <string>Roboto-LightItalic.ttf</string>
        <string>Roboto-Medium.ttf</string>
        <string>Roboto-MediumItalic.ttf</string>
        <string>Roboto-Regular.ttf</string>
        <string>Roboto-RegularItalic.ttf</string>
        <string>Roboto-Thin.ttf</string>
        <string>Roboto-ThinItalic.ttf</string>
    </array>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
</dict>
</plist>

Not a mensage the error,not a return. in reactotron https://ibb.co/0M54GMC

Integrating Firebase Crashlytics with react native app - stuck in verification

$
0
0

I am trying to integrate Firebase Crashlytics with react native app. Firebase integration done. Already using firebase service for push notification. It's fine. I'm using cocoapods and added this pods.

pod 'Fabric', '~> 1.10.2'
pod 'Crashlytics', '~> 3.14.0'

updated the pod using pod update.

I'm not using "use_frameworks!" inside pod because of some reasons.

After all, I built my app to reacl device in both debug mode and release mode. But it is not redirecting firebase console to crashlytics dashboard.

Moreover I have imported react-native-firebase and added these lines in main home page,

firebase.crashlytics().log('Test Message!');
firebase.crashlytics().recordError(37, "Test Error");

But firebase console stuck in the following page itself,

Firebase Console

I have verified the app package name and plist file. all are proper with this firebase account.

None of the workarounds are helping. Please suggest some directions to enable crashlytics. Thanks for any help!

How to get current network information for a given network interface on iOS 13

$
0
0

I'm trying to implement an app that uses the BSSID of the network that the user is currently connected to on iOS 13.

However, Apple's documentation for CNCopyCurrentNetworkInfo on iOS 13 is not clear in its requirements for usage of their API.

It states the following in its description:

The requesting app must meet one of the following requirements:

  • The app uses Core Location, and has the user’s authorization to use location information.

  • The app uses the NEHotspotConfiguration API to configure the current Wi-Fi network.

  • The app has active VPN configurations installed.

This seems to suggest that only needs to meet one out of the 3 requirements listed above.

However, it subsequently states:

An app that fails to meet any of the above requirements receives the following return value:

  • An app linked against iOS 12 or earlier receives a dictionary with pseudo-values. In this case, the SSID is Wi-Fi (or WLAN in the China region), and the BSSID is 00:00:00:00:00:00.

  • An app linked against iOS 13 or later receives NULL.

This suggests that the app needs to meet all of the above requirements

This makes it extremely confusing as to what the requirements are, since the former part claims that you only need to implement one of the three in order to get the BSSID, whereas the latter part states that you won't get it if you miss out on any of the three requirements.

Any help on this would be much appreciated!

Viewing all 16564 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>