Giter VIP home page Giter VIP logo

Comments (9)

ananthauppangala avatar ananthauppangala commented on June 10, 2024 3

If you are using Braintree v5 use the following line
[BTAppContextSwitcher setReturnURLScheme:self.paymentsURLScheme];

from react-native-braintree.

vasylnahuliak avatar vasylnahuliak commented on June 10, 2024 1

@Seanmclem Can you provide code from AppDelegate.m
For example https://github.com/ekreative/react-native-braintree#ios-specific

from react-native-braintree.

Seanmclem avatar Seanmclem commented on June 10, 2024 1

@vasylnahuliak My issue was that I needed to specifically import #import "BraintreeCore.h" in my AppDelegate.m before a set of FB_SONARKIT_ENABLED conditions. I was just putting it at the end of my imports which was after that. Moving it above those imports immediately mitigated my issue.

Example

#import "AppDelegate.h"
#import <Firebase.h>
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTLinkingManager.h>

#import <UMCore/UMModuleRegistry.h>
#import <UMReactNativeAdapter/UMNativeModulesProxy.h>
#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>
#import <EXSplashScreen/EXSplashScreenService.h>
#import <UMCore/UMModuleRegistryProvider.h>

#import "BraintreeCore.h"

#if defined(FB_SONARKIT_ENABLED) && __has_include(<FlipperKit/FlipperClient.h>)
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>

from react-native-braintree.

Seanmclem avatar Seanmclem commented on June 10, 2024

@Seanmclem Can you provide code from AppDelegate.m
For example https://github.com/ekreative/react-native-braintree#ios-specific

Hi, it looks something like this

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [BTAppSwitch setReturnURLScheme:@"com.mycompany.myapp.payments"];
  //...
}

I've tried importing things from Braintree but they didn't seem to make a difference. So I have nothing from Braintree imported into AppDelegate.m..

Here's more detail

#import "AppDelegate.h"
#import <Firebase.h>
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTLinkingManager.h>

#import <UMCore/UMModuleRegistry.h>
#import <UMReactNativeAdapter/UMNativeModulesProxy.h>
#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>
#import <EXSplashScreen/EXSplashScreenService.h>
#import <UMCore/UMModuleRegistryProvider.h>

#if defined(FB_SONARKIT_ENABLED) && __has_include(<FlipperKit/FlipperClient.h>)
#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

@interface AppDelegate () <RCTBridgeDelegate>

@property (nonatomic, strong) UMModuleRegistryAdapter *moduleRegistryAdapter;
@property (nonatomic, strong) NSDictionary *launchOptions;

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  
  [BTAppSwitch setReturnURLScheme:@"com.your-company-name.your-app-name.payments"]; // ADD THIS LINE
// ^^ undeclared identifier 'BTAppSwitch'


    if ([FIRApp defaultApp] == nil) {
    [FIRApp configure];
  }
#if defined(FB_SONARKIT_ENABLED) && __has_include(<FlipperKit/FlipperClient.h>)
  InitializeFlipper(application);
#endif
  
  self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]];
  self.launchOptions = launchOptions;
  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  #ifdef DEBUG
    [self initializeReactNativeApp];
  #else
    EXUpdatesAppController *controller = [EXUpdatesAppController sharedInstance];
    controller.delegate = self;
    [controller startAndShowLaunchScreen:self.window];
  #endif

  [super application:application didFinishLaunchingWithOptions:launchOptions];

  return YES;
}

from react-native-braintree.

vasylnahuliak avatar vasylnahuliak commented on June 10, 2024

I've tried importing things from Braintree but they didn't seem to make a difference. So I have nothing from Braintree imported into AppDelegate.m..

You must add #import "BraintreeCore.h" in top file, see about your error here
https://learnappmaking.com/unresolved-identifier-understanding-xcode/

Are you run pod install in ios folder your project?

from react-native-braintree.

Seanmclem avatar Seanmclem commented on June 10, 2024

I've tried importing things from Braintree but they didn't seem to make a difference. So I have nothing from Braintree imported into AppDelegate.m..

You must add #import "BraintreeCore.h" in top file, see about your error here
https://learnappmaking.com/unresolved-identifier-understanding-xcode/

Are you run pod install in ios folder your project?

Even though all my imports use < brackets > so far, it's OK to use "quotes"?

Yes I have run pod install. Should I try "pod clean" then install again? Anything like that?

from react-native-braintree.

vasylnahuliak avatar vasylnahuliak commented on June 10, 2024

Even though all my imports use < brackets > so far, it's OK to use "quotes"?

It's ok, because you use quotes in first line code #import "AppDelegate.h"

Should I try "pod clean" then install again? Anything like that?

You can try clean pods folder. Or better run npx react-native-clean-project https://github.com/pmadruga/react-native-clean-project

from react-native-braintree.

Seanmclem avatar Seanmclem commented on June 10, 2024

Thanks. Are there any downsides to cleaning? Like will it clear anything I might need that I can't undo?

from react-native-braintree.

vasylnahuliak avatar vasylnahuliak commented on June 10, 2024

Are there any downsides to cleaning?

I using this package when I catch strange bugs. This help me a lot.

Like will it clear anything I might need that I can't undo?

Please set this question in library issue https://github.com/pmadruga/react-native-clean-project/issues/new

from react-native-braintree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.