cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Problem with url on mobile device

leonardosella
12-Amethyst

Problem with url on mobile device

Hi everyone, 

I want to open a link to a page (that could be on the interenet or intranet). I'm testing the function with an internet link (es. https://www.google.com/) but there is some problem: in preview mode I'm able to open the link, in mobile device nothing happens. 

 

In 2D canvas I put a button that call this function:

 

$scope.openConfirmationPage=function(){
	let url= "https://www.google.com/"
	window.open(url)
}

 

 

Anyone has a solution?

 

Thank you. 

1 ACCEPTED SOLUTION

Accepted Solutions

Now tested on mobile:

- similar to your code - and it was working on both android and IOS - using the href property:

 

$scope.app.openConfirmationPage=function(){
	let url= "https://www.google.com/"
	window.open(url)
}

$scope.app.href = function () {
 
  try{
    $timeout( () => {var ref = window.location.href='http://getstatuscode.com/200';
                                        
                 twx.app.fn.addSnackbarMessage("window.location.href="+window.location.href,"twLogo");},500) 
  }
  catch(e)
  {
    alert('redir failed ' + e); 
  }
}

$scope.app.href1 = function () {
 
  try{
    $timeout( () => {var ref = window.location.href='https://www.google.com/';
                                        
                 twx.app.fn.addSnackbarMessage("window.location.href="+window.location.href,"twLogo");},500) 
  }
  catch(e)
  {
    alert('redir failed ' + e); 
  }
}

 

2020-10-08_11-23-02.jpg

so the test on IOS and Android couold open the google web side

2020-10-08_11-28-08.jpg

You can  try to test it on your devise by scanning of the QR code:

2020-10-08_11-28-08.jpg

View solution in original post

4 REPLIES 4

On HoloLens 2 this code is working fine - open a external window wher the google side is displayed - I mixed up, with the next question - on HoloLens 2 device, but will now check it on mobile -IOS.

Thank you, the develop is running on iOS device. No hololens for the moment. 

 

 

Now tested on mobile:

- similar to your code - and it was working on both android and IOS - using the href property:

 

$scope.app.openConfirmationPage=function(){
	let url= "https://www.google.com/"
	window.open(url)
}

$scope.app.href = function () {
 
  try{
    $timeout( () => {var ref = window.location.href='http://getstatuscode.com/200';
                                        
                 twx.app.fn.addSnackbarMessage("window.location.href="+window.location.href,"twLogo");},500) 
  }
  catch(e)
  {
    alert('redir failed ' + e); 
  }
}

$scope.app.href1 = function () {
 
  try{
    $timeout( () => {var ref = window.location.href='https://www.google.com/';
                                        
                 twx.app.fn.addSnackbarMessage("window.location.href="+window.location.href,"twLogo");},500) 
  }
  catch(e)
  {
    alert('redir failed ' + e); 
  }
}

 

2020-10-08_11-23-02.jpg

so the test on IOS and Android couold open the google web side

2020-10-08_11-28-08.jpg

You can  try to test it on your devise by scanning of the QR code:

2020-10-08_11-28-08.jpg

It works. 

 

Thank you

Top Tags