Skip to content

Instantly share code, notes, and snippets.

@slicksammy
Created March 14, 2025 19:41
Show Gist options
  • Select an option

  • Save slicksammy/0ca3b1d9668a67b623a23fee809c6700 to your computer and use it in GitHub Desktop.

Select an option

Save slicksammy/0ca3b1d9668a67b623a23fee809c6700 to your computer and use it in GitHub Desktop.
how to create native view
// somehwere you make a request and get back data (which is a checkout)
setCheckoutUrl(`https://wallet.paywithsoap.com/?clientSecret=${data.client_secret}`);
return (
<SafeAreaView style={backgroundStyle}>
<View style={styles.webViewHeader}>
<TouchableOpacity onPress={closeWebView} style={styles.closeButton}>
<Text style={styles.closeButtonText}>✕</Text>
</TouchableOpacity>
<Text style={styles.webViewTitle}>Checkout</Text>
</View>
<WebView
source={{uri: checkoutUrl}}
originWhitelist={['*']}
javaScriptEnabled={true}
domStorageEnabled={true}
startInLoadingState={true}
allowsInlineMediaPlayback={true}
scalesPageToFit={true}
/>
</SafeAreaView>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment