updated chrome tab initial bind logic
This commit is contained in:
parent
828cc7d434
commit
7ec7a1756d
@ -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 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 "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 "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)
|
- Fixed "iOS about:blank popup not loading page" [#1500](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1500)
|
||||||
|
|
||||||
## 6.0.0-beta.25
|
## 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 final int CHROME_CUSTOM_TAB_REQUEST_CODE = 100;
|
||||||
protected boolean onOpened = false;
|
protected boolean onOpened = false;
|
||||||
protected boolean onCompletedInitialLoad = false;
|
protected boolean onCompletedInitialLoad = false;
|
||||||
|
protected boolean isBindSuccess = false;
|
||||||
@Nullable
|
@Nullable
|
||||||
public ChromeSafariBrowserManager manager;
|
public ChromeSafariBrowserManager manager;
|
||||||
@Nullable
|
@Nullable
|
||||||
@ -199,7 +200,8 @@ public class ChromeCustomTabsActivity extends Activity implements Disposable {
|
|||||||
|
|
||||||
public void customTabsConnected() {
|
public void customTabsConnected() {
|
||||||
customTabsSession = customTabActivityHelper.getSession();
|
customTabsSession = customTabActivityHelper.getSession();
|
||||||
if (initialUrl != null) {
|
// avoid webpage reopen if isBindSuccess is false: onServiceConnected->launchUrl
|
||||||
|
if (isBindSuccess && initialUrl != null) {
|
||||||
launchUrl(initialUrl, initialHeaders, initialReferrer, initialOtherLikelyURLs);
|
launchUrl(initialUrl, initialHeaders, initialReferrer, initialOtherLikelyURLs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -336,16 +338,11 @@ public class ChromeCustomTabsActivity extends Activity implements Disposable {
|
|||||||
@Override
|
@Override
|
||||||
protected void onStart() {
|
protected void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
boolean isBindSuccess = customTabActivityHelper.bindCustomTabsService(this);
|
isBindSuccess = customTabActivityHelper.bindCustomTabsService(this);
|
||||||
|
|
||||||
if (!isBindSuccess) {
|
if (!isBindSuccess && initialUrl != null) {
|
||||||
// chrome process not running, start tab directly
|
// chrome process not running, start tab directly
|
||||||
|
launchUrlWithSession(null, initialUrl, initialHeaders, initialReferrer, initialOtherLikelyURLs);
|
||||||
if (initialUrl != null) {
|
|
||||||
launchUrlWithSession(null, initialUrl, initialHeaders, initialReferrer, initialOtherLikelyURLs);
|
|
||||||
//avoid webpage reopen: onServiceConnected->launchUrl
|
|
||||||
initialUrl = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,6 +350,7 @@ public class ChromeCustomTabsActivity extends Activity implements Disposable {
|
|||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
customTabActivityHelper.unbindCustomTabsService(this);
|
customTabActivityHelper.unbindCustomTabsService(this);
|
||||||
|
isBindSuccess = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user