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

firebase phone authentication in react native app not working after release

$
0
0

i made react native app with firebase phone authentication.The authentication work perfect on emulator (ios and android) and on real device emulator.But when I create the apk file and install it on my phone, while I click on 'login' that is no response from the app and I can't login.

Anyone know how to solve this issue?


Fix React Native splash screen "white flash" on ios when using an AppDelegate.swift file and not AppDelegate.m

$
0
0

So I'm facing an issue where there's various fixes for this known problem with ios apps in React Native, where between the splash screen and the login screen, there's a white flash that interupts the flow of the app.

My task is to fix this white flash and make it flow directly into the app. The problem is that all of the solutions that are online use the AppDelegate.m file, where we are only using AppDelegate.swift.

I've worked with React Native extensively, but this is really a native issue I haven't had to think about before.

A few of the fixes I've looked at are:

The fast fix I guess

and then this package that is supposed to fix the issue

Unfortunately these both use AppDelegate.m in the fix description. I've even converted the Objective-C code to swift, and pasted it in the same block. It causes build errors immediately when importing the RNSplashScreen package. Please help!

My AppDelegate.swift looks like so

////  AppDelegate.swift//import UIKit@UIApplicationMainclass AppDelegate: UIResponder, UIApplicationDelegate /* , MessagingDelegate */ {  var bridge: RCTBridge!  var window: UIWindow? = UIWindow(frame: UIScreen.main.bounds)  func application(_ application: UIApplication,                   didFinishLaunchingWithOptions                   launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {    var jsCodeLocation: URL    AppCenterReactNativeCrashes.registerWithAutomaticProcessing()  // Initialize AppCenter crashes    AppCenterReactNativeAnalytics.register(withInitiallyEnabled: true)    AppCenterReactNative.register()    jsCodeLocation = RCTBundleURLProvider.sharedSettings().jsBundleURL(      forBundleRoot: "index.ios",      fallbackResource: nil)    self.window?.backgroundColor = UIColor.white//    let rootView = RCTRootView(bundleURL: jsCodeLocation, moduleName: "northwellHealth", initialProperties: nil, launchOptions: launchOptions)    let rootView: RCTRootView = RCTRootView(      bundleURL: jsCodeLocation,      moduleName: "NorthwellHealth",      initialProperties: nil,      launchOptions: launchOptions)    rootView.backgroundColor = UIColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1)    let rootViewController: UIViewController = UIViewController()    rootViewController.view = rootView    self.window = UIWindow(frame: UIScreen.main.bounds)    self.window?.rootViewController = rootViewController    self.window?.makeKeyAndVisible()---------- This is the translated into swift code from link 1 ----------    let launchScreenView = Bundle.main.loadNibNamed("LaunchScreen", owner: self, options: nil)?[0] as? UIView    launchScreenView?.frame = window!.bounds    rootView.loadingView = launchScreenView------------------------------------------------------------------------    return true  }  func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {    return true  }  func applicationWillResignActive(_ application: UIApplication) {    // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks.    // Games should use this method to pause the game.  }  func applicationDidEnterBackground(_ application: UIApplication) {    // If your application supports background execution, this method is called instead of    // applicationWillTerminate: when the user quits.  }  func applicationWillEnterForeground(_ application: UIApplication) {    // Called as part of the transition from the background to the active state;    // here you can undo many of the changes made on entering the background.  }  func applicationDidBecomeActive(_ application: UIApplication) {    // Restart any tasks that were paused (or not yet started) while the application was inactive.    // If the application was previously in the background, optionally refresh the user interface.  }  func applicationWillTerminate(_ application: UIApplication) {    // Called when the application is about to terminate. Save data if appropriate.    // See also applicationDidEnterBackground:.  }}
this gives me a "Thread 1: "Could not load NIB in bundle: 'NSBundle </Users/jacobirwin/Library/Developer/CoreSimulator/Devices/A324EAF6-89FB-48D7-B8AE-E7B2E45060A7/data/Containers/Bundle/Application/5375EBFB-E6F6-4F78-A6F1-690E4C5D16C1/Northwell.app> (loaded)' with name 'LaunchScreen'" error

Then I've tried so many things with the react-native-splash-screen package, and can't seem to get anywhere meaningful with it..

Please let me know if you have insight on these, thank you.

Ionic React - Disable Back Swipe Gesture and Hardware Back Button globally

$
0
0

I am building an Ionic React App with Capacitor and want to disable the SwipeBack Gesture and the Hardware Back Button (Android) globally for my App.

Can anyone help me with this one?

Realm data sync with react native

$
0
0

I'm having troubles syncing my Realm data to the backend. It works perfectly fine for local storage, but when I check my cluster I cannot find any entries made locally. I thought it may have to do with the syncSession.state being inactive, but sync is also not working inside the .open when the state is active.

This is how I open the Realm (here inside the .open, realm.syncSession.state is active):

useEffect(() => {  const config = {    schema: [Player.schema],    sync: {      partitionValue: partition,      user: user,    },  };  Realm.open(config).then((projectRealm) => {    realmRef.current = projectRealm;    const syncPlayers = projectRealm.objects('Player');    let sortedPlayers = syncPlayers.sorted('number');    setPlayers([...sortedPlayers]);    sortedPlayers.addListener(() => {      setPlayers([...sortedPlayers]);    });  });  return () => {    // cleanup function    const projectRealm = realmRef.current;    if (projectRealm) {          projectRealm.close();          realmRef.current = null;          setPlayers([]);        }      };    }, [user, partition]);}

Then I write to it like this (here, realm.syncSession.state is inactive):

 const createPlayer = (player) => {    const projectRealm = realmRef.current;    projectRealm.write(() => {      projectRealm.create('Player', new Player({...})      );    });  };

Can sync even work like that? Or do I need backend functions?

I'm using Realm v10.2.0 and react native v0.64.0.

React Native - npx react-native run-ios doesn't work after initializing the project

$
0
0

After reading https://reactnative.dev/docs/environment-setup, I created a react-native project using npx react-native init ***.

It was successful, so, I tried to run the project using npx react-native run-ios, and got the below error:

** BUILD FAILED **The following build commands failed:    CompileC /Users/loser/Library/Developer/Xcode/DerivedData/test0205-dasunahpjpavelgmslwgmvjhesxy/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper.build/Objects-normal/x86_64/FlipperRSocketResponder.o /Users/loser/Documents/projects/test0205/ios/Pods/Flipper/xplat/Flipper/FlipperRSocketResponder.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler(1 failure)

How set default text color for iOS when developing on RN

$
0
0

When developing an application on React Native, it became necessary to set the color for all text in the application using native methods. In the case of android, this does not cause problems (we just set the desired color in the styles.xml) but what about ios? Is it possible to prescribe the text color somewhere in the info.plist?

Push Notification In React Native

$
0
0

I am integrating push notification in react native with help of "react-native-push-notification" library. The push is coming from node js(backend).I am successfully getting push in both environment Android and IOS.

Now i have two issues1) In ios when i am getting push there is one parameter in notification payload "userInteraction". This parameter is for that user clicked the notification or not. Now it is working fine in android but in ios this is always false.2)I want to set custom image in push notification, which is coming from push.

I am using "https://www.npmjs.com/package/react-native-push-notification" this library.

I have tried this code :-

  export function setupPushNotification(handleNotification) {    PushNotification.configure({    onRegister: function (token) {        if (Platform.OS == 'ios') {            firebase.messaging().getToken().then((token) => {                alert(JSON.stringify(token))                requestaddAuthToke(token)            .then((data) => {                console.log("hello2 "+ JSON.stringify(data))            })            .catch((error) => {                console.log("hello3 "+ JSON.stringify(error.message));            })            });        }        else {            console.log("hello2 "+ JSON.stringify(token.token))            requestaddAuthToke(token.token)            .then((data) => {                console.log("hello2 "+ JSON.stringify(data))            })            .catch((error) => {                console.log("hello3 "+ JSON.stringify(error.message));            })        }    },    onNotification: function (notification) {        const clicked = notification.userInteraction;        if (clicked)            handleNotification(notification.episodeCode)        if (Platform.OS == 'ios')            notification.finish(PushNotificationIOS.FetchResult.NoData);    },    senderID: "529815244511",    permissions: {        alert: true,        badge: true,        sound: true    },    popInitialNotification: true,    requestPermissions: true, })  return PushNotification}

Any type of help will appreciated.

Xcode 12 very slow to launch simulator

$
0
0

Someone could help me ?

I have a problem with Xcode 12.4, the application takes more than 5 minutes to launch the app and stay blocked building the app.

It's not a problem with my application because i have tried with the new app and the problem still be the same.


How to make server.json work locally on mobile without internet?

$
0
0

I have a server.json, and I'm using json-server and axios to be able to access the .json data with localhost, my React Native app obviously can only work on localhost (development), how can I replace json-server for production? I don't want to work with API's and rate limits, how can I create a .json on mobile so the user can access everything from the .json locally without internet access?

https://github.com/typicode/json-server

How to disable font scaling in React Native for IOS app?

$
0
0

Enlargement of size of the device font will sometimes break (Styling wise).

how can i get this blur effect on header bar on react native?

$
0
0

like this

I want this blur effect on the header tab in react native

Running react-native run-ios is not working but XCode Run is working

$
0
0

It is very new to me see this problem which started happening recently. Previously my app used to work fine on the iOS simulator by running this command react-native run-ios. Now I have done a lot of research and made my app run via XCode. But somehow the metro bundler is not linked when the app runs via XCode.

I tried running the app via react-native run-ios and every time I am seeing this error. It is too big to copy paste every error here, but here are some of them:

Undefined symbols for architecture x86_64:"Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer<A>) -> (Swift.IndexingIterator<Swift._ArrayBuffer<A>>, Swift.Int)", referenced from:      generic specialization <serialized, Swift._ArrayBuffer<Swift.Int8>> of Swift._copyCollectionToContiguousArray<A where A: Swift.Collection>(A) -> Swift.ContiguousArray<A.Element> in libMixpanel-swift.a(AutomaticProperties.o)ld: symbol(s) not found for architecture x86_64clang: error: linker command failed with exit code 1 (use -v to see invocation)** BUILD FAILED **The following build commands failed:        Ld /Users/careerlabsdev/Library/Developer/Xcode/DerivedData/CareerLabs_Elev8-gxcfanteiuxazegkgwkjkrjxbdmw/Build/Products/Debug-iphonesimulator/CareerLabs.app/CareerLabs normal(1 failure)

I have done a lot of things to make it to work. The only success I got here is, while running the command react-native run-ios, it opens up the metro bundler server. After that it fails with giving a 1000 lines of error. I picked the error which had some cream part. Some key words to pick from the error:

  • ld: symbol(s) not found for architecture x86_64
  • clang: error: linker command failed with exit code 1 (use -v to see invocation)
  • Did not understand the word Ld, which is listed under BUILD FAILED

What I did is as follows:

  1. Deleting node_modules, Pods. Cleaning the build from XCode. Running npm install and then cd ios && pod install and then ran the command react-native run-ios
  2. Deleting Pods, Podfile.lock. Did pod install and then in the root react-native run-ios
  3. Doing these:
rm -rf ~/Library/Caches/CocoaPodsrm -rf Podsrm -rf ~/Library/Developer/Xcode/DerivedData/*pod deintegratepod setuppod installcd ..react-native run-ios
  1. Restarted the system, and ran the command again react-native run-ios
  2. Added arm64 in the Excluded Architecture from XCode. Please note, this enabled me to build and run the app successfully on XCode. But it doesn't get attached to the metro bundler server. Looks like it runs the release mode only.
  3. Updated my package react-native-gesture-handler to the latest one which is 1.10.3, to see if that removes my problem. But no luck :(

My Podfile look like this:

  platform :ios, '10.0'  use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })  post_install do |installer|    flipper_post_install(installer)    installer.pods_project.targets.each do |target|      target.build_configurations.each do |config|        config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'      end    end  end

I am out of options now, and waiting for some insight to be given. It is indeed frustrating to see an error on something which never created a problem. I am using Apple M1 Chip Macbook. Would appreciate any kind of help on this.

Touchable opacity and button not work in react native android but work fine in ios

$
0
0

I am using Button, TouchableOpactity, Pressable but not working in Android but working in iOS. I also import TouchableOpacity from 'react-native' or TouchableOpacity from 'react-native-gesture-handler'

<TouchableOpacity          style={[            {              backgroundColor:                selectStudent.length === 0 ? 'gray' : backgroundColor,            },            Styles.nextView,          ]}          onPress={            !route.params.signatureRequire              ? () => checkIn()              : () =>                  navigation.navigate('SignatureExample', {                    selectStudent: selectStudent,                    studentsName: studentsName,                    checkin_attendance_flags: checkin_attendance_flags,                  })          }><Text style={Styles.nextText}>Next</Text></TouchableOpacity>

react native ios app foreground notification has some issue in react-native-push-notification pkg

$
0
0

Using packages"react-native-push-notification": "^6.1.3", "@react-native-community/push-notification-ios": "^1.8.0",

I added this in appDelegate.m

-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler { completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge); }

Application can receive notifications and background mode but not in foreground. And one case is there when application is open and notification bar is open, then notification are coming in notification bar.

expected behaviour : when application is open, then also notification should come in notification bar.current behaviour : background mode is okay, and when app is open and I open the notification bar then notifications are coming.

React Native. How to make a view visible when keyboard is opened?

$
0
0

I am new in React Native. I'm trying to make a view visibale when keybord is opened. It works with Android by default without KeybordAvoidingView. But on iOS nothing happens and my view under the keyboard. I've made simplify code example

I've tried to use KeyboarAvoidingView in a different parts of component with a defferent options of behavior.

Thanks in advance

const { height, width } = Dimensions.get("window");const paddingLeft = 20;const widthContent = 400;const styles = StyleSheet.create({  container: {    flex: 1,    backgroundColor: "white"  },  top: {    backgroundColor: "black",    borderBottomLeftRadius: 75,    overflow: "hidden"  },  title: {    left: paddingLeft,    width: 305,    fontStyle: "normal",    fontWeight: "700",    fontSize: 36,    lineHeight: 44,    color: "#FFFFFF"  },  subtitle: {    fontStyle: "normal",    fontWeight: "600",    fontSize: 24,    lineHeight: 30,    color: "#000000"  }});export default function App() {  return (<View style={styles.container}><View        style={[          styles.top,          {            flex: 1,            backgroundColor: "rgba(247, 101, 108, 1)"          }        ]}><View style={{ height: 0.41 * height }}><View style={{ position: "absolute", bottom: 60 }}><Text style={[styles.title]}>Welcome to </Text><Text style={[styles.title, { left: paddingLeft + 3 }]}>Ptn</Text></View></View></View><View        style={{          flex: 1,          minHeight: 180,          backgroundColor: "rgba(247, 101, 108, 1)"        }}><View          style={{            flex: 1,            backgroundColor: "white",            borderTopRightRadius: 75          }}><View            style={{              display: "flex",              flexDirection: "row",              justifyContent: "space-between",              alignItems: "center",              marginTop: 40,              width: widthContent,              marginLeft: 29            }}><Text style={styles.subtitle}>Sign In</Text><View><Button /></View></View><KeyboardAvoidingView            style={{ flex: 1, backgroundColor: "green" }}            behavior="height"            enabled><View              style={{ width: 0.83 * width, marginLeft: 29, marginTop: 49 }}><TextInpit /><TextInpit /></View></KeyboardAvoidingView><View            style={{              width: widthContent,              display: "flex",              flexDirection: "row",              justifyContent: "flex-start",              paddingLeft,              paddingTop: 51            }}><Text>Do not have account?</Text></View></View></View></View>  );}

iOS React Native fetch with redirect to custom url scheme fails with `Network request failed` error

$
0
0

On my current react native project we have the authentication flow build on top of oidc.It uses multiple redirects while performing user authentication.These redirects are made to urls which bear some authentication data in it.Here's some stub example:

fetch('https://my-auth-server.domain/address') -> 302 ('myappid://action?user=data') 

As you can see the server redirects initial request to custom url scheme. And there's the issue:(I suppose) Because of this custom url scheme I do not receive response, but only "unsupported URL" XHR error. No headers, from which I could parse redirect location, nothing. Just this error text.

Is it really possible to handle custom url scheme redirects via React Native fetch / XHR?

Environment:

  • React Native 0.64
  • iOS 12.1-14.4
  • React Navigation v4
  • XCode 12.5

What I've already did:

  • I have deep linking set up in app with URL Schemes set.
  • I have Allow Arbitrary Loads set to true with domains configured.
  • I tried to use pure XHR request, axios, fetch - the result is always the same.
  • In simulator's Safari and in desktop browser initial url opens just fine.
  • React Flipper also shows response from this request with all data! (status: 302, all headers in place, etc.)

There's also no possible way to intercept this redirect, since React Native's fetch does not support { redirect: "manual" } option.

Building React native fail on iOS - using Apple M1 chip

$
0
0

I've got a new mac and I followed the instructions for the installation.

when I run the Command:

npx react-native init ProjectName

I got the following Error

** BUILD FAILED **

The following build commands failed:CompileC /Users/aghiadmonier/Library/Developer/Xcode/DerivedData/test-bbpkvpircnzzukgpgaaohkixdojw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper.build/Objects-normal/x86_64/ConnectionContextStore.o /Users/aghiadmonier/Desktop/React/test/ios/Pods/Flipper/xplat/Flipper/ConnectionContextStore.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler(1 failure)

I am using Xcode 12.5

pod install mkdir Permission denied

$
0
0

I have a new React Native project with RN 64.0, when I run npx pod install it fail returning this:

npx: installed 1 in 27.036sScanning for pods...1.10.1> pod installAuto-linking React Native modules for target `MyMALnew`: RNCAsyncStorage, RNCMaskedView, RNGestureHandler, RNReanimated, RNScreens, and react-native-safe-area-contextAnalyzing dependenciesFetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`Downloading dependenciesInstalling CocoaAsyncSocket (7.6.5)Installing DoubleConversion (1.1.6)Installing FBLazyVector (0.64.0)Installing FBReactNativeSpec (0.64.0)[!] /bin/bash -c set -emkdir -p /Volumes/Macintosh HD - Data/WORK/MyMALnew/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec && touch /Volumes/Macintosh HD - Data/WORK/MyMALnew/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h /Volumes/Macintosh HD - Data/WORK/MyMALnew/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mmmkdir: /Volumes/Macintosh: Permission denied

ps: this is the first time I use npx prefix with RN, not sure if this is the issue here :)

Thanx for helping..

I am working in react native and while using react-native-firebase APNS token is getting null

$
0
0

I am using react-native-firebase 5.6.0 with react-native 0.64.0 and react 17.0.1. I want to get APNS token in iOS device which I am checking in real device still I am getting APNS token as null in response.Following is my react native code

import React, { useState, useEffect } from 'react';import { NativeModules, Platform, Linking } from 'react-native';import { useNavigation } from '@react-navigation/native';import AsyncStorage from '@react-native-async-storage/async-storage';import {    shallowEqual, useDispatch, useSelector,} from 'react-redux';import * as Routes from 'constants/routes';import { sentryCapture } from 'utils/errorUtils';import NotificationPermission from 'screens/Shared/NotificationPermission';import firebase from 'react-native-firebase';import { actions as ProfileActions } from 'store/modules/profile';import { selectors as AuthSelectors } from 'store/modules/auth';import AppBottomTabNavigator from './AppBottomTabNavigator';const AppContainer = () => {    const dispatch = useDispatch();    // const router = useRoute();    const navigation = useNavigation();    const [hasNotificationPermission, setHasNotificationPermission] = useState(true);    const [ignoreNotificationPermission, setIgnoreNotificationPermission] = useState(false);    const workerId = useSelector(AuthSelectors.accountId, shallowEqual);    const getAPNSToken = async () => {        try {            await firebase.messaging().ios.registerForRemoteNotifications();            return firebase.messaging().ios.getAPNSToken();        } catch (e) {            sentryCapture('Failed to get an APNS token', {                extra: { error: e },            });        }    };    const getToken = async () => {        try {            const [savedTokens, fcmToken] = await Promise.all([                dispatch(ProfileActions.fetchNotificationEndpoints()),                firebase.messaging().getToken(),            ]);            if (fcmToken) {                let currentToken = fcmToken;                if (Platform.OS === 'ios') {                    currentToken = await getAPNSToken();                }                if (currentToken && !savedTokens.includes(currentToken)) {                    dispatch(ProfileActions.registerNotificationEndpoint(currentToken));                }            }        } catch { }    };    const checkPermission = async () => {        const enabled = await firebase.messaging().hasPermission();        if (enabled) {            getToken();        } else {            setHasNotificationPermission(false);        }    };    const handleNotificationOpen = (notificationOpen) => {        const {            notification: { data },        } = notificationOpen;        if (data) {            if (data.jobId) {                const jobId = parseInt(data.jobId, 10);                navigation.navigate(Routes.JobDetails, { jobId });            } else if (data.positionId) {                const positionId = parseInt(data.positionId, 10);                navigation.navigate(Routes.PositionDetails, { positionId, isActive: true });            }        }        firebase            .notifications()            .removeDeliveredNotification(notificationOpen.notification.notificationId);    };    const handleInitialNotification = async (notificationOpen) => {        try {            const lastInitialNotificationId = await AsyncStorage.getItem('lastInitialNotificationId',            );            if (                lastInitialNotificationId !== null&& lastInitialNotificationId === notificationOpen.notification.notificationId            ) {                return;            }            await AsyncStorage.setItem('lastInitialNotificationId',                String(notificationOpen.notification.notificationId),            );            handleNotificationOpen(notificationOpen);        } catch (e) {            // don't mind, this is a problem only if the current RN instance has been reloaded by a CP mandatory update        }    };    const handleIgnoreNotificationPermission = () => {        setIgnoreNotificationPermission(true);    };    const handleRequestNotificationPermission = async () => {        if (Platform.OS === 'android') {            NativeModules.OpenNotification.open();            setHasNotificationPermission(true);        } else {            try {                await firebase.messaging().requestPermission();                getToken();            } catch (error) {                Linking.openURL('app-settings:');            } finally {                setHasNotificationPermission(true);            }        }    };    useEffect(() => {        const channel = new firebase.notifications.Android.Channel('new_jobs','New jobs',            firebase.notifications.Android.Importance.Max,        );        firebase.notifications().android.createChannel(channel);        checkPermission();        // createNotificationListeners();        const removeNotificationListener = firebase            .notifications()            .onNotification((notification) => {                notification.android.setChannelId('new_jobs').setSound('default');                firebase.notifications().displayNotification(notification);            });        const removeNotificationOpenedListener = firebase            .notifications()            .onNotificationOpened(handleNotificationOpen);        const removeMessageListener = firebase            .notifications()            .getInitialNotification()            .then(handleInitialNotification);        firebase.analytics().setUserId(workerId);        return () => {            removeNotificationListener();            removeMessageListener();            removeNotificationOpenedListener();        };    }, []);    if (!hasNotificationPermission && !ignoreNotificationPermission) {        return (<NotificationPermission                onSkip={handleIgnoreNotificationPermission}                onAccept={handleRequestNotificationPermission}            />        );    }    return <AppBottomTabNavigator />;};export default AppContainer;

Following is the AppDelegate.m code:

#import "AppDelegate.h"@import Firebase;#import <React/RCTBridge.h>#import <React/RCTBundleURLProvider.h>#import <React/RCTRootView.h>#ifdef FB_SONARKIT_ENABLED#import <FlipperKit/FlipperClient.h>#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>static void InitializeFlipper(UIApplication *application) {  FlipperClient *client = [FlipperClient sharedClient];  SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];  [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];  [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];  [client addPlugin:[FlipperKitReactPlugin new]];  [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];  [client start];}#endif@implementation AppDelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{#ifdef FB_SONARKIT_ENABLED  InitializeFlipper(application);#endif  [FIRApp configure];  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge                                                   moduleName:@"grizzlyforce"                                            initialProperties:nil];  if (@available(iOS 13.0, *)) {      rootView.backgroundColor = [UIColor systemBackgroundColor];  } else {      rootView.backgroundColor = [UIColor whiteColor];  }  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];  UIViewController *rootViewController = [UIViewController new];  rootViewController.view = rootView;  self.window.rootViewController = rootViewController;  [self.window makeKeyAndVisible];  return YES;}- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge{#if DEBUG  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];#else  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];#endif}@end

I have spend couple of week on this issue but still unable to find the exact issueI have all the procedure of making APNs certificate changes in Info.plist file made push notification enable in build settings as well as in developer account of our registered application still unable to solve this issue

The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0 - React Native, VS Code

$
0
0

Hey Stackoverflow community,

I am completely new to React Native and already struggling in the first step. I have done everything according to this site: https://reactnative.dev/docs/environment-setup

I have installed node and watchmanI have X Code running for the simulationI have installed cocoa podsThe editor I am using is VS Code and the terminal is iTerm.

I created a test project like described in the doc.

npx react-native init AwesomeProject

After that, I went inside the folder and ran in two different terminals.

npx react-native start
npx react-native run-ios

When I watch people doing this on Youtube it always works, but what I get is the following:

warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'boost-for-react-native' from project 'Pods')warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'YogaKit' from project 'Pods')warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.4, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-PeerTalk' from project 'Pods')warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-Glog' from project 'Pods')warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper-DoubleConversion' from project 'Pods')warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the AwesomeProject editor. (in target 'AwesomeProject' from project 'AwesomeProject')** BUILD FAILED **The following build commands failed:    CompileC /Users/mw/Library/Developer/Xcode/DerivedData/AwesomeProject-hdnnulyuswlwrafjfjkeikstoeak/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper.build/Objects-normal/x86_64/FlipperRSocketResponder.o /Users/mw/Desktop/AwesomeProject/ios/Pods/Flipper/xplat/Flipper/FlipperRSocketResponder.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler(1 failure)

I would be super happy if someone could help me with this problem. I have seen some other posts on Stackoverflow, but nothing helped.

Thank you very much

Viewing all 16549 articles
Browse latest View live


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