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

react-native-mapbox-gl error. How to fix it?

$
0
0

I am getting MapBox api error for React native iOS.

Mapbox Error: dyld: Library not loaded: @rpath/MapboxMobileEvents.framework/MapboxMobileEvents Referenced from: /private/var/containers/Bundle/Application/6DBF1572-8316-48FC-8CBA-A279F7EA4BD2/KajMahal.app/Frameworks/Mapbox.framework/Mapbox Reason: image not found (lldb)

Here is the environment: Host: Mac mini (Mac OS X 10.15.3 (19D76)) Operating System: macOS Catalina 10.15.3 (19D76) Xcode: Version 11.3.1 (11C504) React Native: 0.61.5 React: 16.9.0 Node: 10.18.1 Npm: 6 13.4 Homebrew: 2.2.5 Homebrew/homebrew-core: (git revision 028f1; last commit 2020-02-10) CocoaPods: 1.8.4

Any help would be appreciated.

Thanks & Regards,


How do I extend My container background on dragging up. Just like the one on Facebook

How we can clear url cache in React Native?

$
0
0

We will do clear URL cache by using this removeAllCachedResponses in iOS, but in React Native how we can do and we are using fetch. We are unable to clear URL cache programmatically in React Native. Can anyone have a solution for this? Check here what I'm doing in Swift, how we can acheive this in React Native?

        URLCache.shared.diskCapacity = 0
        URLCache.shared.memoryCapacity = 0
        URLCache.shared.removeAllCachedResponses()

How to override DNS in ios with React Native?

$
0
0

My client needs an app to configure the user's DNS in iOS device with React Native. Please let me know if there is any way to do this.

How do you install Firebase Crashlytics

$
0
0

I've been following the docs here and have made it all the way to the point where I've installed it and am trying to send an error. I added a button to my page that when pressed just does: throw new Error('Test Error for Crashlytics'). I've got it running in my simulator as well as an ad-hoc install of the app onto my phone, but no matter how many times I make my app error, the Crashlytics page in Firebase just shows enter image description here

I've seen that this can take some time, but I've been waiting about 2 hours now since the first error and about 30 min since I last tried and still nothing. Not really to sure what to try next, I can't seem to find any documentation on how to possibly debug what is going on as well.

Realm.js and Fastlane integration

$
0
0

I am trying to implement fastlane for continuous delivery for a react native project I am working on. However I cannot get Realm.js to play nicely. the error below is ultimately not allowing for libRealmReact.a file to be created.

▸ Compiling RealmReact.mm
[15:06:45]: ▸ ❌  fatal error:
[15:06:45]: ▸ ❌  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:10:9: could not build module 'CoreVideo'
[15:06:45]: ▸ #import <CoreVideo/CoreVideo.h>
[15:06:45]: ▸  ~~~~~~~~^
[15:06:46]: ▸ Compiling RealmReact.mm
[15:06:46]: ▸ ❌  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGLDrawable.h:52:12: attributes may not be specified on a category
[15:06:46]: ▸ @interface EAGLContext (EAGLContextDrawableAdditions)
[15:06:46]: ▸  ~~~~~~~^
[15:06:46]: ▸ ❌  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAEAGLLayer.h:7:9: could not build module 'OpenGLES'
[15:06:46]: ▸ #import <OpenGLES/EAGLDrawable.h>
[15:06:46]: ▸            ^
[15:06:46]: ▸ ❌  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:10:9: could not build module 'QuartzCore'
[15:06:46]: ▸ #import <QuartzCore/QuartzCore.h>
[15:06:46]: ▸  ~~~~~~~^
[15:06:46]: ▸ ❌  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVOpenGLESTexture.h:23:10: could not build module 'OpenGLES'
[15:06:46]: ▸ #include <OpenGLES/gltypes.h>
[15:06:46]: ▸  ~~~~~~~^
[15:06:46]: ▸ ❌  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:10:9: could not build module 'CoreVideo'
[15:06:46]: ▸ #import <CoreVideo/CoreVideo.h>
[15:06:46]: ▸  ~~~~~~~~^
[15:06:46]: ▸ ❌  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h:71:12: attributes may not be specified on a category

Hand Drawing Polyline on map gets lagged - react native

$
0
0

I'm hand drawing a Polyline but it's really slow, is it a way to improve it? When the finger moves slow over the map the Polyline really gets rendered slowly.

I'm using: "react-native": "0.59.10","react-native-map-clustering": "^3.1.2","react-native-maps": "^0.25.0".

Here is the code I'm using:

constructor(args) {
  this.state={
    regionLocal: {latitude: 37.78825,
                  longitude: -122.4324,
                  latitudeDelta: 0.1022,
                  longitudeDelta: 0.0521
              },
    polylines: [],               
    editing: null
  }
}

onPanDrag(e) {
  const { editing } = this.state;
  if (!editing) {
    this.setState({
      editing: {
        id: id++,
        coordinates: [e.nativeEvent.coordinate],
      },
    });
  } else {
    this.setState({
      editing: {
        ...editing,
        coordinates: [...editing.coordinates, e.nativeEvent.coordinate],
      },
    });
  }
}

render() {
  return (
      <MapView  mapRef={ref => this.map = ref}
          style={{
              position: 'absolute',
              top: 0,
              left: 0,
              right: 0,
              bottom: 0
          }} 
          initialRegion={this.state.regionLocal}
          showsUserLocation={true}
          showsPointsOfInterest={true}
          showsBuildings={true}
          showsMyLocationButton={false}
          loadingEnabled={true}
          clusterColor={"#140c98"}
          spiderLineColor={"#140c98"}
          radius={30}
          moveOnMarkerPress={false}
          maxZoom={13}
          scrollEnabled={false}
          onPanDrag={(e)=>{this.onPanDrag(e)}}>
              {this.state.polylines.map(polyline => (<Polyline
                    key={polyline.id}
                    coordinates={polyline.coordinates}
                    strokeColor="#000"
                    fillColor="rgba(255,0,0,0.5)"
                    strokeWidth={1}
                  />
                ))}
                {this.state.editing && (<Polyline
                    key="editingPolyline"
                    coordinates={this.state.editing.coordinates}
                    strokeColor="#F00"
                    fillColor="rgba(255,0,0,0.5)"
                    strokeWidth={1}
                  />
                )}</MapView>
  )}

Also Here's an example of the way I want it to work:

image description

react-native link error 'Unknown dependency'

$
0
0

I'm following the example to build a small video chat: https://www.agora.io/en/blog/how-to-build-a-react-native-video-calling-app-using-agora

I created a new project via: npx react-native init AwesomeProject

I added the necessary dependencies:

npm install --save react-native-agora
npm install --save react-native-router-flux
npm install --save react-native-vector-icons

The dependencies can be also seen in the package.json

...
  "dependencies": {
    "react": "16.9.0",
    "react-native": "0.61.5",
    "react-native-agora": "^2.9.1-alpha.2",
    "react-native-router-flux": "^4.0.6",
    "react-native-vector-icons": "^6.6.0"
  },
...

When i start the app via npx react-native run-ios the app will start on my Version 10.2.1 (SimulatorApp-880.5 CoreSimulator-587.35)

I get the following error: Invariant Violation: Native module cannot be null. constructor NativeEventEmitter.js

I tried rebuilding it with npm install and the build was successful.

My guess is that i missed linking react to react-native-agora. I tried to link it with react-native link react-native-agora but i get the following error message:

error Unknown dependency. Make sure that the package you are trying to link is already installed in your "node_modules" and present in your "package.json" dependencies.

Thanks in advance.


Issue adding an Emoji to TextInput for React-Native on iOS

$
0
0

I've been having an issue with maxLength on <TextInput/>in ReactNative and I'm pretty sure its only happening on iOS.

The problem:

If the last character of an input is an emoji, and that emoji puts you over the maxlength number then it deletes the entire input! An example of it is if the maxLength is set to 5 and the input is "xxxx" (4 characters) and then you add an emoji the entire input text gets deleted. I'm sure this has something to do with emojis mostly being 2 characters but I can't seem to find an "eloquent" work around!

Snack to see exactly what I'm talking about:

(I've only been able to replicate it in iOS) https://snack.expo.io/@sararan/textinput

Things I've tried:

  1. Adding an onKeyPress event (that gets hit before the onChangeText event) that calls e.stopPropagation() and e.preventDefault() (both for good measure ;) ). But it doesn't actually stop the event and I'm thinking it has to do with how react handles events and maybe that it's already bubbled up by this time?
  2. Taking out maxLength altogether and creating my own rules that splices the input if its over the length I want and then replaces any special characters something like...

    const onChangeText = (value) => {
      if (value.length > 5) {
        value = value.slice(0, 30).replace(/[^\w\s]/gi, '');
      }
      setText({ value });
    };
    

    but this solution seems to cause the flickering that we all hate with these types of solutions.

I'm wondering if anyone might have run into this before and might have a more eloquent solution? Thank you for your help!

How to detect 3rd party keyboard in react native (iOS and Android)

$
0
0

In native iOS we can specify shouldAllowExtensionPointIdentifier to disable 3rd party keyboard.

-(BOOL)application:(UIApplication *)application shouldAllowExtensionPointIdentifier:(NSString *)extensionPointIdentifier
{

    if (extensionPointIdentifier == UIApplicationKeyboardExtensionPointIdentifier)
    {
        return NO;
    }

    return YES;
}

In android is there a solution? Managed to use InputMethodManager to detect custom/3rd party keyboard and prompt a message but can’t find a way to disable it or change it back to the factory/manufacturer default keyboard.

App build failed in xcode with Continuing in background (Failed to display Xcode notification) due to the sentry

$
0
0

Unable to build my app suddenly. This is the error which I got

  Continuing in background.

       Error: Failed to display Xcode notification
          caused by: script error: osascript: no such component "JavaScript".

        /Users//Library/Developer/Xcode/DerivedData/App-dvcafjcjvuogulagizfflouagntd/Build/Intermediates.noindex/ArchiveIntermediates/App/IntermediateBuildFilesPath/App.build/Release-iphoneos/App.build/Script-00199139199199133.sh: line 5: debug]: command not found
Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports

Can't able to run react native application on android device

$
0
0

Im Using MacBook Pro.. Im New To React Native.. After Creating An Project Im Running On iOS Device It's Running.. At The Same Time While I'm Running On Android Device Means Im Getting This Error.. Any One Please Help Me To Resolve This Error.. Im Using Visual Studio Code IDE For React Native Application

Thanks In Advance..

Error Details :

[Info] local.properties file doesn't exist. Using Android SDK location from PATH.

[Info] Starting React Native Packager.

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 864 file(s) to forward-jetify. Using 8 workers...
/bin/sh: adb: command not found
info Launching emulator...

error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...

FAILURE: Build failed with an exception.

* Where:
Settings file '/Users/manikandan/AwesomeProject/android/settings.gradle'

* What went wrong:
Could not compile settings file '/Users/manikandan/AwesomeProject/android/settings.gradle'.
startup failed:
  General error during semantic analysis: Unsupported class file major version 57

FlatList onEndReached being called multiple times

$
0
0

I'm making a react native project where user can search images using Flickr API, Everything else is working fine but the problem i'm having while implementing pagination. I have used FlatList's onEndReached to detect when user has scrolled to the end on the list, but the problem is onEndReached is being called multiple times(including one during the first render). I have even disabled bounce as said here but it's still being called more than once

 export default class BrowserHome extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      isLoading: false,
      tagParam: "cat",
      pageNum: -1,
      data: [],
      photosObj: ""
    };
  }

  componentDidMount() {
    this.setState({
      isLoading: true
    });
    try {
      this.makeRequest();
    } catch {
      console.log("error has occurred");
    }
  }

  makeRequest = () => {
    const { tagParam, pageNum } = this.state;
    let url = `https://api.flickr.com/services/rest/? 
               method=flickr.photos.search
               &api_key=${apiKey}&format=json&tags=${tagParam}
               &per_page=30&page=${pageNum + 1}&nojsoncallback=1`;
    fetch(url, {
      method: "GET"
    })
      .then(response => response.json())
      .then(responseJSON => {
        this.setState({
          data: this.state.data.concat(responseJSON.photos.photo),
          isLoading: false,
          pageNum: responseJSON.photos.page
        });
      })
      .catch(error => {
        console.log(error);
        this.setState({ isLoading: false });
        throw error;
      });
  };

  render() {
    if (this.state.isLoading) {
      return <ActivityIndicator animating={true} size="large" />;
    }

    return (
      <View
        style={{
          flex: 1,
          height: 200,
          justifyContent: "flex-start",
          width: screenSize.width,
          backgroundColor: "black"
        }}
      >
        <Text>This is browserhome</Text>
        <FlatList
          style={{
            width: screenSize.width
          }}
          numColumns={3}
          data={this.state.data}
          keyExtractor={item => item.id}
          bounces={false}
          onEndReachedThreshold={1}
          onEndReached={({ distanceFromEnd }) => {
            this.loadMoreItem();
            alert("end reached call");
          }}
          renderItem={({ item, index }) => (
            <>
              <ImageTile imageURL={this.createImageURL(item)} />
            //  <Text style={{ color: "white" }}>
             //   {index}
             //   {console.log(index)}
             // </Text>
            </>
          )}
        />
      </View>
    );
  }

  createImageURL(item) {
    let server = item.server,
      id = item.id,
      secret = item.secret;
    let urlString = `https://farm${
      item.farm
    }.staticflickr.com/${server}/${id}_${secret}_s.jpg`;
    return urlString;
  }

  loadMoreItem() {
    this.makeRequest();
  }
}

first_open event is not showing on Google ads console for iOS

$
0
0

The Ad account is connected to Firebase analytics. I can see the first_open event on Firebase Analytics dashboard, but the event is not listed on Google ad console's Analytics Events column, all other events are showing. It's a react native app. This problem is not happening for Android version. Following are the configurations of iOS setup:

React Native Environment Info:
  System:
    OS: macOS 10.14
    CPU: (2) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
    Memory: 2.98 GB / 7.84 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.16.0 - /usr/local/bin/node
    Yarn: 1.17.0 - /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
  IDEs:
    Xcode: 10.1/10B61 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.3 => 16.8.3 
    react-native: 0.59.4 => 0.59.4 
  npmGlobalPackages:
    react-native-cli: 2.0.1
    react-native: 0.59.9

AppDelegate.m code to launch the app

/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#import "AppDelegate.h"

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import "RNSplashScreen.h"
#import <FBSDKCoreKit/FBSDKCoreKit.h>
@import Firebase;
#import "RNFirebaseNotifications.h"
#import "RNFirebaseMessaging.h"
#import "RCTLinkingManager.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"abc"
                                            initialProperties:nil];

  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];

Is there any way to have an iOS application to be tested? [closed]

$
0
0

Is there any way to have an iOS application to be tested, before putting the app on the App Store? It's a app made in React Native, an expo app.


How can i set variables that i can access globally throught my app? [duplicate]

$
0
0

