📍 Bolt / Developers / Developer Guides / Checkout Setup / Mobile Checkout Setup / Set Up SSO Commerce on a Mobile App

Set Up SSO Commerce on a Mobile App

Developers can add Bolt Checkout’s SSO Commerce experience to their mobile apps via either a SFSafariViewController or WKWebView object.

How to Add Bolt Checkout to a Mobile App

  1. Open your app files.
  2. Create a SFSafariViewContoller or WKWebview using the following URL:
    • https://account.bolt.com/hosted.html?publishable_key={{your-publishable-key}}”
  3. Replace {{your-publishable-key}} with your corresponding key, found in the Bolt Merchant Dashboard.
  4. Create a handler for yourMobileAppDomain://boltoauth?authorization_code=XXX. Bolt’s SSO Commerce functionality contacts this URI with an authorization code when a shopper attempts to log in.
  5. Send the authorization code to your store server (/oauth/token) to exchange the authorization code for an access token.

Tips to Ensure Seamless User Sessions

In order to keep the same Bolt session across login and checkout, ensure you do all of the following:

  1. Use the same instance of WKProcessPool in all your WKWebViews.
  2. Create a WKWebViewConfiguration for each WKWebView you instantiate. Update the processPool property to your WKProcessPool instance.
  3. Add any cookies to webView.configuration.websiteDataStore.httpCookieStore.
  4. Load the URL into your WKWebView.
👎

How did we do?

📖On This Page