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

Passing Data Using React-Native Navigation

$
0
0

Im trying to pass data between screens in my app. Currently I am using


"react-native": "0.46.0",
"react-navigation": "^1.0.0-beta.11"

I have my index.js


 import React, { Component } from 'react';
    import {
      AppRegistry,
    } from 'react-native';
    import App from './src/App'
    import { StackNavigator } from 'react-navigation';
    import SecondScreen from './src/SecondScreen'    

    class med extends Component {
      static navigationOptions = {
        title: 'Home Screen',
      };

      render(){
        const { navigation } = this.props;

        return (
          <App navigation={ navigation }/>
        );
      }
    }

    const SimpleApp = StackNavigator({
      Home: { screen: med },
      SecondScreen: { screen: SecondScreen, title: 'ss' },    
    });

    AppRegistry.registerComponent('med', () => SimpleApp);

app as

    import React, { Component } from 'react';
    import {
      StyleSheet,
      Text,
      Button,
      View
    } from 'react-native';
    import { StackNavigator } from 'react-navigation';

    const App = (props)  => {
      const { navigate } = props.navigation;

      return (
        <View>
          <Text>
            Welcome to React Native Navigation Sample!
          </Text>
          <Button
              onPress={() => navigate('SecondScreen', { user: 'Lucy' })}
              title="Go to Second Screen"
            />
        </View>
      );
    }

    export default App

then in the secondscreen.js where we will fetch the data which passed from the previous screen as


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

    import { StackNavigator } from 'react-navigation';


    const SecondScreen = (props)  => {
      const { state} = props.navigation;
      console.log("PROPS" + state.params);


      return (
        <View>
          <Text>
            HI
          </Text>

        </View>
      );
    }

    SecondScreen.navigationOptions = {
      title: 'Second Screen Title',
    };

    export default SecondScreen

Whenever I console.log I get undefined.
https://reactnavigation.org/docs/navigators/navigation-prop The docs say every screen should have these values what am I doing wrong?


White line above BottomTabNavigator in react-native

$
0
0

I just started developing an app in react-native and added a bottom navigation. I then started styling the components and noticed a white line above the navigation, which i simply can't get rid of.

Picture of the Problem

enter image description here

Any idea on how to make that line have the same color as the background would be appreciated. It might be possible that the default background color behind the views is "shining through" since it's white and I have no idea how to change it. The app is only supposed to work on my own iPhone XR, so I'm not concerned about compatibility with android or other iPhone models

I'm a complete beginner regarding react-native, so bear with me here. Here is my code so far:

Navigation

const Tab = createBottomTabNavigator();

export default function App() {
    return (
        <NavigationContainer>
            <Tab.Navigator
                tabBarOptions={{
                    activeTintColor: Colors.tabIconSelected,
                    inactiveTintColor: Colors.tabIconDefault,
                    style: styles.container
                }}>
                <Tab.Screen
                    name="Payments"
                    component={PaymentScreen}
                    options={{
                        tabBarIcon: ({focused}) => <TabBarIcon focused={focused} name="logout"/>
                    }}/>
                <Tab.Screen
                    name="Income"
                    component={IncomeScreen}
                    options={{
                        tabBarIcon: ({focused}) => <TabBarIcon focused={focused} name="login"/>
                    }}/>
            </Tab.Navigator>
        </NavigationContainer>
    );
}

const styles = StyleSheet.create({
    container: {
        backgroundColor: Colors.darkBackgroundColor,
    }
});

Payment View

export default class PaymentScreen extends Component{
    render() {
        return (
            <View style={styles.container}>
                <Text style={styles.text}>Payments!</Text>
            </View>
        )
    }
}

const styles = StyleSheet.create({
    container:{
        flex: 1,
        alignItems: 'center',
        justifyContent: 'center',
        backgroundColor: Colors.backgroundColor,
    },
    text:{
        color: Colors.textColor
    }
});

React Native - Can't access to contacts, calendar in iOS release mode

$
0
0

I'm developing an app with React Native and I'm struggling with the access to the contacts, calendar and maybe more "native features".

I'm using

"react": "16.8.3",
"react-native": "0.59.9",
"react-native-add-calendar-event": "2.3.1",
"react-native-contacts": "^3.1.4",

