Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nothing happend #8

Open
juanmanuelarze opened this issue Jun 7, 2017 · 9 comments
Open

Nothing happend #8

juanmanuelarze opened this issue Jun 7, 2017 · 9 comments

Comments

@juanmanuelarze
Copy link

Hi guys.

When I call startCheckout nothing happened, no errors, no warnings, nothing, I'm develop with RN 0.43 in an iPhone 6s, the MP keys doesn't are wrong are the same I use on android :/

@JonatanSalas
Copy link
Contributor

JonatanSalas commented Jun 12, 2017

@juanmanuelarze would you mind to provide more details on the issue? (Some piece of code might help).

I've been with some issues setting up react-native-checkout-mercadopago, but now we've working it ok.

@juanmanuelarze
Copy link
Author

hi, here is my code

...
import {startCheckout} from 'react-native-checkout-mercadopago';
...
var payment = await startCheckout(res.client_key, res.preference.id)

is the same in android, but in ios mercadopago checkout modal never open, no errors, no nothing.

I dont understand this part of the instalation guide

"Navigate to the target configuration window by clicking on the blue project icon, and selecting the application target under the "Targets" heading in the sidebar."

xcode
xcode2

@juanmanuelarze
Copy link
Author

@JonatanSalas

@JonatanSalas
Copy link
Contributor

Do you have run already react-native link command?

What you've done it's ok. The steps we've done to make it work:

1 - Ensure the react-native project you're working on contains the latest config updates. If not run react-native upgrade. (But, be careful, if you already have a working project keep in mind that running react-native upgrade resets all your configuration files to add the new dependencies)
2 - Check to have the latest versions of react-native and react.
3 - Link the library with NativeModules through react-native link command.
4 - Add MercadoPagoSDK.xcodeproj to Libraries folder of your project
5 - In your project target description add MercadoPagoSDK to the embedded binaries section
6 - Import startCheckout in your react-native codebase and use it.
7 - Add credentials for startCheckout and then you're good to go!

Hope this helps!

@juanmanuelarze
Copy link
Author

Doesn't work :/

I have this warning from this module

/Users/myname/projects/myapp/node_modules/react-native-checkout-mercadopago/ios/:1:1: Umbrella header for module 'MercadoPagoSDK' does not include header 'MLSpinner.h'

@juanmanuelarze
Copy link
Author

juanmanuelarze commented Jun 14, 2017

2017-06-14 16:03:24.075904-0300 reactApp[352:58241] Warning: Attempt to present <UINavigationController: 0x102d74600> on <UIViewController: 0x1018146b0> which is already presenting <RCTModalHostViewController: 0x1019bd6e0>
@JonatanSalas

@juanmanuelarze
Copy link
Author

"react-native-checkout-mercadopago": "^0.4.0",

@juanmanuelarze
Copy link
Author

ok. I solve the problem, in checkoutMercadopagoModule.m add

#import "RCTUtils.h"

comment this

/*- (dispatch_queue_t)methodQueue
{
    return dispatch_get_main_queue();
}*/

//AppDelegate *share = (AppDelegate *)[UIApplication sharedApplication].delegate;
//UINavigationController *nav = (UINavigationController *) share.window.rootViewController;
//[nav presentViewController:checkoutFlow animated:YES completion:^{}];

and add this

UIViewController *presentingController = RCTPresentedViewController();
[presentingController presentViewController:checkoutFlow animated:YES completion:^{}];

@scarmuega
Copy link
Collaborator

scarmuega commented Jun 23, 2017

@juanmanuelarze care to send a PR? It would be much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants