iOS
The Scrimmage Rewards Widget can be integrated into your iOS application using a WKWebView.
-
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
tohttps://<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.
- Set
-
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
Updated about 1 month ago