When trying my app on Android or the iOS simulator I can access everything (contacts and calendar) but when I release my iOS app: I have the alert to allow permissions and then nothing happen ... No contacts or nothing added to the calendar.

I began to understand I had a problem when I faced the issue with the calendar whatever package I used in my app.

I think I have a difference/problem between dev and release mode for accessing native phone features but I'm not really sure that my "contacts" and "calendar" issues are linked to the same problem.

Do someone have an idea about why I could not access any of those features in my app releases ?

Scanning ISBN using phone camera

$
0
0

I'm creating an app that is able to scan the ISBN of a book and then populate fields based off of that number. My main issue is I'm struggling to find a good API that does that. I'm using react native to build my app. Google has only resulted in finding barcode scanners, which is not what I need.

Apple Match-O Linker Error / clang: error: no such file or directory - Xcode 11

$
0
0

I am working on a React Native application and whenever I try to build the application I am encountering these errors. I know there are many similar questions on this matter but the solutions given there are not working for me.

clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRCTRestart.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libReactNativePermissions.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRNCPushNotificationIOS.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRNReanimated.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRNGestureHandler.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRNMixpanel.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRNCAsyncStorage.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRCTAnimation.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRNVectorIcons.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRNReactNativeDocViewer.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRNFS.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libCodePush.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRNDocumentPicker.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRNImagePicker.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRNI18n.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRNBlur.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libART.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRCTVideo.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRCTActionSheet.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRCTGeolocation.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRCTImage.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRCTLinking.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRCTNetwork.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRCTSettings.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRCTText.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRCTVibration.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRNSpinkit.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRNSentry.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRNGeocoder.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRCTContacts.a'
clang: error: no such file or directory: '/Users/FaisalHussain/Library/Developer/Xcode/DerivedData/blonk-eatmzbgmhuzfadfqxgotpiqwsapb/Build/Products/Debug-iphonesimulator/libRNOpenAppSettings.a'

I have searched but I am still stuck here. I have tried linking using react-native link. I have tried deleting the DerivedData folder for the application. Hence I have tried everything but can't seem to find a solution for this. So I turned to you guys please suggest any solution to fix this. Looking forward to your answers. Thank you in advance.

GPS location fluctuating in react native

$
0
0

I am using GPS location in one of my app in react native. I need to track user location at some intervals. but I am getting different latitude and longitude. I have already set it for high accuracy. But it does not return the accurate location of the user. Also, I found GPS return different locations in IOS and Android. Please help me with how I can get exact location of the user.

No podspec found for `appcenter` in `../node_modules/appcenter/ios/appcenter.podspec`

$
0
0

Trying to install microsoft AppCenter on our react-native app and encounter the following issue

No podspec found for `appcenter` in `../node_modules/appcenter/ios/appcenter.podspec`

The version number is

"appcenter": "3.0.0",

The line in our podfile is

 pod 'appcenter', path: '../node_modules/appcenter/ios/appcenter.podspec'

RNCamera crashes in iOS

$
0
0

I'm developing a video recording app in React Native and I'm using 'react-native-camera' package. Of course, I used RNCamera and the thing is it's fine in android but crashes in iOS. When I open the screen where RNCamera is used, the app just crashes and turn off. I can't get information why this issue occurs. If anyone has experience with this problem, I beg your help. Thank you.

"react": "16.9.0",
"react-native": "0.61.5",
"react-native-camera": "3.15.0"<RNCamera
    ref={ref => {
        this.camera = ref;
    }}
    style={{ flex: 1 }}
    type={RNCamera.Constants.Type.front}
/>

Unable to resolve "@react-navigation/drawer" from "App.js" - React Native

$
0
0

I have issues with drawer. I have follow tutorial and create drawer navigation with React Native and I got this error on iOS. But android works fine.

Note : I have installed drawer package into my project

How to mark user's current location on map in offline using react-native-maps?

$
0
0

I want to mark the user location using gps and overlay a circle around the dropped pin(i.e the current user location) using react-native-maps. This is working fine in online mode on both android and iOS. But I wanted to function this in the same way on offline mode too. I'm using react-native-geolocation-service to fetch the user's current location. Is there any way to implement this functionality in offline mode

React Native loading new copy of image into memory on entering background in iOS app

