The Scrimmage Rewards Widget can be integrated into your iOS application using a WKWebView.

  1. Add the following:

    import WebKit
    
    struct ScrimmageRewardsView: UIViewRepresentable {
        let url: URL
        let token: String
    
        func makeUIView(context: Context) -> WKWebView {
            let webView = WKWebView()
            webView.load(URLRequest(url: url.appendingPathComponent("?token=\(token)")))
            return webView
        }
    
        func updateUIView(_ uiView: WKWebView, context: Context) {}
    }
    
    • Set url to https://<your org id>.apps.scrimmage.co.
    • Set token as the user token. Check out the Getting Started page for more information.
    • All configuration options can be found here.
  2. Make sure to add the following permissions to your Info.plist file:

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
    

Example

See the scrimmage-rewards-ios