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

Can't archive with Xcode (error - PhaseScriptExecution failed with a non zero exit code), but the build is successful

$
0
0

Error in detail, the black area is the name of the project and its sub-directoryError from Xcode I am sorry for the black marks in the image.

I have seen multiple posts suggesting an answer to this problem, Lock unlocks keychain (tried it), pod Update (tried it), clear build(tried it), signing, skip install in build settings(tried it) - None of them actually worked.

I built my iOS app in react native with Expo, after which I did expo eject to create the iOS folder for Xcode build and archiving, the build is successful every time and it even runs on the simulator and in my device(iPhone 7) but it always failed to archive by throwing this error - Uncategorised - Command PhaseScriptExecution failed with a non zero exit code..

Any help to point me in which direction should I go or what can be the possible mistake that I am doing will be of great help. Do let me know if, I should provide any more detail about this. Thank you!

Xcode Version - 11.0 Mac Version - 10.15 Catalina iPhone OS - 13.1.3

Few links I tried from -

  1. "${PODS_ROOT}/SwiftLint/swiftlint" causes "Command PhaseScriptExecution failed with a nonzero exit code" with Xcode 10
  2. https://github.com/apollographql/apollo-ios/issues/395
  3. https://www.reddit.com/r/iOSProgramming/comments/al9box/getting_an_error_command_phasescriptexecution/

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

$
0
0

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

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

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

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

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

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

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

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

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

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

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

Nah, doesn't work.

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

References that might be leads I have been studying:

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

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

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

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

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

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

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

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

Just found this interest statement in the logs:

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

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

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

$
0
0

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

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

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

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

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

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

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

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

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

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

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

Nah, doesn't work.

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

References that might be leads I have been studying:

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

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

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

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

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

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

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

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

Just found this interest statement in the logs:

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

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

How to know whether a *page* in an app is using React Native (or pure native)?

$
0
0

Note: I am not asking how to detect if an app uses React Native somewhere inside it (already has an answer here).

I wonder which pages (screens) inside an app is using RN and which pages are not, by examining the apk file or runtime checks etc. For instance, the Facebook app uses RN. However, it only uses RN for some seldom-used pages - that is completely a different story than using in every page.

Thanks for any ideas!

How to change the display name of an iOS app in Xcode 10.1?

$
0
0

I've tried with the "Bundle display name" key in info.plist and changed the value to the new name, but when I install the app on my phone, it still appears with the old name.

React-Native: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template

$
0
0

While executing npx react-native init MyProject I ran into the following error:

✖ Installing CocoaPods dependencies (this may take a few minutes)
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.

Which seems to be related to an earlier error displayed:

checking for arm-apple-darwin-gcc... /Library/Developer/CommandLineTools/usr/bin/cc -arch armv7 -isysroot 
checking whether the C compiler works... no
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'

XCode and its CLI seem to all run fine.

My configuration:

  • MacOS Catalina 10.15.1 (19B88)
  • NPM 6.11.3
  • React-Native 0.61.4
  • XCode 11.2.1 (11B500)

Any leads appreciated.

how can I keep my api keys safe on React Native App

$
0
0

I'm building a Native app with React Native. I was once a web programmer and it's my first time using React Native and making native app especially which is going to be actual product and serve for normal users. During my struggle, I've encountered some issue that I, as a former web programmer, can't find a way out.

In my app, I call some APIs that any other app would/could be using, like Google Maps via react-native-maps library. My API keys are saved at files that are used when actually build the app, info.plist and AppDelegate.m ( building iOS app first by now ). I've thought that would be safe enough. But I recently find out it might not.

After reading some articles about getting rid of secret informations from native apps, I've tried hard to find a way out. Thought about using .env, getting api keys from backend server, etc. couldn't use .env, and can't find a way to call API, sending API keys ( not containing them as a build meta data ).

So here's my question. How can I keep my secrets safe for react native app?

Disable switching text color in status bar when Dark Mode is on

$
0
0

I am developing an application using React native library and I wonder how I can disable switching the text color in the status bar to white color when dark mode on iOS phone is on? I would like to always have black text color.

I tried to set <StatusBar barStyle="dark-content" /> but the text color changes to white anyway.

Any options to solve the issue are welcome, either using iOS solution or using RN solution.


In iOS: Can my app launch another app and get a response/acknowledgement back

$
0
0

In iOS, is there anyway i can launch another app to do something and then get a response back saying that it’s done.

For example: My iOS app APP A launches another app APP B (e.g. Google Pay) to make a payment and then after the payment is made, I would like APP A to receive a response/callback/acknowledgement saying its done.

By the way, I'm having zero trouble getting APP A to launch APP B via UIApplication.Shared.Open(…)

** In android we use Android Intent to launch APP B and get a response back to APP A using OnActivityResult(…)**.

PS: My App is actually built in React Native using NativeModules

React Native iOS Sentry - Too many arguments to block call, expected 1, have 3

$
0
0

Trying to build my React-Native app for iOS. Previous build was fine, but since I added Sentry for error logging, I can not build it. Linking was fine, I did it and it was successful.