$
0
0

I've created a fresh React Native project (v0.60.4) and I'm running it on a real iPhone 11 Pro iOS 13.1.3 in release mode. The app.js is super simple:

import React from 'react';
import {
  SafeAreaView,
  Image,
} from 'react-native';

const App: () => React$Node = () => {
  return (
      <SafeAreaView>
        <Image source={require('./test.png')} />
      </SafeAreaView>
  );
};

export default App;

I've noticed that every time my app enters the background (when I switch to another app), I see a jump in memory usage that's never freed (even with memory warnings).

enter image description here

I can see that the increase is caused by a new ImageIO_PNG_Data, created as the app moves into the background.

While this image is relatively modest in size, in my real app it's causing app crashes after the user app switches a lot.

Here's the same app, same image, written in Swift, using the same method to create a UIImage that RN is using.

enter image description here

No extra images loaded into memory. What is RN doing differently that's loading these extra images into memory and not clearing the old ones? What's happening when the app enters the background?

Update

After marking a generation I noticed that all of the large images were coming from what looks like iOS's snapshot of the app as it entered the background:

   0 libsystem_kernel.dylib mmap
   1 ImageIO _ImageIO_Malloc
   2 ImageIO AppleJPEGReadPlugin::copyImageBlockSet(InfoRec*, CGImageProvider*, CGRect, CGSize, __CFDictionary const*)
   3 ImageIO IIO_Reader::CopyImageBlockSetProc(void*, CGImageProvider*, CGRect, CGSize, __CFDictionary const*)
   4 ImageIO IIOImageProviderInfo::CopyImageBlockSetWithOptions(void*, CGImageProvider*, CGRect, CGSize, __CFDictionary const*)
   5 CoreGraphics CGImageProviderCopyImageBlockSetWithOptions
   6 QuartzCore CA::Render::copy_image(CGImage*, CGColorSpace*, unsigned int, double, double)
   7 QuartzCore CA::Render::prepare_image(CGImage*, CGColorSpace*, unsigned int, double)
   8 QuartzCore CA::Layer::prepare_commit(CA::Transaction*)
   9 QuartzCore CA::Context::commit_transaction(CA::Transaction*, double)
  10 QuartzCore CA::Transaction::commit()
  11 UIKitCore __83-[UIApplication _createSnapshotContextForScene:withName:performLayoutWithSettings:]_block_invoke_4
  12 UIKitCore -[UIApplication _performWithUICACommitStateSnapshotting:]
  13 UIKitCore __83-[UIApplication _createSnapshotContextForScene:withName:performLayoutWithSettings:]_block_invoke_2
  14 UIKitCore +[UIView(Animation) performWithoutAnimation:]
  15 UIKitCore __83-[UIApplication _createSnapshotContextForScene:withName:performLayoutWithSettings:]_block_invoke
  16 UIKitCore -[UIScene _applyOverrideSettings:forActions:]
  17 UIKitCore -[UIWindowScene _applySnapshotSettings:forActions:]
  18 UIKitCore -[UIApplication _createSnapshotContextForScene:withName:performLayoutWithSettings:]
  19 UIKitCore __65-[UIApplication _performSnapshotsWithAction:forScene:completion:]_block_invoke_3
  20 FrontBoardServices -[FBSSceneSnapshotAction _executeNextRequest]
  21 FrontBoardServices -[FBSSceneSnapshotAction _executeNextRequest]
  22 FrontBoardServices -[FBSSceneSnapshotAction executeRequestsWithHandler:completionHandler:expirationHandler:]
  23 UIKitCore __65-[UIApplication _performSnapshotsWithAction:forScene:completion:]_block_invoke_2
  24 UIKitCore -[UIApplication _beginSnapshotSessionForScene:withSnapshotBlock:]
  25 UIKitCore __65-[UIApplication _performSnapshotsWithAction:forScene:completion:]_block_invoke
  26 UIKitCore -[UIScene _enableOverrideSettingsForActions:]
  27 UIKitCore -[UIScene _performSystemSnapshotWithActions:]
  28 UIKitCore -[UIApplication _performSnapshotsWithAction:forScene:completion:]
  29 UIKitCore __98-[_UISceneSnapshotBSActionsHandler _respondToActions:forFBSScene:inUIScene:fromTransitionContext:]_block_invoke_3
  30 UIKitCore __98-[_UISceneSnapshotBSActionsHandler _respondToActions:forFBSScene:inUIScene:fromTransitionContext:]_block_invoke.30
  31 UIKitCore -[UIApplication prepareSnapshotsWithAction:forScene:completion:]
  32 UIKitCore __98-[_UISceneSnapshotBSActionsHandler _respondToActions:forFBSScene:inUIScene:fromTransitionContext:]_block_invoke_2
  33 UIKitCore -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:]
  34 UIKitCore -[UIScene scene:didUpdateWithDiff:transitionContext:completion:]
  35 UIKitCore -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:]
  36 FrontBoardServices -[FBSSceneImpl updater:didUpdateSettings:withDiff:transitionContext:completion:]
  37 FrontBoardServices __88-[FBSWorkspaceScenesClient sceneID:updateWithSettingsDiff:transitionContext:completion:]_block_invoke_2
  38 FrontBoardServices -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:]
  39 FrontBoardServices __88-[FBSWorkspaceScenesClient sceneID:updateWithSettingsDiff:transitionContext:completion:]_block_invoke
  40 libdispatch.dylib 0x102a9b2a7
  41 libdispatch.dylib 0x102a9e9cf
  42 FrontBoardServices __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__
  43 FrontBoardServices -[FBSSerialQueue _queue_performNextIfPossible]
  44 FrontBoardServices -[FBSSerialQueue _performNextFromRunLoopSource]
  45 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
  46 CoreFoundation __CFRunLoopDoSource0
  47 CoreFoundation __CFRunLoopDoSources0
  48 CoreFoundation __CFRunLoopRun
  49 CoreFoundation CFRunLoopRunSpecific
  50 GraphicsServices GSEventRunModal
  51 UIKitCore UIApplicationMain
  52 tmp main /...
  53 libdyld.dylib start

FlatList item click is not rendering this

$
0
0
export default class HistoryScreen extends BaseScreen {

    constructor(props){
        super(props);   
        this.state = {
            mainListData:[],
            listData:[],
            searchText:'',
        };
    }

    listRowPressed(item) {  
        this.props.navigation.navigate('Details', {
            checkin: item.data
          });
    }

    render() {
        return (
            <View style={styles.container}>

                <View style={{ flex:1, backgroundColor: '#FFF'}}>

                    <FlatList
                        data={this.state.listData}
                        renderItem={({item}) => <ListComp data={item} />}
                        keyExtractor={(item, index) => index.toString()}
                    />
                  </View>
            </View>
        );
      } 
}

const ListComp = item => (

    <TouchableOpacity onPress={() => this.listRowPressed(item)
    }>
        <View style={styles.row}>                                       
        </View>
    </TouchableOpacity>
);

I am displaying data in FlatList, however clicking on item gives me this4. listRowPressed is undefined, I tried binding the function too but didn't work. What is wrong in the code?

React Native developer Menu not loading

$
0
0

Developer menu in ios simulator will not launch with either cmd + D or cmd + ctrl + z

  • things i've checked (in no order) :

    • cmd + r works properly
    • myApp and myAppTests schemes are set to debug mode
    • Slow Animations is off
    • Hardware > Keyboard > Connect Hardware Keyboard is on
    • watchman 4.7.0 is installed with brew install watchman (--HEAD needed libtoolize, in which brew changed to glibtoolize, therefore ./autogen couldn't find it )
    • Cleaned out Derived Data folder
    • Created new scheme for target
    • Upgraded XCode to 8.2.1 -> 8.3.1
    • react-native start --clear-cache starts successfully, react-native run-ios builds successfully
  • Other Issues

    • nw_connection_get_connected_socket_block_invoke 1262 Connection has no connected handler run indefinitely
    • react-native run-ios outputs

    Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/zelosApp.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not ExistCommand failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/zelosApp.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not Exist

  • Versions

    • react-native = "^0.43.3"
    • watchman = "4.7.0"
    • xcode = "8.3.1"

Any tips / questions would be greatly appreciated!

Error when running pod install: Invalid attribute name

$
0
0

I am working with React Native (0.60.4) and cocoapods (1.7.5). When I cd into my ios folder and run pod install, I get the following error:

[!] Invalid `Podfile` file: [!] /Users/stephensmac_air/Documents/WeeklyTasks/node_modules/.bin/react-native config

Error: Invalid attribute name
Line: 36
Column: 18
Char: .
    at error (/Users/stephensmac_air/Documents/WeeklyTasks/node_modules/xmldoc/node_modules/sax/lib/sax.js:666:10)
    at strictFail (/Users/stephensmac_air/Documents/WeeklyTasks/node_modules/xmldoc/node_modules/sax/lib/sax.js:692:7)
    at SAXParser.write (/Users/stephensmac_air/Documents/WeeklyTasks/node_modules/xmldoc/node_modules/sax/lib/sax.js:1324:13)
    at new XmlDocument (/Users/stephensmac_air/Documents/WeeklyTasks/node_modules/xmldoc/lib/xmldoc.js:199:15)
    at readManifest (/Users/stephensmac_air/Documents/WeeklyTasks/node_modules/@react-native-community/cli-platform-android/build/config/readManifest.js:44:10)
    at Object.projectConfig (/Users/stephensmac_air/Documents/WeeklyTasks/node_modules/@react-native-community/cli-platform-android/build/config/index.js:60:46)
    at Object.get project [as project] (/Users/stephensmac_air/Documents/WeeklyTasks/node_modules/@react-native-community/cli/build/tools/config/index.js:134:65)
    at /Users/stephensmac_air/Documents/WeeklyTasks/node_modules/@react-native-community/cli/build/commands/config/config.js:8:452
    at Array.forEach (<anonymous>)
    at _objectSpread (/Users/stephensmac_air/Documents/WeeklyTasks/node_modules/@react-native-community/cli/build/commands/config/config.js:8:392)


My Podfile in my ios folder is the following:

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'WeeklyTasks' do
  # Pods for WeeklyTasks
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
  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-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'

  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 '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'

  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

  pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'

  pod 'RNCPushNotificationIOS', :path => '../node_modules/@react-native-community/push-notification-ios'

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

  use_native_modules!
end

target 'WeeklyTasks-tvOS' do
  # Pods for WeeklyTasks-tvOS

  target 'WeeklyTasks-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

Anyone know what this error is trying to say? Before this I was trying to implement push notifications and I needed to run pod install and this ended up happening. Seems like maybe there is a syntax problem in the Podfile that I'm not noticing? If someone can point me in the general direction of what this could potentially be, I'd greatly appreciate it. Thank you!

React-Native (IOS) - Is there a way to access the files in filestorage e.g Downloads in the background process

$
0
0

I want to access the files downloaded by the user on IOS OS in my react-native application. Is it feasible to do that?(as a background process?)


Reset Push Notifications/Device Registration/Instance Id - App Update via TestFlight or App Store - Firebase Cloud Messaging iOS/React Native Firebase

$
0
0

Been doing a lot of research on this issue, first my setup:

My issue quite simple and straight forward though I do not seem to be able to find a clear way to resolve the issue.

I deployed version 4.2 of my app. Firebase Cloud Messaging (FCM) in iOS works just dandy. I then deployed 4.3 to TestFlight to begin testing. Installed 4.3 via TestFlight and FCM stopped working, no push notifications. If I delete the app and install 4.3 via TestFlight push notifications work again, the device is registered.

I can also reproduce this issue updating the installed version of my app from the App Store published latest, no surprise there.

I know that the InstanceId/device token is based on the app build+device so it makes sense that the token changes when the app Updates but my token is the same when I update from 4.2 to 4.3:

const fcmToken = await firebase.messaging().getToken(); //same whether 4.2 or 4.3

And yes firebase.messaging().getToken() is cached on initial creation.

So I am wired up to listen to token change events:

firebase.messaging().onTokenRefresh(async () => {
  console.log('======onTokenRefresh=========');
  AsyncStorage.removeItem(FCM_TOKEN_KEY);
  await getToken();
});

That never seems to fire. I have even added a button to my app to try and force a new InstanceId and register with FCM after updating the version from TestFlight or the AppStore, this does not help:

export async function forceRefresh() {
  console.log('================force a new registration!!!==========');
  AsyncStorage.removeItem(FCM_TOKEN_KEY);
  firebase.messaging().deleteToken();
  firebase.iid().deleteToken();
  registerForPushNotificationsAsync(true);
} 

Nah, doesn't work.

So the moral of the story is, when I update the version of my app, my customers, whom's push notifications were working dandy, will no longer be registered for push notifications when they update their app to the next version.

References that might be leads I have been studying:

Interesting on app update start, where push notifications will stop working because of the app update I see two different tokens, perhaps this first one is the APN token from Apple:

2020-01-17 18:48:09.371741-0800 native[4462:1287461] -[RNFirebaseMessaging messaging:didReceiveRegistrationToken:] [Line 86] Received new FCM token: eBBgznWj1FU:APA91bF8vTmpkwcojp4oDSKFzlPDp6ylEIe_WGNzu24SKHS6RR-3xPu2-cX-Qyc8rrMIQMvkCJftT9711ll1WdshBWS4iEpZ3XpiPeTynqM-nvDjpAUUUWJpfT5aeo6G_scDsN9iipwI
2020-01-17 18:48:09.378382-0800 native[4462:1287621] 6.15.0 - [Firebase/InstanceID][I-IID014012] Invalidating cached token for 255558254149 (*) due to token is no longer fresh.

Then a bit later my prior token from the previous version of the app where push notifications working is loaded I and see the work "default token" in the logs:

2020-01-17 18:48:09.987571-0800 native[4462:1287610] 6.15.0 - [Firebase/InstanceID][I-IID014001] Token fetch successful, token: dUY5psWDnkv2td1kB_t6Gs:APA91bEaREBt07CWiEyGvP4YAGjxmVQmF0IcXgef5XcvL5KWrHsqcxZZ8L9PqwGzKTPFGy6cdmuVXSvg6kDQjj-652jt5_jbbKMhUFTcam_-FeBp2vGZvBjaBd4aAOtQf1m48htQ8d6B, authorizedEntity: 255558254149, scope:*
2020-01-17 18:48:09.987764-0800 native[4462:1287461] -[RNFirebaseMessaging messaging:didReceiveRegistrationToken:] [Line 86] Received new FCM token: dUY5psWDnkv2td1kB_t6Gs:APA91bEaREBt07CWiEyGvP4YAGjxmVQmF0IcXgef5XcvL5KWrHsqcxZZ8L9PqwGzKTPFGy6cdmuVXSvg6kDQjj-652jt5_jbbKMhUFTcam_-FeBp2vGZvBjaBd4aAOtQf1m48htQ8d6B
2020-01-17 18:48:09.993088-0800 native[4462:1287610] 6.15.0 - [Firebase/InstanceID][I-IID003010] Successfully fetched default token.
2020-01-17 18:48:09.993755-0800 native[4462:1287610] 6.15.0 - [Firebase/InstanceID][I-IID003008] Got default token dUY5psWDnkv2td1kB_t6Gs:APA91bEaREBt07CWiEyGvP4YAGjxmVQmF0IcXgef5XcvL5KWrHsqcxZZ8L9PqwGzKTPFGy6cdmuVXSvg6kDQjj-652jt5_jbbKMhUFTcam_-FeBp2vGZvBjaBd4aAOtQf1m48htQ8d6B

As interesting, after deleting the current version app and installing the latest version (in previous log it was the update version) we can see the same process in reverse, first my current token is found and is considered no longer fresh:

messaging:didReceiveRegistrationToken:] [Line 86] Received new FCM token: dUY5psWDnkv2td1kB_t6Gs:APA91bEaREBt07CWiEyGvP4YAGjxmVQmF0IcXgef5XcvL5KWrHsqcxZZ8L9PqwGzKTPFGy6cdmuVXSvg6kDQjj-652jt5_jbbKMhUFTcam_-FeBp2vGZvBjaBd4aAOtQf1m48htQ8d6B
2020-01-17 19:03:06.651179-0800 native[4475:1291698] 6.15.0 - [Firebase/InstanceID][I-IID014012] Invalidating cached token for 255558254149 (*) due to token is no longer fresh.

Subsequently the new token is loaded and is considered the default token and my new install receives FCM notifications right away:

2020-01-17 19:03:07.997209-0800 native[4475:1291564] -[RNFirebaseMessaging messaging:didReceiveRegistrationToken:] [Line 86] Received new FCM token: ebz2ACPpBkg0kGsgs9yF7_:APA91bGErCaPMuLyRk-_BLZXUk8_U6FyxvKHbI0NPgddFWl_-nLZuCc6HbHg8kaLMDJiO7sHFS8THAuV132xgri8uQ9YV4g8zDXJySrKsSTNiDq9HcXpzUQXQlPy8bTaxZ3gyRxyCy3p
2020-01-17 19:03:08.018870-0800 native[4475:1291684] 6.15.0 - [Firebase/InstanceID][I-IID014001] Token fetch successful, token: ebz2ACPpBkg0kGsgs9yF7_:APA91bGErCaPMuLyRk-_BLZXUk8_U6FyxvKHbI0NPgddFWl_-nLZuCc6HbHg8kaLMDJiO7sHFS8THAuV132xgri8uQ9YV4g8zDXJySrKsSTNiDq9HcXpzUQXQlPy8bTaxZ3gyRxyCy3p, authorizedEntity: 255558254149, scope:*
2020-01-17 19:03:08.019018-0800 native[4475:1291684] 6.15.0 - [Firebase/InstanceID][I-IID003010] Successfully fetched default token.
2020-01-17 19:03:08.019065-0800 native[4475:1291684] 6.15.0 - [Firebase/InstanceID][I-IID003008] Got default token ebz2ACPpBkg0kGsgs9yF7_:APA91bGErCaPMuLyRk-_BLZXUk8_U6FyxvKHbI0NPgddFWl_-nLZuCc6HbHg8kaLMDJiO7sHFS8THAuV132xgri8uQ9YV4g8zDXJySrKsSTNiDq9HcXpzUQXQlPy8bTaxZ3gyRxyCy3p

Just found this interest statement in the logs:

APNS device token not set before retrieving FCM Token for Sender ID '255558254149'. Notifications to this FCM Token will not be delivered over APNS.Be sure to re-retrieve the FCM token once the APNS device token is set.

It is hard to believe this is happening so consistently but it does certainly seem to be the case, any help would be greatly appreciated.

Which version does React Native support (iOS and Android)?

$
0
0

I can't find this information. Is it true that Android React Native runs on sdkMin18 and therefore makes it supported by most android versions?

React Native Expo Ejected App, can't get push token from Device

$
0
0

I use Expo push Notifications to send Notifications to GSM using push token. My code is :

  registerForPush = async () => {
    if (Constants.isDevice) {
      const { status: existingStatus } = await Permissions.getAsync(
        Permissions.NOTIFICATIONS,
      );
      let finalStatus = existingStatus;
      if (existingStatus !== 'granted') {
        const { status } = await Permissions.askAsync(
          Permissions.NOTIFICATIONS,
        );
        finalStatus = status;
      }
      if (finalStatus !== 'granted') {
        alert('Failed to get push token for push notification!');
        return;
      }
      const gsm = await Notifications.getExpoPushTokenAsync();
      this._storeData('TOKEN_GSM', gsm);
    } else {
      alert('Must use physical device for Push Notifications');
    }
  };

async componentDidMount() {
this.registerForPush();
}

When i use Expo to run the App i granted manually the permissions to get the token, but now i ejected to app to run IOS project with Xcode. I got an error that i can't get push token : Failed to get push token for push notification

React navigation adding "more" tab with a pop up list and not navigate to tab

$
0
0

I am basically trying to add a "more" button for both iOS and ANDROID, which pops up a list of options to choose from. Something that looks like this (IOS more button) and (ANDROID more button).

I am using React Navigation to create the TabNavigator TabBar and I know how to add a new tab, I'm just not sure how to create a small menu list thats generated when i click on the tab button instead of navigating me to the tab button screen.

Any ideas on how to go about that?

Is there a way to limit my app's network connections to a given set of whitelisted domains in Android/iOS?

$
0
0

To improve my app's security I'd like to only accept network connections with a set of whitelisted sites.

My app uses react-native.

I've only found settings to filter non-secure connections (i.e. without tls encryption), but nothing similar to what I mentioned above.

Viewing all 16572 articles
Browse latest View live


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