Comments (9)
If you are using Braintree v5 use the following line
[BTAppContextSwitcher setReturnURLScheme:self.paymentsURLScheme];
from react-native-braintree.
@Seanmclem Can you provide code from AppDelegate.m
For example https://github.com/ekreative/react-native-braintree#ios-specific
from react-native-braintree.
@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 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.
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.
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.
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.
Thanks. Are there any downsides to cleaning? Like will it clear anything I might need that I can't undo?
from react-native-braintree.
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)
- Add video and screenshots example HOT 1
- Add "all contributors" HOT 4
- Set up CI/CD for deploying on npm HOT 3
- Try to use the new getDeviceData method in other methods HOT 1
- Check if we can split the logic in the getDeviceData method to call new DataCollector(mBraintreeClient).collectDeviceData() only once HOT 1
- Add eslint HOT 1
- Add prettier HOT 1
- Add Native SDK versions in README HOT 6
- Add unit testing for JS files HOT 2
- Investigate rewrite Android part using Kotlin HOT 6
- Investigate rewrite iOS part using Swift HOT 5
- Add ISSUE_TEMPLATE.md HOT 3
- Add PULL_REQUEST_TEMPLATE HOT 6
- Set up CI/CD for eslint and prettier HOT 1
- Investigate using React Native New Architecture HOT 1
- Add links in README HOT 4
- Upgrade NodeJS version HOT 1
- Write unit testing on Android (Java) HOT 1
- Add Cache to CI/CD HOT 2
- Add branch name linter HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-braintree.