iOS SDK FAQ

Affirm iOS SDK FAQ: Get answers to common integration questions, troubleshoot issues, and optimize your in-app checkout experience.

Overview

The Affirm iOS SDK enables seamless integration of Affirm’s checkout experience into your iOS app. This FAQ is designed to address common questions and troubleshooting scenarios for developers and product teams working with the SDK. Whether you're just getting started or looking to optimize your integration, you'll find helpful guidance, best practices, and solutions to common issues here.

FAQ

Q: How can I customize styling of the AffirmPromotionalButton?

Customizing AffirmPromotionalButton Styling

The AffirmPromotionalButton component is designed for encapsulation, but you have a couple of options for customizing its styling.

1. HTML Styling:

For custom content styling, you can configure the button using HTML. This allows you to apply your own styles by pointing to a CSS file.

[self.promotionalButton configureByHtmlStylingWithAmount:[NSDecimalNumber decimalNumberWithString:amountText]
                     affirmLogoType:AffirmLogoTypeName
                       affirmColor:AffirmColorTypeBlue
                      remoteFontURL:fontURL
                      remoteCssURL:cssURL];

The cssURL parameter can point to a local CSS file, giving you control over the HTML style.

2. Retrieving Raw String for Full Customization:

If you need a higher degree of customization for the content, you can retrieve the raw string of the promotional message. This method provides maximum flexibility, allowing you to display the content with any style you choose after obtaining the string.

[AffirmDataHandler getPromoMessageWithPromoID:nil
                    amount:dollarPrice
                   showCTA:YES
                   pageType:AffirmPageTypeBanner
                   logoType:AffirmLogoTypeName
                  colorType:AffirmColorTypeBlue
                     font:[UIFont boldSystemFontOfSize:15]
                  textColor:[UIColor grayColor]
           presentingViewController:self
              completionHandler:^(NSAttributedString *attributedString, UIViewController *viewController, NSError *error) {
                [self.promoButton setAttributedTitle:attributedString forState:UIControlStateNormal];
                self.promoViewController = viewController;
}];