0

I want to open a specific app page (which developed by using ionic 4) from the device browser button click. Can someone help with it?

1
  • Welcome to stack overflow. It would be useful when asking questions to detail what you have already tried to solve your challenge. Commented May 21, 2020 at 20:24

3 Answers 3

0

You can use ionic's InAppBrowser for that. Here is the link to the plugin https://ionicframework.com/docs/native/in-app-browser

If you want to open within the app, you just need to pass the following parameter while opening,


  constructor(
   ...
    private iab: InAppBrowser
  ) {}

openInAppBrowser(){
  this.iab.create(`url`, '_self', {
        location: 'no'
      });
}
Sign up to request clarification or add additional context in comments.

2 Comments

hi, no actually I want to open my app from the device browser
ah, then put "system" instead of "_self"
0
try this window.open(url, target, options);

ref: Reference to the InAppBrowser window. (InAppBrowser)

url: The URL to load (String). Call encodeURI() on this if the URL contains Unicode characters.

target: The target in which to load the URL, an optional parameter that defaults to _self. (String)

_self: Opens in the Cordova WebView if the URL is in the white list, otherwise it opens in the InAppBrowser. _blank: Opens in the InAppBrowser. _system: Opens in the system's web browser. options: Options for the InAppBrowser. Optional, defaulting to: location=yes. (String)

Comments

0

Just try this,

import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'

constructor(private router: Router, private iab: InAppBrowser) { }

openUrl(){

this.iab.create('http://google.com', '_self', {
  location:'no'
});

}

1 Comment

No, I want if a website includes a link when the user clicks on it (on a mobile device), I want to open my app through it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.