修复支付弹窗问题

This commit is contained in:
hch 2023-12-07 17:31:08 +08:00
parent 32d0fe497d
commit 48886374d5

View File

@ -17,6 +17,8 @@ import android.webkit.WebView;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import com.facebook.appevents.AppEventsConstants; import com.facebook.appevents.AppEventsConstants;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.utils.GoogleUtils; import com.yunbao.common.utils.GoogleUtils;
@ -40,6 +42,8 @@ public class GoogleFragment extends Fragment {
GoogleUtils googleUtils; GoogleUtils googleUtils;
boolean isGoogleService = true;
public GoogleFragment() { public GoogleFragment() {
} }
@ -59,6 +63,12 @@ public class GoogleFragment extends Fragment {
rlWebview = (WebView) view.findViewById(R.id.rlWebview); rlWebview = (WebView) view.findViewById(R.id.rlWebview);
Log.e("ttt", url); Log.e("ttt", url);
rlWebview.loadUrl(url); rlWebview.loadUrl(url);
// 验证是否已在此设备上安装并启用Google Play服务以及此设备上安装的旧版本是否为此客户端所需的版本
int code = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(getActivity());
if (code == ConnectionResult.SUCCESS) {
isGoogleService = true;
// 支持Google服务
initGooglePay(); initGooglePay();
new Thread() { new Thread() {
@Override @Override
@ -66,6 +76,7 @@ public class GoogleFragment extends Fragment {
adid = googleUtils.getAdid(); adid = googleUtils.getAdid();
} }
}.start(); }.start();
}
WebSettings webSettings = rlWebview.getSettings(); WebSettings webSettings = rlWebview.getSettings();
webSettings.setDomStorageEnabled(true); webSettings.setDomStorageEnabled(true);