Merge branch 'YumengNevix-master'
This commit is contained in:
commit
341508519c
|
@ -7,6 +7,7 @@
|
|||
- Merged "fix cert parsing for ios 12" [#1822](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1822) (thanks to [darkang3lz92](https://github.com/darkang3lz92))
|
||||
- Merged "Fix iOS and macOS Forced unwrap null value HTTPCookie for CookieManager.setCookie" [#1677](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1677) (thanks to [maxmitz](https://github.com/maxmitz))
|
||||
- Merged "android imm.isAcceptingText() crash fix" [#1827](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1827) (thanks to [AlexDochioiu](https://github.com/AlexDochioiu))
|
||||
- Merged "fix: chrome tab open failed due to chrome process not running" [#1772](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1772) (thanks to [YumengNevix](https://github.com/YumengNevix))
|
||||
- Fixed "iOS about:blank popup not loading page" [#1500](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1500)
|
||||
|
||||
## 6.0.0-beta.25
|
||||
|
|
|
@ -48,6 +48,7 @@ public class ChromeCustomTabsActivity extends Activity implements Disposable {
|
|||
protected final int CHROME_CUSTOM_TAB_REQUEST_CODE = 100;
|
||||
protected boolean onOpened = false;
|
||||
protected boolean onCompletedInitialLoad = false;
|
||||
protected boolean isBindSuccess = false;
|
||||
@Nullable
|
||||
public ChromeSafariBrowserManager manager;
|
||||
@Nullable
|
||||
|
@ -165,8 +166,16 @@ public class ChromeCustomTabsActivity extends Activity implements Disposable {
|
|||
@Nullable Map<String, String> headers,
|
||||
@Nullable String referrer,
|
||||
@Nullable List<String> otherLikelyURLs) {
|
||||
launchUrlWithSession(customTabsSession, url, headers, referrer, otherLikelyURLs);
|
||||
}
|
||||
|
||||
public void launchUrlWithSession(@Nullable CustomTabsSession session,
|
||||
@NonNull String url,
|
||||
@Nullable Map<String, String> headers,
|
||||
@Nullable String referrer,
|
||||
@Nullable List<String> otherLikelyURLs) {
|
||||
mayLaunchUrl(url, otherLikelyURLs);
|
||||
builder = new CustomTabsIntent.Builder(customTabsSession);
|
||||
builder = new CustomTabsIntent.Builder(session);
|
||||
prepareCustomTabs();
|
||||
|
||||
CustomTabsIntent customTabsIntent = builder.build();
|
||||
|
@ -191,7 +200,8 @@ public class ChromeCustomTabsActivity extends Activity implements Disposable {
|
|||
|
||||
public void customTabsConnected() {
|
||||
customTabsSession = customTabActivityHelper.getSession();
|
||||
if (initialUrl != null) {
|
||||
// avoid webpage reopen if isBindSuccess is false: onServiceConnected->launchUrl
|
||||
if (isBindSuccess && initialUrl != null) {
|
||||
launchUrl(initialUrl, initialHeaders, initialReferrer, initialOtherLikelyURLs);
|
||||
}
|
||||
}
|
||||
|
@ -328,13 +338,19 @@ public class ChromeCustomTabsActivity extends Activity implements Disposable {
|
|||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
customTabActivityHelper.bindCustomTabsService(this);
|
||||
isBindSuccess = customTabActivityHelper.bindCustomTabsService(this);
|
||||
|
||||
if (!isBindSuccess && initialUrl != null) {
|
||||
// chrome process not running, start tab directly
|
||||
launchUrlWithSession(null, initialUrl, initialHeaders, initialReferrer, initialOtherLikelyURLs);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
customTabActivityHelper.unbindCustomTabsService(this);
|
||||
isBindSuccess = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -122,14 +122,14 @@ public class CustomTabActivityHelper implements ServiceConnectionCallback {
|
|||
* Binds the Activity to the Custom Tabs Service.
|
||||
* @param activity the activity to be binded to the service.
|
||||
*/
|
||||
public void bindCustomTabsService(Activity activity) {
|
||||
if (mClient != null) return;
|
||||
public boolean bindCustomTabsService(Activity activity) {
|
||||
if (mClient != null) return true;
|
||||
|
||||
String packageName = CustomTabsHelper.getPackageNameToUse(activity);
|
||||
if (packageName == null) return;
|
||||
if (packageName == null) return false;
|
||||
|
||||
mConnection = new ServiceConnection(this);
|
||||
CustomTabsClient.bindCustomTabsService(activity, packageName, mConnection);
|
||||
return CustomTabsClient.bindCustomTabsService(activity, packageName, mConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue