Skip to content

Commit

Permalink
The 'X' is not appearing in the modal (#74)
Browse files Browse the repository at this point in the history
* Fix classic modal issue
  • Loading branch information
hoyelo authored May 20, 2020
1 parent 2361a04 commit 6802788
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions AffirmSDK/AffirmPromoModalViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ - (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWe
{
NSURL *url = navigationAction.request.URL;
if (navigationAction.targetFrame == nil && [url.absoluteString rangeOfString:@"affirm.com/apps/prequal"].location != NSNotFound) {
NSString *fullURL = [url.absoluteString stringByAppendingString:@"&isSDK=true"];
NSString *fullURL = [url.absoluteString stringByAppendingString:[NSString stringWithFormat:@"&referring_url=%@", AFFIRM_PREQUAL_REFERRING_URL]];
[webView loadRequest:[[NSURLRequest alloc] initWithURL:[NSURL URLWithString:fullURL]]];
}
return nil;
Expand All @@ -64,7 +64,7 @@ - (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWe
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
{
NSString *urlString = navigationAction.request.URL.absoluteString;
if ([urlString isEqualToString:AFFIRM_CHECKOUT_CANCELLATION_URL]) {
if ([urlString isEqualToString:AFFIRM_PREQUAL_REFERRING_URL]) {
[self dismiss];
decisionHandler(WKNavigationActionPolicyCancel);
return;
Expand Down
2 changes: 1 addition & 1 deletion AffirmSDK/AffirmPromotionalButton.m
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ - (void)awakeFromNib

- (void)setup
{
self.showPrequal = YES;
self.clickable = NO;
[self configureWebView];
[self configureButton];
Expand Down Expand Up @@ -379,7 +380,6 @@ - (void)configureWithHtmlString:(NSString *)htmlString
{
[AffirmValidationUtils checkNotNil:amount name:@"amount"];
self.amount = amount.toIntegerCents;
self.showPrequal = YES;

BOOL hasRemoteCss = remoteCssURL != nil;
NSString *jsURL = [AffirmConfiguration sharedInstance].jsURL;
Expand Down
10 changes: 5 additions & 5 deletions Examples/Examples/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ - (void)configurPromotionalMessage
NSURL *cssURL = [[NSBundle mainBundle] URLForResource:@"css_promo_sample" withExtension:@"css"];

// Configure promotionalButton with html styling automatically
// [self.promotionalButton configureByHtmlStylingWithAmount:dollarPrice
// affirmLogoType:AffirmLogoTypeName
// affirmColor:AffirmColorTypeBlueBlack
// remoteFontURL:fontURL
// remoteCssURL:cssURL];
[self.promotionalButton configureByHtmlStylingWithAmount:dollarPrice
affirmLogoType:AffirmLogoTypeName
affirmColor:AffirmColorTypeBlueBlack
remoteFontURL:fontURL
remoteCssURL:cssURL];

[AffirmDataHandler getPromoMessageWithPromoID:nil
amount:dollarPrice
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,4 @@ All notable changes to this project will be documented in [changelog document](h
Package Size
==============
Final Binary Size: 0.6 MB
Final Binary Size: 0.67 MB

0 comments on commit 6802788

Please sign in to comment.