In react native, need to set ~10 variables relating to screen sizes BEFORE the user sees all the screens in the app. I can do this in the AppLoadingScreen.js (as that is universal in terms of size). I have the following function and switch statement (but i don't know how exactly to run it). Once they're set, i want to ensure all the screens (or .js files) have these variables set and ready to go.

import {StyleSheet, Dimensions } from 'react-native'

export function whichScreen() {
  const dim = Dimensions.get('window');

  if ((dim.width === 375 )){
    return 0;
  }
  else if((dim.width === 414)){
    return 1;
  }
  else if((dim.width === 484 )){
    return 2;
  }
  else if((dim.width === 578 )){
    return 3;
  }
}


getScreenParams=()=>{

  let size = this.whichScreen();

  switch(size) {

      case 0:
        this.setState({ marginforcontainer: 2, marginforSignIn: 5, ....}) //Don't even know which class to put the state variables in?
        break;

      case 1:
        this.setState({ marginforcontainer: 6, marginforSignIn: 7, ....}) //Don't even know which class to put the state variables in?
        break;

      case 2:
        this.setState({ marginforcontainer: 8, marginforSignIn: 6, ....}) //Don't even know which class to put the state variables in?
        break;

      case 3:
        this.setState({ marginforcontainer: 4, marginforSignIn: 1, ....}) //Don't even know which class to put the state variables in?
        break;

      default:

    }
  }

I dont want to have to run the getScreenParams() function EVERY TIME a user moves onto each of the screens, thats just awful. Also putting them in AsyncStorage and calling a getItem() from AsyncStorage each time is expensive.

How do i run this once while the app is loading and set the variables i need??

Integration React Native in existing iOS project - CocoaPods error ENOENT - No such file or directory @ rb_sysopen

$
0
0

I try to follow this guide to add React Native in existing iOS project

I'm following the example with the 2024 game project but I got many errors and now I can't go forward from this one.

Analyzing dependencies

Fetching podspec for `DoubleConversion` from `./NumberTileGame/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`

Command

/usr/local/Cellar/cocoapods/1.9.1/libexec/bin/pod install

Stack

   CocoaPods : 1.9.1
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
    RubyGems : 3.0.3
        Host : Mac OS X 10.15.3 (19D76)
       Xcode : 11.3.1 (11C504)
         Git : git version 2.21.1 (Apple Git-122.3)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : cocoapods - git - https://github.com/CocoaPods/Specs.git @ 1c12956fe6982cfb446fb26b6cd5f272986833aa

               trunk - CDN - https://cdn.cocoapods.org/

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.4.1
cocoapods-try         : 1.1.0

Podfile

# The target name is most likely the name of your project.
target 'NumberTileGame' do

  # Your 'node_modules' directory is probably in the root of your project,
  # but if not, adjust the `:path` accordingly
  pod 'React', :path => '../NumberTileGame/node_modules/react-native/'
  pod 'React-Core', :path => '../NumberTileGame/node_modules/react-native'
  pod 'React-DevSupport', :path => '../NumberTileGame/node_modules/react-native/React'
  pod 'React-fishhook', :path => '../NumberTileGame/node_modules/react-native/Libraries/fishhook'
  pod 'React-RCTActionSheet', :path => '../NumberTileGame/node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../NumberTileGame/node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../NumberTileGame/node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../NumberTileGame/node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../NumberTileGame/node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../NumberTileGame/node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../NumberTileGame/node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../NumberTileGame/node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../NumberTileGame/node_modules/react-native/Libraries/Vibration'
  pod 'React-RCTWebSocket', :path => '../NumberTileGame/node_modules/react-native/Libraries/WebSocket'

  pod 'React-cxxreact', :path => '../NumberTileGame/node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../NumberTileGame/node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../NumberTileGame/node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../NumberTileGame/node_modules/react-native/ReactCommon/jsinspector'
  pod 'yoga', :path => '../NumberTileGame/node_modules/react-native/ReactCommon/yoga'

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

Error

Errno::ENOENT - No such file or directory @ rb_sysopen - /Users/martinobonfiglioli/React/iOS-2048-master/NumberTileGame/NumberTileGame/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec

I don't get the problem, does anyone have any solution?

React native Branch io deep linking in IOS not working

$
0
0

I have followed the set up doc of branch for react native io i.e. https://help.branch.io/developers-hub/docs/react-native

React native Branch io deep linking is working fine for Android part and For ios part if click the banner from my website it is taking me to appstore and not the app though app is installed in device.

When copy the link getting created when user clicking on the banner and pasting it in notepad and on long press I am getting "open in your app" option and its navigating to app.

React Native iOS and Android folders not present

$
0
0

I'm new to react native, and I've been having some trouble understanding the folder structure of the app which should supposedly be present in the project folder on creation. Basically, when creating the project with npm, I get some starting files (App.js etc.) and a node_modules folder. I've got it up and running with expo, which created the .expo folder as well.

However, when I go to react's official documentation or look into plugins/addons on git they talk several times about an android and an iOS folder in the project root. But they are nowhere to be seen. I then got some hints that I could install and run react-native-upgrade-git, which allegedly would generate these missing folders. But that didn't work either.

So what have I missed? Where are those folders located?

Edit: Here is a screen dump from a Youtube tutorial showing the project structure I'm looking for:

enter image description here

How can I fetch user`s info when apple authentication in React native?

$
0
0

talents. How are you? I am developing a React native app and it is needed to add apple authentication. I am using Expo(sdk v35) and used expo-apple-authentication library. So now I can see AppleAuthenticationCredentialState is AUTHORIZED. The problem is how to fetch user info after that.

So I coded for fetching user info.

let urlBody = code=${authorizationCode}&client_id=${clientId}&grant_type=authorization_code;

const res = await fetch(`https://appleid.apple.com/auth/token`, {
  method: 'POST',
  body: urlBody,
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
  },
});`

but the result was

Object { "error": "invalid_client", }

I am new to apple authentication and if anyone already implemented this feature using React native, please help me. Best regards!!!

Viewing all 16909 articles
Browse latest View live


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