I am using in app browser in ionic . Its opening the url on the mobile browser instead of app - ionic-framework

I am using in app browser in ionic to implement my web in app.Its working fine but its opening the url on mobile browser instead of opening it on mobile app. I am using this in my .ts file
ngOnInit(){
this.iab.create('url','_self','location=no');
}

So adding _self: Opens in the Cordova WebView if the URL is in the white list, otherwise it opens in the InAppBrowser.
So you need to have _blank instead.
Following should work as expected.
this.iab.create('url','_blank','location=no');
More info can be found here

Related

Is there a way to use the mailto: or message: scheme in a PWA in iOS 12.2?

I've built a PWA using Ionic 4 that had a "Contact" Button with a simple href using the 'mailto:' scheme.
Contact
This used to open the native Mail app in iOS 12.1 when starting the PWA from homescreen. Since I updated to iOS 12.2 it just opens the PWA internal Safari with a message that Safari can't open links starting with 'mailto:'
I have tried using other URI schemes like 'instagram:' or 'message:' but they all lead to the same problem. The only one that I have found to still be functional when I start my PWA from homescreen is the 'tel:' scheme.
Has anyone else encountered this problem and has any idea how to still open URI schemes other than tel: from a PWA that has been opened from homescreen?
I managed to get it working using the below click function.
Tested on both Android and iOS PWA.
()=>{
window.location.href = "mailto:support#example.com?subject=" + emailSubject + "&body=" + emailBody
return
}
I have a PWA which is installed on iOS 12.2, my link uses target="_blank" and it works.
Did you try this ?
Have a nice day,

Redirect link in Ionic text field not opening in browser

I have an app containing multiple editable forms.
In all of them there is a URL field. I want this to open that URL in a browser window. Unfortunately at present it opens with my sites URL prepended before it.
ie If someone enters www.othersite.com and my site URL is www.mysite.com, clicking on the link will open www.mysite.com/www.othersite.com
How do I get the app to open www.othersite.com instead?
Try this way
Add Cordova Inappbrowser plugin and try
var ref = cordova.InAppBrowser.open('http://www.othersite.com', '_blank', 'location=yes');
or
window.open('www.othersite.com','_system','location=no');

Ionic 2 In App Browser - Keep user within app, currently all website links go to Safari

I am wrapping a web app I have built in an Ionic 2 application so the client can release on the app store(s).
I am using:
https://ionicframework.com/docs/native/in-app-browser/
Which correctly loads up my testing IP but any anchor tags open up in the normal Safari browser. How can I keep the user within the in app browser?
This is how I set up the browser:
const browser = this.iab.create('my.ip.add.ress');
browser.show();
I have tried changing the links on my website to use all of the following variations:
target="_blank"
target="_system"
target="_self"
But nothing works.

Opening browser and opening a particular website on ionic framework

Hi I would like to ask how will I be able to open a browser and going to a particular website by clicking an icon on a mobile application with ionic framework. For example I clicked the youtube icon on the Ionic framework app, it will open a browser and go to youtube.
User Inappbrowser plugin in your project to open external links.
Plugin Documentation .
General Steps:
add plugin using command ionic plugin add cordova-plugin-inappbrowser
Use this line where you want to open
link
var ref = cordova.InAppBrowser.open('http://youtube.com', '_blank', 'location=yes');

Not able to Close blackberry 7 browser from my code

Thanks! Hello everyone! I am making a BlackBerry 7 mobile native application. On click of button from my native application. It will be open a URL in a separate browser. So, I want to close the opened browser. The URL it is opening. This URL is separate domain, but this is my page, in this page i have tried following code. But, it is not working -
blackberry.app.exit();
window.close();
System.exit();
I have tried to open the URL in my native application using iframe. But, here always taking me splash screen instead of loading URL.
Are you using WebWorks or Cordova (nee PhoneGap) ? One solution is to use Cordova 2.9 (the last version to support BBOS) and the InAppBrowser API.