I am getting this error:

Too many arguments to block call, expected 1, have 3
RNSentry.m

inside this part of code:

RCT_EXPORT_METHOD(sendEvent:(NSDictionary * _Nonnull)event
              resolve:(RCTPromiseResolveBlock)resolve
              rejecter:(RCTPromiseRejectBlock)reject)
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0ul), ^{
    if ([NSJSONSerialization isValidJSONObject:event]) {
        NSData *jsonData = [NSJSONSerialization dataWithJSONObject:event
                                                           options:0
                                                             error:nil];

        SentryEvent *sentryEvent = [[SentryEvent alloc] initWithJSON:jsonData];
        [SentryClient.sharedClient sendEvent:sentryEvent withCompletionHandler:^(NSError * _Nullable error) {
            if (nil != error) {
                reject(@"SentryReactNative", error.localizedDescription, error);
            } else {
                resolve(@YES);
            }
        }];
    } else {
        reject(@"SentryReactNative", @"Cannot serialize event", nil);
    }
});
}

on this line:

reject(@"SentryReactNative", error.localizedDescription, error);

I am using RN version 0.59.9 and React version is 16.8.3

Tried to google if someone had similar issues but found nothing. Any help will be appreciated.

Why are some imported React-Native Redux actions changing values and triggering onEffects multiple times?

$
0
0

Here is my setup:

// store/actions/user.js

export const discoverFollowingStatus = followsId => {
  return (dispatch, getState) => {
    const userId = getState().user.user.id;
    findFollowingFromTo(userId, followsId).then(following => {
      dispatch({
        type: UPDATE_FOLLOWING_STATUS,
        payload: {
          followsId,
          following: following !== null,
        },
      });
    });
  };
};

// component.js

import {
  discoverFollowingStatus,
} from '../store/actions/user';
...
useEffect(() => {
    discoverFollowingStatus(followedUserId);
    console.log(discoverFollowingStatus);
  }, [followedUserId, discoverFollowingStatus]);

The console is printing lots of functions that aren't grouping together: logs

The big problem is that the screen is constantly re-rendering because the useEffect is triggering. Why would that imported constant change and trigger it?

How to start react native starter kit

$
0
0

Now, I am connected both project (ios/android) to firebass

3.1) [iOS] Follow the add firebase to your app instructions here to generate your GoogleService-Info.plist file if you haven't done so already - use the package name generated previously as your iOS bundle ID.

3.2) [iOS] Place this file in the ios/ directory of your project. Once added to the directory, add the file to your Xcode project using 'File > Add Files to "[YOUR APP NAME]"…' and select the plist file.


3.3) [Android] Follow the manually add firebase to your app instructions here to generate your google-services.json file if you haven't done so already - use the package name generated previously as your Android package name. 3.4) [Android] Place this file in the android/app/ directory of your project.


so I copy googele-services.json and paste to /Users/kwon/react-native-firebase-starter/android/app/

and also same to GoogleService-Info.plist file to /Users/kwon/react-native-firebase-starter/ios

and then I started npm start and stuck in Loading dependency graph, done.

in android

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! banoi@5.4.0 android: react-native run-android npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the banoi@5.4.0 android script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/kwon/.npm/_logs/2020-01-20T11_18_44_107Z-debug.log kwon@kwonui-MacBookPro react-native-firebase-starter %

and it makes a other terminal and same stuck at Loading dependency graph, done.

I am newbie at programing and also not good at english

but I wanna make my idea to real

How can I build react-native components for different build types/flavors?

$
0
0

On react-native, there's a feature were we can use a components file suffix to build different components according to platform, ie. component.ios.js and component.android.js will build a component module with specific behavior for ios and android.

Is there any way to build different components according to build variants/flavors/schemes? Say, suppose I have a pro and a lite version of my app, I'd like to do something like this:

| some-folder/
| -- component.pro.js
| -- component.lite.js

and so when I import component from 'some-folder/component', the bundler could detect if I'm using a pro or lite build variant and bundle the correct javascript file, in a similar manner that it's done for the OS suffixes.

Do notice that I know that I can just check the build variant at runtime and provide the correct component correctly, but that means bundling the code for the wrong variant in the app - increasing app size needlessly.

Related, is there a way to import images conditionally according to build variant? I know I could just place them in their respective assets folders for each native platform, but I wonder if there are other methods.

Any help is appreciated.

How do I reset the ios library in react-native?

$
0
0

I have a new app that was initialised with

react-native init demo

and is run successfully using react-native run-ios.

I installed a few libraries using CocoaPods and now the react-native run-ios works but not the xcode build.

I tried deleting the Pods library, checking out all the files back to their original state, and repeating pod install but I still get the same error in xcode build :

Showing Recent Messages :-1: Cycle in dependencies between targets 'bridgeTests' and 'Pods-bridgeTests'; building could produce unreliable results. Cycle path: bridgeTests → Pods-bridgeTests → bridgeTests Cycle details: Target build order preserved because “Parallelize Build” is off

