Android 条带签出在WebView上不起作用
我正在尝试在WebView中使用(在Android和iOS中)。 如果我从移动设备的Android 条带签出在WebView上不起作用,android,ios,webview,stripe-payments,Android,Ios,Webview,Stripe Payments,我正在尝试在WebView中使用(在Android和iOS中)。 如果我从移动设备的googlechrome运行演示签出,它会打开一个新网页,一切正常 当我尝试从WebView运行演示时(我希望它的行为完全类似),它不起作用,给了我一个 Sorry, there was a problem loading Checkout. If this persists, please try a different browser. 我原以为它不是为手机设计的,但事实并非如此,因为谷歌Chrome的工作
googlechrome
运行演示签出,它会打开一个新网页,一切正常
当我尝试从WebView运行演示时(我希望它的行为完全类似),它不起作用,给了我一个
Sorry, there was a problem loading Checkout.
If this persists, please try a different browser.
我原以为它不是为手机设计的,但事实并非如此,因为谷歌Chrome的工作原理非常好。
有什么建议可以让它工作吗?这是我在WebView上使用的唯一方法(我使用了Xamarin):
using System;
using Xamarin.Forms;
using Plugin.Share;
using Plugin.Share.Abstractions;
namespace stripewebviewtest
{
public class App : Application
{
public App ()
{
Button btn = new Button ();
btn.Text = "Click on me!";
// The root page of your application
MainPage = new ContentPage {
Content = new StackLayout {
VerticalOptions = LayoutOptions.Center,
Children = {
new Label {
XAlign = TextAlignment.Center,
Text = "Welcome to Xamarin Forms!"
},
btn
}
}
};
btn.Clicked += (object sender, EventArgs e) => {
var url = "https://stripe.com/docs/checkout";
CrossShare.Current.OpenBrowser (url, new BrowserOptions {
ChromeShowTitle = true,
ChromeToolbarColor = new ShareColor {
A = 255,
R = 118,
G = 53,
B = 235
},
UseSafairReaderMode = false,
UseSafariWebViewController = false
});
};
}
protected override void OnStart ()
{
// Handle when your app starts
}
protected override void OnSleep ()
{
// Handle when your app sleeps
}
protected override void OnResume ()
{
// Handle when your app resumes
}
}
}
↝ 条带签出根本不支持Web视图。你需要使用Stripe.js来构建自己的支付表单:我不完全理解这个选择,为什么像Google Chrome这样的移动网络浏览器支持它,而在简单的网络视图上不支持它?相同的屏幕,相同的高度,相同的宽度…因为WebView是他们自己的浏览器实现,它不完全是Chrome或Firefox等。所以Stripe根本不支持用于签出的WebView。你应该建立自己的支付表单。