Close method not working and showing ambiguous console warning
See original GitHub issueI am trying to implement OAuth with BrowserTab, I have successfully opened a BrowserTab with .openUrl()
and also implemented deeplinks and through that its successfully opens my app and my app continues to work, I am able to pass on the control to my app in Android , But in iOS deeplinks works fine but my app continues in background only BrowserTab remains on foreground and i am trying to close the BrowserTab through close() method it doesn’t work and says:
I am using chrome inspector
here is my code snippet:
public selectTracker(id) {
id = parseInt(id)
let url;
switch(id) {
case 1 : url = 'http://oauth1.com/';
break;
case 2 : url = 'http://oauth2.com/';
break;
}
this.browserTab.openUrl(url);
(window as any).browserTab = this.browserTab;
setTimeout(()=>{ // <--- I tried this as well
this.browserTab.close();
},1000);
}
Seems like there is problem with the BrowserTab API since console warning doesn’t make sense, I tried removing and installing the plugin again doesn’t work.
Also, how should I go about closing the BrowserTab if this isn’t the correct way.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
Getting an "ambiguous redirect" error - bash - Stack Overflow
Adding quotes around the variable seems to be a good way to deal with the "ambiguous redirect" message: You tend to get a...
Read more >Ambiguous reference between enums when using a service ...
I'm in the process of porting some old ASMX code over to WCF. Some of the methods have enumerated constants as return values...
Read more >"The method X is ambiguous for the type Y" Java ambiguous ...
Suppose we have a java program like below. Above program compiles perfectly and when we run it, it prints “String”.
Read more >Google Analytics Errors - Tag Assistant Help
The value for parameter 'X' in method 'X' should not be quoted ... that you add the Google Analytics tracking code onto this...
Read more >Auto Layout Guide: Ambiguous Layouts - Apple Developer
These ambiguities appear as warnings in the issues navigator, errors in the ... and then call one of the following methods from the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We had the same issue with OAuth with BrowserTab until we did a custom URL scheme which for some reason closes the tab when called.
So instead of:
window.close();
trymyapp://close
Note: replace “myapp” with the custom URL scheme of your own app. You set this up using a package such as “cordova-plugin-customurlscheme”.We’ve had instances where we have to call this twice to get it to close for some reason. The /close part of the custom URL has no known significance, but the “myapp://” part of the URL somehow triggers your app and closes the BrowserTab.
@ltlbsteed on our team actually found this solution in an article somewhere, and implemented it into our code. I figured I would post here for the benefit of anyone who is trying to solve this issue because it can use up a lot of time to solve. If the main thread of the program didn’t freeze while the BrowserTab is open, then it would be a non-issue because the main thread could close it, but for now this is the only work-around we’ve found.