→ Target 'bridgeTests' has target dependency on Target 'Pods-bridgeTests'→ Target 'Pods-bridgeTests' has target dependency on Target 'bridge' due to target order in a “Target Dependencies” build phase or the scheme ○ That command depends on command in Target 'bridge': script phase “[CP] Copy Pods Resources”

I would like to somehow rebuild my entire ios library so that an xcode build would work just as the react-native run-ios works.

What's the solution?

Thanks, Yaron

How to change customise a slider in React Native?


React native power button long press listener when app is running in background

$
0
0

I want to call a SOS function when user long press the power button. If there is no library to do this, is there any native method to do so?

Undefined symbols for architecture arm64: _YGConfigNew in libyoga.a(Yoga.o)

$
0
0

When I launch my app with XCode or with react-native run-ios in an iOS emulator, it work good.

But if I do the same in a real device, it not work. I've got this error :

Undefined symbols for architecture arm64:
   "YGConfig::YGConfig(int (*)(YGConfig*, YGNode*, YGLogLevel, char const*, char*))", referenced from:
      _YGConfigNew in libyoga.a(Yoga.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

More informations :

react: 16.9.0
react-native: 0.60.5
Real device: iPad with iOS 12.4.4

Someone has solution ? Thanks

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

$
0
0

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

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

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

enter image description here

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

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

How to convert this method from Objective-C to Swift?

$
0
0

I'm trying to convert a method from the React-native Firebase documentation, from Objective-c code to Swift. But it's not working, can someone lend me a help?

The doc I'm following: https://rnfirebase.io/docs/v4.3.x/notifications/ios

This is the Object C part I want to convert and add to the Swift file:

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
  [[RNFirebaseNotifications instance] didReceiveLocalNotification:notification];
}

At the moment, this is my code, see the commented part:

import UIKit
import Firebase

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
  var window: UIWindow?
  var bridge: RCTBridge!

  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    FirebaseApp.configure()
    RNFirebaseNotifications.configure()

    let jsCodeLocation: URL

    jsCodeLocation = RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index", fallbackResource:nil)
    let rootView = RCTRootView(bundleURL: jsCodeLocation, moduleName: "Zepplin", initialProperties: nil, launchOptions: launchOptions)
    let rootViewController = UIViewController()
    rootViewController.view = rootView

    self.window = UIWindow(frame: UIScreen.main.bounds)

    self.window?.rootViewController = rootViewController
    self.window?.makeKeyAndVisible()

    return true
  }

  /*func application(_ application: UIApplication, didReceiveLocalNotification notification: [UILocalNotification: Any]?) -> Any {
    RNFirebaseNotifications.instance(_, didReceiveLocalNotification, notification)
  }*/

}

But of corse, it's not working, because the syntax is wrong... I'm not familiar with Swift. Can someone lend me a hand? I would be glad! Thankss in before-hand!!!

EDIT:

Sorry if my question was not clear enough. For me, the question was, "how to fix the syntax?", I knew that the syntax was wrong. I had nothing to add to my question, the error Xcode was giving me was expected, obvious because I don't know Objective-C, nor Swift, I was trying in my way. Even if I added the error to the question, I'm sure that something else would error too. That's why I asked if someone could convert it for me, it's only a few lines, so I think I was not asking too much.

Thanks @bsod, for mentionating the tool you posted in the comment!! This is exactly the tool I needed. I didn't know that something like this tool existed. This is what I needed

Thanks for everyone that helped me.

expo build:ios throws Reason: Unknown reason, raw: "SSL_connect returned=1 errno=0 state=error: certificate verify failed"

$
0
0

Yesterday I managed to run the command expo build:ios successfully but this morning it just won't work, I get the following error message after entering my credentials:

Trying to authenticate with Apple Developer Portal...
Authentication with Apple Developer Portal failed!
Reason: Unknown reason, raw: "SSL_connect returned=1 errno=0 state=error: certificate 
verify failed"
Set EXPO_DEBUG=true in your env to view the stack trace.

Any idea where the error comes from? I've checked the apple services status and everything is up.

Here's my setup

Expo CLI 3.11.5 environment info:
System:
  OS: macOS 10.14.5
  Shell: 5.3 - /bin/zsh
Binaries:
  Node: 10.16.3 - /usr/local/bin/node
  Yarn: 1.19.1 - /usr/local/bin/yarn
  npm: 6.9.0 - /usr/local/bin/npm
  Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
  Android Studio: 3.4 AI-183.6156.11.34.5692245
  Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
npmPackages:
  @storybook/react-native: ^4.1.7 => 4.1.7 
  @types/react: 16.4.7 => 16.4.7 
  @types/react-native: ^0.60.2 => 0.60.2 
  @types/react-navigation: ^3.0.7 => 3.0.7 
  expo: ^33.0.0 => 33.0.7 
  react: 16.8.3 => 16.8.3 
  react-native: https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz => 0.59.8 
  react-navigation: ^4.0.10 => 4.0.10 
npmGlobalPackages:
  expo-cli: 3.11.5
Viewing all 16558 articles
Browse latest View live


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