diff --git a/Conekta/Conekta.h b/Conekta/Conekta.h index fadcca4..2cf49c4 100644 --- a/Conekta/Conekta.h +++ b/Conekta/Conekta.h @@ -13,12 +13,14 @@ #import #import "Token.h" #import "Card.h" +#import @interface Conekta : NSObject @property (nonatomic, retain) NSString *baseURI; @property (nonatomic, retain) NSString *publicKey; @property (nonatomic, retain) UIViewController *delegate; +@property (strong, nonatomic) WKWebView *webView; - (NSString *) deviceFingerprint; - (void) collectDevice; diff --git a/Conekta/Conekta.m b/Conekta/Conekta.m index 35ff2c7..60151d4 100644 --- a/Conekta/Conekta.m +++ b/Conekta/Conekta.m @@ -25,10 +25,12 @@ - (NSString *) deviceFingerprint - (void) collectDevice { NSString *html = [NSString stringWithFormat:@"", [self publicKey], [self deviceFingerprint]]; - UIWebView *web = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)]; - [web loadHTMLString:html baseURL:nil]; - [web setScalesPageToFit:YES]; - [self.delegate.view addSubview:web]; + WKWebViewConfiguration *theConfiguration = [[WKWebViewConfiguration alloc] init]; + WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 0, 0) configuration:theConfiguration]; + NSURL *nsurl=[NSURL URLWithString:html]; + NSURLRequest *nsrequest=[NSURLRequest requestWithURL:nsurl]; + [webView loadRequest:nsrequest]; + [self.delegate.view addSubview:webView]; } - (id) populate: (id) class