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

Xcode 11.7 ios11 build success but archive fail while integrating Razor pay version 2.2.4.Please help us to rectify the issue as soon as possible

$
0
0

Please find below error message.

haseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/nipunnite/Library/Developer/Xcode/DerivedData/CaroWater-aztopncyxbjzdyaxwaokrjtpfbrx/Build/Intermediates.noindex/ArchiveIntermediates/CaroWater/IntermediateBuildFilesPath/CaroWater.build/Release-iphoneos/CaroWater.build/Script-2987D55F508D7CC04BF71825.sh cd /Users/nipunnite/Desktop/Bindu/Nipun/Apps/CaroWater/ios /bin/sh -c /Users/nipunnite/Library/Developer/Xcode/DerivedData/CaroWater-aztopncyxbjzdyaxwaokrjtpfbrx/Build/Intermediates.noindex/ArchiveIntermediates/CaroWater/IntermediateBuildFilesPath/CaroWater.build/Release-iphoneos/CaroWater.build/Script-2987D55F508D7CC04BF71825.sh mkdir -p /Users/nipunnite/Library/Developer/Xcode/DerivedData/CaroWater-aztopncyxbjzdyaxwaokrjtpfbrx/Build/Intermediates.noindex/ArchiveIntermediates/CaroWater/BuildProductsPath/Release-iphoneos/Caro Water.app/Frameworks rsync --delete -av --filter P .*.?????? --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/nipunnite/Desktop/Bindu/Nipun/Apps/CaroWater/ios/Pods/razorpay-pod/Pod/Razorpay.framework" "/Users/nipunnite/Library/Developer/Xcode/DerivedData/CaroWater-aztopncyxbjzdyaxwaokrjtpfbrx/Build/Intermediates.noindex/ArchiveIntermediates/CaroWater/InstallationBuildProductsLocation/Applications//Caro Water.app/Frameworks" building file list ... done Razorpay.framework/ Razorpay.framework/EncryptedOtpelf.js Razorpay.framework/Hash.txt Razorpay.framework/Info.plist Razorpay.framework/Razorpay Razorpay.framework/Checkout.storyboardc/ Razorpay.framework/Checkout.storyboardc/Info.plist Razorpay.framework/Checkout.storyboardc/RBq-mH-fUs-view-vI7-59-shd.nib/ Razorpay.framework/Checkout.storyboardc/RBq-mH-fUs-view-vI7-59-shd.nib/objects-11.0+.nib Razorpay.framework/Checkout.storyboardc/RBq-mH-fUs-view-vI7-59-shd.nib/objects-13.0+.nib Razorpay.framework/Checkout.storyboardc/RBq-mH-fUs-view-vI7-59-shd.nib/runtime.nib Razorpay.framework/Checkout.storyboardc/RazorpayCheckoutVC.nib/ Razorpay.framework/Checkout.storyboardc/RazorpayCheckoutVC.nib/objects-11.0+.nib Razorpay.framework/Checkout.storyboardc/RazorpayCheckoutVC.nib/objects-13.0+.nib Razorpay.framework/Checkout.storyboardc/RazorpayCheckoutVC.nib/runtime.nib Razorpay.framework/Checkout.storyboardc/UINavigationController-ODs-ga-9IN.nib/ Razorpay.framework/Checkout.storyboardc/UINavigationController-ODs-ga-9IN.nib/objects-11.0+.nib Razorpay.framework/Checkout.storyboardc/UINavigationController-ODs-ga-9IN.nib/objects-13.0+.nib Razorpay.framework/Checkout.storyboardc/UINavigationController-ODs-ga-9IN.nib/runtime.nib sent 8065811 bytes received 358 bytes 5377446.00 bytes/sec total size is 8063519 speedup is 1.00 Stripped /Users/nipunnite/Library/Developer/Xcode/DerivedData/CaroWater-aztopncyxbjzdyaxwaokrjtpfbrx/Build/Intermediates.noindex/ArchiveIntermediates/CaroWater/InstallationBuildProductsLocation/Applications//Caro Water.app/Frameworks/Razorpay.framework/Razorpay of architectures: i386 x86_64 armv7 Code Signing /Users/nipunnite/Library/Developer/Xcode/DerivedData/CaroWater-aztopncyxbjzdyaxwaokrjtpfbrx/Build/Intermediates.noindex/ArchiveIntermediates/CaroWater/InstallationBuildProductsLocation/Applications//Caro Water.app/Frameworks/Razorpay.framework with Identity Apple Development: sambasiva rao venigalla (J666Z26B6K) /usr/bin/codesign --force --sign 19F1C7524714ED67D4005D9C9AC96053AB8BC634 --preserve-metadata=identifier,entitlements '/Users/nipunnite/Library/Developer/Xcode/DerivedData/CaroWater-aztopncyxbjzdyaxwaokrjtpfbrx/Build/Intermediates.noindex/ArchiveIntermediates/CaroWater/InstallationBuildProductsLocation/Applications//Caro Water.app/Frameworks/Razorpay.framework' /Users/nipunnite/Library/Developer/Xcode/DerivedData/CaroWater-aztopncyxbjzdyaxwaokrjtpfbrx/Build/Intermediates.noindex/ArchiveIntermediates/CaroWater/InstallationBuildProductsLocation/Applications//Caro Water.app/Frameworks/Razorpay.framework: errSecInternalComponent


How can i check push notification permission for both ios and android in react native?

$
0
0

I want to check push notification permission for both ios and android. I want to see if user has switched off the push notification permission from his device settings. Is there any plugin or any code i can take reference from if needed to be coded in native.

Black-Berry Integration in iOS

$
0
0

After integration of Black-Berry in iOS(React-Native), when app launches on simulator, it got crashed.Error is :-

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Delegate property not set. Either call [GDiOS authorize:] and pass an object thatimplements the GDiOSDelegate protocol, or set the delegate property of the GDiOS instance priorto calling [GDiOS authorize].

Reference used :- https://github.com/blackberry/BlackBerry-Dynamics-React-Native-SDK/blob/master/modules/BlackBerry-Dynamics-for-React-Native-Base/README.md

Error Screenshot:-

enter image description here

Main.m class :-

enter image description here

AppDelegate.h :-

#import <React/RCTBridgeDelegate.h>#import <UIKit/UIKit.h>#import <BlackBerryDynamics/GD/GDiOS.h>@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate,GDiOSDelegate>@property (nonatomic, strong) UIWindow *window;@end

PhaseScriptExecution error in react native to build ios app

$
0
0

** BUILD FAILED **

The following build commands failed:PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/apple/Library/Developer/Xcode/DerivedData/AwesomeProject-bbujnbqqpggmexaaiswxvvingbyz/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-6A568ADF4377E3B29892AF53742DB125.sh(1 failure)

info Run CLI with --verbose flag for more detail

react-native-webrtc Mic not closing after video call on iOS

$
0
0

Our iOS app has audio video calling implemented using the following technologies:

  1. "react-native": "0.63.4"
  2. "react": "16.13.1"
  3. "react-native-webrtc": "^1.87.3"
  4. "react-native-incall-manager": "^3.3.0"
  5. iOS version 14.4.1

Our calling module works like the following:

  1. First request and initiate audio call
  2. Then request and initiate video call

On the code side things work like this:

  1. We call the getStream() function which gets the user media for audio call i.e Audio only
  2. Then we call the startStream() function which connects the peer connection
  3. On requesting video we call the getVideoStream() method to get Audio and Video streams
  4. Call startStream() again to start peer connection with video

The scenario is as follows:

  1. We start off by connecting an audio call. On success the audio call is connected and works fine as expected
  2. We request for video and connect video call, all works fine as expected and I receive video on both ends
  3. When I disconnect the call and stop tracks using this.state.localStream.getTracks(), the mic does not close. An orange indicator for mic is visible on iOS.

Important Notes:

  1. Disconnecting from the audio call closes the mic just fine

  2. Even if we get video stream on audio call and disconnect without connecting video it still works fine and closes both tracks

  3. Its only when I connect the video is when the issue arises

  4. Calling InCallManager.stop() closes the mic but does not open it on second call. The mic does not open on second call and the orange mic indicator on iOS is not shown.

Get User Media Audio Call

getStream() {    InCallManager.setSpeakerphoneOn(false);    InCallManager.setMicrophoneMute(false);    mediaDevices.enumerateDevices().then((sourceInfos) => {      let videoSourceId;      for (let i = 0; i < sourceInfos.length; i++) {        const sourceInfo = sourceInfos[i];        if (          sourceInfo.kind === 'videoinput'&&          sourceInfo.facing === (true ? 'front' : 'back')        ) {          videoSourceId = sourceInfo.deviceId;        }      }      mediaDevices        .getUserMedia({          audio: true,        })        .then((stream) => {          this.setState({            localStream: stream,          });        })        .catch((error) => {          // Log error          console.log('stream get error', error);        });    });  }

Get User Media for Video Call

getVideoStream() {    this.state.peerConn.removeStream(this.state.localStream);    InCallManager.setSpeakerphoneOn(false);    InCallManager.setMicrophoneMute(false);    mediaDevices.enumerateDevices().then((sourceInfos) => {      let videoSourceId;      for (let i = 0; i < sourceInfos.length; i++) {        const sourceInfo = sourceInfos[i];        if (          sourceInfo.kind === 'videoinput'&&          sourceInfo.facing === (true ? 'front' : 'back')        ) {          videoSourceId = sourceInfo.deviceId;        }      }      mediaDevices        .getUserMedia({          audio: true,          mirror: true,          video: {            mandatory: {              minWidth: 500,              minHeight: 300,              minFrameRate: 30,            },            facingMode: true ? 'user' : 'environment',            optional: videoSourceId ? [{sourceId: videoSourceId}] : [],          },        })        .then((stream) => {          this.setState(            {              localStream: stream,            },            () => {              this.startStream();            },          );        })        .catch((error) => {          // Log error          console.log('stream get error', error);        });    });  }

Start Stream Function

startStream() {    console.log('start Stream');    this.newPeerConnection();    setTimeout(() => {      this.state.peerConn        .createOffer()        .then((sessionDescription) =>          this.setLocalAndSendMessage(sessionDescription),        )        .catch((error) => this.defaultErrorCallback(error));    }, 3000);  }

newPeerConnection()

newPeerConnection() {    var peerConn = new RTCPeerConnection({      iceServers: turnServer,    });    peerConn.onicecandidate = (evt) => {      console.log(`OnIceCan`);      if (evt.candidate) {        this.state.connection.invoke('addIceCandidate',          parseInt(this.state.ticket.pkTicketId),          JSON.stringify({            type: 'candidate',            sdpMLineIndex: evt.candidate.sdpMLineIndex,            sdpMid: evt.candidate.sdpMid,            candidate: evt.candidate.candidate,          }),        );      }    };    peerConn.addStream(this.state.localStream);    peerConn.addEventListener('addstream',      (stream) => {        InCallManager.setForceSpeakerphoneOn(false);        this.setState({          isSpeakerEnabled: false,        });        this.setState({          remoteStream: stream,          showAudioCallTimer: true,        });      },      false,    );    this.setState(      {        peerConn,      });  }

Close Tracks

if (this.state.localStream) {          const tracks = this.state.localStream.getTracks();          tracks.map((track, index) => {            track.stop();          });        }        if (this.state.peerConn) {          this.state.peerConn.removeStream(this.state.localStream);          this.state.peerConn.close();          if (!this.state.callRatingSubmitted && this.state.remoteStream) {            this._handleCallFeedbackModal(true);          }        }

Make a react-native app with firebase and subscription system

$
0
0

I have this react-native app that use firebase authentication for logging/sign up the user, and a php/mysql server for to handle all other types of data.now I need to implement a system that allows access to the app only to users who pay a monthly subscription (including a free trial month). What is the best and fastest way to get this task done?Thanks in advance.

react-native can't build ios: (error xcode Flipper) Typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t')

$
0
0

My goal -> run react native build (ios version).

-Situation 1:Actions: start metro (ok), build ios.Problem: build failed with exit code 1.(CompileC /Users/macbook/Library/Developer/Xcode/DerivedData/NAME_OF_PROJECT-gxlagomyefvmjkdemiakcfycxnhx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper.build/Objects-normal/x86_64/FlipperRSocketResponder.o /Users/macbook/Documents/work/omg/mobile/ios/Pods/Flipper/xplat/Flipper/FlipperRSocketResponder.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler)

-Situation 2:Actions: build ios.Problem: Flipper:: Typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t'


xcode version 12.5ios 9+iphone 12

Some actions that i did (isn't work):

1)[solution 1][1]

2)[solution 2][2]

  1. reisntall all pods

  1. update all pods

  1. reclon project

and some little few fixes..[1]: https://i.stack.imgur.com/RQ0uo.png[2]: https://i.stack.imgur.com/NdQ7J.png

New React Native project with old version of react native

$
0
0

I am trying to create a new react native project which should utilize an older version of react-native.

The result I would like would be to do something like: react-native init MyProject but have the version of react-native it uses be 0.13.2.

However, there doesn't seem to be any options with react-native-cli for initializing with old versions of react-native.

Performing react-native init MyProject and then dowgrading react-native in package.json also does not work because the init command installs a bunch of xcode templates which are used to build the app and there is no dowgrade command which will dowgrade these templates. (There is an upgrade command.)

I tried downgrading my version of react-native-cli to 0.1.4 which was current when react-native 0.13 was current, but this did not work. From looking at the cli source, it seems it always initializes with just the newest version of react-native.

I realize this is pretty weird to want to start a new project at an old version, but I have a weird set of requirements that are forcing this.


Using React Native Webview in iOS App is crashing intermittently

$
0
0

I have a react native iOS application (version 0.62.2) using react-native-webviewplugin latest version 11.x to render few webview screens in the App. Recently noticed in the crash logs that sometimes the webview screens crash intermittently on launch. Got below exception from the error logs of the sessions.

Error

NSInvalidArgumentException *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[1]

Need inputs on the below point:

  1. How to decode this error? If I try to replicate the same behavior on xcode I get the error 1 out of 5 times and it points to the webview plugin.enter image description here

  2. Is there a way to try/catch this error so that the App at least does not crash? I tried error boundary but that will not catch this exception.

Update: adding code as requested

<View height={getScreenHeight() - 150}><KeyboardAvoidingView {...keyboardBehavior}><WebView        style={isApplyDeviceHeight ? styleWithHeight : style}        originWhitelist={['*']}        javaScriptEnabled        injectedJavaScript={this.captureAnchors()}        startInLoadingState        thirdPartyCookiesEnabled={thirdPartyCookiesEnabled}        source={{          uri: this.updateUrl(pageUrl),          headers: {'channel': WebViewHeaderChannel},        }}        onMessage={this.handleWebViewEvents}        useWebKit={isIOSDevice}        allowsInlineMediaPlayback      /></KeyboardAvoidingView></View>updateUrl = webURL => {const {webAppDomain, siteId} = getAPIConfig();const url = this.updateToken(webURL);let URL = url;// url path transformation in case of absolute image URLif (/^http/.test(url)) {  URL = url ? url.replace(/^\//, '') : '';} else if (webURL.includes(`/${siteId}/`)) {  // url path transformation in case of relative image URL  URL = `${webAppDomain}${url}`;} else {  URL = `${webAppDomain}/${siteId}${url}`;}return URL;

};

Any help is greatly appreciated.

reactNative TextInput number-pad not showing properly on android

$
0
0

Im using

TextInput

with

keyboardType = "number-pad"

On iOS it works fine, but on Android it shows normal keyboard, how do I make android show the number-pad keyboard, and hide the "suggest" bar

screenshot mobilesOn the left the iOS showing correctly, on the right the android emulator showing wrong keyboard.

<TextInput    ref="second"    style={this.state.pos > 0 ? styles.textInputStyle :     styles.textInputNormalStyle}    keyboardType = "number-pad"    maxLength={1}    value={this.state.secondVal}    onKeyPress={(event) => {this.onChange(1, event.nativeEvent.key); }}

/>

React Native Push Notification Not Working After Kill And Re-run App

$
0
0

I have implemented Firebase Push Notifications for my project and Once I do register and do the payment back end will fire push notification for me.

For the first time, the app is installed, and create an account and do payment It will work fine.

But once I kill the app from running apps and reopen it then there will be no notification.

I have created separate class for FCM service and here the code

import {Linking, Platform} from 'react-native';import navigationService from '../navigation/navigationService';import {fcmService} from './FCMServiceHelper';import {localNotificationService} from './NotificationHelper';import {saveFCMToken} from './tokenUtils';export default class NotificationHandler {  enableDevicePushNotifications = () => {    fcmService.registerAppWithFCM();    fcmService.register(onRegister, onNotification, onOpenNotificaion);    function onRegister(token) {      saveFCMToken(token);    }    if (Platform.OS == 'android') {      localNotificationService.createChannelAndroid('wapp');    }    function onNotification(notify) {      var RandomNumber = Math.floor(Math.random() * 100) + 1;      const options = {        soundName: 'default',        playSound: true,      };      localNotificationService.showNotification(        RandomNumber,        notify.title,        Platform.OS == 'android' ? notify.body : notify.body,        notify,        options,'wapp',      );    }    function onOpenNotificaion(notify) {      console.log('🚀 ~ FCM LOG', notify);    }  };}

On My app, main file everytime the app opens I call this function like this

useEffect(() => {    checkNotifications().then(({status, settings}) => {      if (status == 'granted'&& user?.login?.isLoggedIn == true) {        let notificationHandler = new NotificationHandler();        notificationHandler.enableDevicePushNotifications();      }    });  }, []);

This is the firebase config helper file

/* Firebase Helper File for Push Notifications*/import {AppState, Platform} from 'react-native';import messaging from '@react-native-firebase/messaging';import * as TokenUtils from './tokenUtils';import {device} from '../utils/uiUtils';let deviceToken = null;class FCMServiceHelper {  register = (onRegister, onNotification, onOpenNotification) => {    this.checkDeviceToken();    this.checkPermission(onRegister);    this.createNotificationListeners(      onRegister,      onNotification,      onOpenNotification,    );  };  checkDeviceToken = async () => {    let async_fcmToken = await TokenUtils.getFCMToken();    if (async_fcmToken !== null) {      deviceToken = async_fcmToken;    }  };  registerAppWithFCM = async () => {    if (Platform.OS === 'ios') {      await messaging().registerDeviceForRemoteMessages();      await messaging().setAutoInitEnabled(true);    }  };  checkPermission = (onRegister) => {    messaging()      .hasPermission()      .then((enabled) => {        if (enabled) {          // User has permissions          this.getToken(onRegister);        } else {          // User doesn't have permission          this.requestPermission(onRegister);        }      })      .catch((error) => {        console.log('[FCMService] Permission rejected ', error);      });  };  getToken = (onRegister) => {    messaging()      .getToken()      .then((fcmToken) => {        if (fcmToken) {          if (deviceToken == null) {            onRegister(fcmToken);          } else {            onRegister(deviceToken);          }        } else {          console.log('[FCMService] User does not have a device token');        }      })      .catch((error) => {        console.log('[FCMService] getToken rejected ', error);      });  };  requestPermission = (onRegister) => {    messaging()      .requestPermission()      .then(() => {        this.getToken(onRegister);      })      .catch((error) => {        console.log('[FCMService] Request Permission rejected ', error);      });  };  deleteToken = () => {    console.log('[FCMService] deleteToken ');    messaging()      .deleteToken()      .catch((error) => {        console.log('[FCMService] Delete token error ', error);      });  };  createNotificationListeners = (    onRegister,    onNotification,    onOpenNotification,  ) => {    // When the application is running, but in the background    messaging().onNotificationOpenedApp((remoteMessage) => {      console.log('[FCMService] onNotificationOpenedApp Notification caused app to open from background state:',        remoteMessage,      );      if (remoteMessage) {        const notification = remoteMessage.notification;        // onOpenNotification(notification);        // this.removeDeliveredNotification(notification.notificationId)      }    });    // When the application is opened from a quit state.    messaging()      .getInitialNotification()      .then((remoteMessage) => {        console.log('[FCMService] getInitialNotification Notification caused app to open from quit state:',          remoteMessage,        );        if (remoteMessage) {          const notification = remoteMessage.notification;          onOpenNotification(notification);          //  this.removeDeliveredNotification(notification.notificationId)        }      });    // Foreground state messages    this.messageListener = messaging().onMessage(async (remoteMessage) => {      console.log('[FCMService] A new FCM message arrived! foreground',        remoteMessage,      );      if (remoteMessage) {        let notification = null;        let data = remoteMessage.data;        if (Platform.OS === 'ios') {          notification = remoteMessage.notification;          // if (AppState == 'background') {          //   onOpenNotification(notification);          // }        } else {          notification = remoteMessage.notification;        }        notification.data = data;        onNotification(notification);        // if (Platform.OS == 'ios') {        //   onOpenNotification(notification);        // }      }    });    // Triggered when have new token    messaging().onTokenRefresh((fcmToken) => {      alert('REFRESH TOKEN');      console.log('[FCMService] New token refresh: ', fcmToken);      onRegister(fcmToken);    });  };  unRegister = () => {    this.messageListener();  };}export const fcmService = new FCMServiceHelper();

But notification comes only with initial app loading. after kill and re-run, there is no any notifications

Netinfo.isConnected.fetch() returns true

$
0
0

I use NetInfo in my app, to check if it's connected to internet.

NetInfo.isConnected.fetch().then( (isConnected) => {    console.log('isConnected: ', isConnected);});

It returns true if i am connected to router or mobile data is on, and return false if not.

My problem is, if I am connected to the router or my mobile data is on, even though it doesn't have internet connection. It still returns true.

Any idea to solve this? Or other workaround/alternatives to check internet connection?

iOS Keyboard autofill makes content jump/glitch when focusing on next TextInput

$
0
0

Description

I have a page in my app with two TextInput inside views covering the whole screen.

The two TextInput have a ref ref={refTextInput1}, ref={refTextInput2}.They also have a onSubmitEditing onSubmitEditing={() => refTextInput2()}, onSubmitEditing={() => refTextInput1()}.

So, when I press "return" on the keyboard, the focus will switch to the desired input but it's also making the whole screen jump/glitch which is really annoying and not wanted.

The focus should switch to the desired input without making the whole screen jump/glitch.

I searched everywhere on StackOverflow and Github Issues but didn't find a lot of issues with this particular problem.At first, I thought I had a problem similar to #30207, but after a while trying to find the problem, I think I found it.

The problem only occurs(I think) when Autofill Passwords is enabled in Settings>Passwords>Autofill Passwords.If I disable Autofill Passwords, the jump/glitch does not occurs.

I also noticed that the keyboard event is always triggered twice on focus with Autofill Passwords enabled, and only once on focus with Autofill Passwords disabled. It may also be related. (See the console when running the snack example.)

I looked at other apps, and they all seems fine in the same type of login screen. Instagram for example doesn't have this problem.

It might also be the way I made my screen, if there's a better way to do the same or similar screen, I would be open to suggestions.

React Native version:

System:    OS: macOS 11.4    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz    Memory: 137.61 MB / 16.00 GB    Shell: 5.8 - /bin/zsh  Binaries:    Node: 14.17.0 - /usr/local/bin/node    Yarn: Not Found    npm: 6.14.13 - /usr/local/bin/npm    Watchman: 4.9.0 - /usr/local/bin/watchman  Managers:    CocoaPods: 1.10.1 - /usr/local/bin/pod  SDKs:    iOS SDK:      Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4    Android SDK:      API Levels: 22, 23, 24, 25, 26, 27, 28, 29, 30      Build Tools: 28.0.3, 29.0.2, 30.0.2      System Images: android-30 | Google APIs Intel x86 Atom      Android NDK: Not Found  IDEs:    Android Studio: 4.1 AI-201.8743.12.41.6953283    Xcode: 12.5/12E262 - /usr/bin/xcodebuild  Languages:    Java: 1.8.0_271 - /usr/bin/javac  npmPackages:    @react-native-community/cli: Not Found    react: 17.0.1 => 17.0.1     react-native: 0.64.1 => 0.64.1     react-native-macos: Not Found  npmGlobalPackages:    *react-native*: Not Found

Steps To Reproduce

  1. Make sure Autofill Passwords is enabled in Settings>Passwords>Autofill Passwords.
  2. Have at least two TextInput with a view taking the whole screen space.
  3. Focus on the next TextInput using "return" on the keyboard.

I also noticed that the keyboard event is always triggered twice on focus with Autofill Passwords enabled, and only once on focus with Autofill Passwords disabled. It may also be related. (See the console when running the snack example.)

Expected Results

When pressing "return" on the keyboard, the focus should switch to the desired input without making the whole screen jump/glitch. Like when Autofill Passwords is disabled in Settings>Passwords>Autofill Passwords.

Snack, code example, screenshot, or link to a repository:

Snack 1 is a simpler version of my issue.Snack 1: simple-keyboard-autofill-issue

Snack 2 is closer to what I really have in my app.Snack 2: my-app-keyboard-autofill-issue

Minimal code example: (from simple-keyboard-autofill-issue)

import React, { useState, useRef, useEffect } from 'react';import { Text, View, KeyboardAvoidingView, TouchableWithoutFeedback, Keyboard, Platform, TextInput } from 'react-native';export default function App() {  const [username, setUsername] = useState('');  const [password, setPassword] = useState('');  const refUsernameInput = useRef(null);  const refPasswordInput = useRef(null);  useEffect(() => {    Keyboard.addListener('keyboardWillShow', keyboardWillShow);    Keyboard.addListener('keyboardWillHide', keyboardWillHide);s    // cleanup function    return () => {      Keyboard.removeListener('keyboardWillShow', keyboardWillShow);      Keyboard.removeListener('keyboardWillHide', keyboardWillHide);    };  }, []);  const keyboardWillShow = () => {    console.log('keyboardWillShow');  };  const keyboardWillHide = () => {    console.log('keyboardWillHide');  };  return (<KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'padding' : 'height'} style={{ flex: 1 }}><TouchableWithoutFeedback onPress={Keyboard.dismiss}><View style={{ flex: 1, justifyContent: 'space-around', paddingHorizontal: 20 }}><TextInput              blurOnSubmit={false}              keyboardType="email-address"              placeholder="Username or email"              textContentType="username" // iOS              onSubmitEditing={() => refPasswordInput.current.focus()}              onChangeText={setUsername}              value={username}              ref={refUsernameInput}              style={{                borderColor: '#000',                borderWidth: 0.5,                height: 45,                paddingHorizontal: 20,                marginBottom: 5,              }}            /><TextInput              blurOnSubmit={false}              keyboardType="default"              placeholder="Password"              secureTextEntry              textContentType="password" // iOS              onSubmitEditing={() => refUsernameInput.current.focus()}              onChangeText={setPassword}              value={password}              ref={refPasswordInput}              style={{                borderColor: '#000',                borderWidth: 0.5,                height: 45,                paddingHorizontal: 20,              }}            /></View></TouchableWithoutFeedback></KeyboardAvoidingView>  );}

Here you can see the screen recording taken from an iPhone 11 Pro with iOS 14.6: (Note that secureTextEntry was temporarily disabled while screen recording, the problem is still present)

https://user-images.githubusercontent.com/64789082/121977389-e7363080-cd53-11eb-9a4c-e26fc364bd03.MP4

XCode build error /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

$
0
0

I am trying build an IOS app written in ReactNative. The application written using XCode 11.4. Then I got a new Macbook with XCode version 12.5 installed. So I cloned the project from the git and run npm install and tried to run the project using XCode. Then I got the following error.

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

I checked any issues as suggested by the accepted answer in this link,https://stackoverflow.com/questions/10373016/command-xcode-app-contents-developer-toolchains-xcodedefault-xctoolchain-usr-bi. But there is nothing wrong with it.

Also, I tried cleaning the project and building the project again. It did not solve the problem as well.

Then I tried deleting the project targets that are for tests well and tried to clean and build the project again. But it did not work either.

I tried deleting everything in the Derived Data folder and tried building the project again as well. It did not work either.

When expand the log, this is the error I am seeing.

In file included from /Users/xandasupport/Desktop/Wais/PCL/pcl-app/node_modules/react-native/ReactCommon/jsi/JSIDynamic.cpp:6:In file included from /Users/xandasupport/Desktop/Wais/PCL/pcl-app/node_modules/react-native/ReactCommon/jsi/JSIDynamic.h:8:/Users/xandasupport/Desktop/Wais/PCL/pcl-app/node_modules/react-native/React/../third-party/folly-2018.10.22.00/folly/dynamic.h:63:10: fatal error: 'boost/operators.hpp' file not found#include <boost/operators.hpp>         ^~~~~~~~~~~~~~~~~~~~~1 error generated.Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

Why am I getting that error and I can I possibly fix it?

Can we revoke and download authentication key(fir Push notifications) of we lost old one?

$
0
0

In my Appstore account I have already created three authentication keys and I don't have any one of them. Now I am gonna publish one more app to app store which uses push notifications. Since I don't have any old autbentication key,

1.Can i revoke and download any old authentication key(which was already used for existing apps)?

2.If it is possible and do so, Will there be any issue to existing apps?


How to change display name of an app in react-native

$
0
0

Apple have clear instructions on how to change the display name of an IOS app, but they are not useful for a react-native app because the folder structure is different. How do you change the display name if you have a react-native app?

React Native: Android not setting width and height correct []

$
0
0

A very simple View:

import React from "react";import { View } from "react-native";export default function App() {    return (<View            onLayout={(layout) => {                console.log(layout.nativeEvent);            }}            style={{                width: 371,                height: 477             }}></View>    );}

So im just making a view with width=371 and height=477 and then log its layout. When I run this with expo on my actual iPhone 5s device I get the following output:

{"layout": Object {"height": 477,"width": 371,"x": 0,"y": 0,  },"target": 3,}

which is correct. But when i run it on an android pixel 2 emulator with screen size 1080x1920:420dpi (I don't have an actual android device) I get the following output:

Object {"layout": Object {"height": 476.952392578125,"width": 371.047607421875,"x": 0,"y": 0,  },"target": 3,}

So width and height are slightly of. Normally i would say this doesn't really matter this much because it is less then one pixel but the problem is that for my application this seems to lead to very ugly looking display errors, where some tiles that should fit seamlessly together having some very small margin:

enter image description here

Actually I'm not a hundred percent sure if this is the reason. However, it seems to me as a very suspicious candidate. Any idea how to fix this?

Integrating Swift 5 Project with React Native

$
0
0

Project 1 (Old One)This is an iOS Project which is in Swift 5, which have so many StoryBoards files, xibs, Pods, OneSignalNotificationServiceExtention

Project 2 (New One) is in React Native

My Aim -->I want to Integrate Project1 with Project2. so I can get both project's functionality From project2.I Already Checked By Making XcFramework/Cocoapods but nothing works.

My Project1 Podfile

source 'git@github.com:CocoaPods/Specs.git'platform :ios, '11.0'use_frameworks!target 'Project1' do  pod 'Alamofire', '~> 4.0'  pod 'OneSignal', '>= 2.6.2', '< 3.0'  pod 'GooglePlacePicker'  pod 'GoogleMaps'  pod 'GooglePlaces'  pod 'Pulley'  pod 'TTGSnackbar'  pod 'GoogleAnalytics'  pod 'Firebase/Core'  pod  'SDWebImage', '~> 4.4.6'  pod 'LGSideMenuController'  pod 'XLPagerTabStrip', '~> 8.0'  pod 'libPhoneNumber-iOS'  pod 'PDFReader’  pod 'Firebase/DynamicLinks'  pod 'Cosmos', '~> 20.0'  pod 'TagListView', '~> 1.0'  pod 'KSTokenView', '~> 4.0'  pod 'Charts'  pod 'Firebase/Crashlytics'  pod 'Firebase/Analytics'  endtarget 'OneSignalNotificationServiceExtension' do  pod 'OneSignal', '>= 2.6.2', '< 3.0'end

React Native ios not showing local image

$
0
0

Environment

Background

I made a simple app. I tested it on Android/iOS simulator and real device.It worked well all. Now I'm trying to deploy on App Store.

Problem

I changed the build scheme on Xcode from debug to release ( product -> scheme -> edit scheme -> run -> build configuration ).And I run it on simulator. And result was this(google drive image link).

I don't know why my app cannot load static image.If I changed the scheme to debug it shows well like this(google drive image link).

Maybe...?

  1. I got this error /Users/mac88/Desktop/Projects/팀포크봇/VoiceCarRN/ios/main.jsbundle: No such file or directory after I remove main.jsbundle file in ios folder.
  2. 2019-10-13 02:09:06.046867+0900 VoiceCarRN[44601:3301900] [PERF ASSETS] Loading image at size {854, 1334}, which is larger than the screen size {750, 1334}

Check please !

React Native, how to preload images into memory

$
0
0

Image.prefetch loads images to the disk cache, but how to I load images into memory? Just render them off screen?

Viewing all 16912 articles
Browse latest View live


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