Skip to main content
1-Visitor
October 8, 2020
Solved

Problem with url on mobile device

  • October 8, 2020
  • 2 replies
  • 3202 views

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. 

Best answer by RolandRaytchev

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

2 replies

21-Topaz I
October 8, 2020

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.

1-Visitor
October 8, 2020

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

 

 

21-Topaz I
October 8, 2020

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

1-Visitor
October 8, 2020

It works. 

 

Thank you