Mobile browser crashes when loading page - ios

Recently we found problems that sometimes our webpage crashes on iOS. Its happening both in Chrome and Safari. Has anyone idea how to debug it, or why its happens ?
Its hard to reproduce (actually on some phone we were not able to). So we are trying turning off some components from the page. The page contains lot of HTML (20-100 pages) and some bit heavy javascript components, such as maps, street view or even graphs.
Thanks for any idea or hint. Thanks!

You can debug the webpage, when it is loading on your mobile browser(Safari).
Follow the below steps:
Connect your iOS device to MAC--> open Safari on MAC --> In the menu bar you can see Develop option --> On selecting the develop option it will show all the connected devices--> keep the menu popup open and browse your webpage on the connected iOS device.
Note : If your device doesn't show up in the develop option please enable it in iOS device settings --> Safari --> advanced --> Web Inspector.

Related

Simulate "IOS add to home screen" on desktop google chrome for debug

Is there any way to simulate the “IOS add to home screen” function in windows with Google Chrome for debugging ?
I want to debug PWAs (progressive web applications) with a browser like Google Chrome.
For example at this link or this link , this two site have a PWA and need to be added to home screen to be shown or debugging.
The only way I can think of so you can do that is if you have a Mac with the XCode iPhone simulator.
Not all PWAs (progressive web applications) are the same, for the second link you can simply use “toggle visibility” option on inspect element sources and use the app, but I doubt you can do that for the first one.

Diawi- Only possible from safari

I am getting an error on one of device that "Only possible from Safari" while i am opening the diawi generated link in safari. i have 12 devices registered in my developer account. Diawi generated link is working fine in 11 out of 12 devices.I have cross checked UDID, povisioning profile, build everything that is possible to resolve this issue. Enclosing a screenshot-
Image Link
If you're using IOS 13+, tap the 'aA' button on the left of the address bar and select request mobile website option.
If not please check following things,
Open Settings
Navigate to Safari > Advanced
Enable Web Inspector
Enable JavaScript
Switch back to Safari and load a web page
You need to run the page in mobile mode.
for iOS 13+, Tap the AA (left-hand side of Diawi address) and Request to Mobile Website.
You might be getting this error due to Javascript being disabled in Safari.
Navigate to Settings > Safari > Advanced
If Javascript is disabled , Enable that and reload the link in Safari.
else try disabling and enabling javascript.

Universal links (Deep linking) not working on iPhone but works on iPad

I am trying to build deep linking feature into my app. I did all the necessary set up for deep linking to work like, enabling associated domains in my app, adding apple-app-site-association to the root directory of my server, and I am serving a valid apple-app-site-association over https, I also validated my apple-app-site-association using this tool Validate your apple-app-site-association.
After doing everything right, I tested the deep linking feature on my iPad and it worked as expected. But when I tried to do the same on my iPhone it doesn't work, it always took me to safari. I tried it on 6s device, I reinstalled the app, I cleared Safari website data & cleared the history. Also updated the iPhone & iPad to iOS 9.3.5. The updating the OS didn't change a thing.
iPad still continue to work with deeplink URLs just like it did while it was on 9.3.4. iPhone still opened the link in safari.
Please give me some pointers on how to workaround this issue, I think this might be an apple bug but again I don't understand how it can work on iPad which is running same software as iPhone. Any help or guidelines is much appreciated.
Thanks.
I was able to fix this issue and this is one of the annoying issue that I have come across, because it doesn't say what is going wrong.
Fix: Whenever the iOS opens your link in safari, you need to pull down the webpage in safari and there you'll see a banner saying that, open it in the app. Once you click on that banner your future links will start opening the app instead of opening it in the safari browser.
There was no error whatsoever and there was no indication why the link was getting opened I am pretty sure that, iOS didn't download the apple-app-site-association whenever I installed the app.
Also note that the banner in the webpage will not be visible whenever your link opens up in safari, you need to pull down the webpage and then the banner will become visible and if you click on open in app banner, it will start opening the links in app.
If in future if you select to view the link in safari by clicking on context menu which appears on right hand side of the status bar, which will be saying "Open in [your app name]" in safari, the links in future will open in safari instead of app, and again if the banner open in app isn't visible, you have to pull down the webpage to see that banner.
HTH.
In iOS 13, similar problem of direct links not opening the app instead it open the safari website directly.
Fixed by updated the below safari setting...
Settings > Safari > Request Desktop Website > All websites > Switch Off
I was facing the same issue in iOS 12, on one device the link redirected to my app and on another device it was always redirecting to Safari and pressing the link on the Notes app was only allowing me to open it on Safari.
What I believe happened was that I pasted the URL in the browser and clicked Go, as I thought it would redirect to my app. No matter what I did ( reinstalling the app, restarting the device, ... ) the results were always the same, redirecting to Safari.
What helped me was deleting the cached data for my domain ( Settings -> Safari -> Advanced -> Website Data -> Swipe and delete the data for your domain ).
After that, everything started working.
I believe this is a bug with iOS Simulator,
In my case it was occurred when I entered an invalid address (with multiple spaces) for example:
Valid One: myApp://order/10003101
Invalid One: myApp://order/1003131
It stopped working even with Valid One and the solution was to clear Safari Website Data:
Go to Settings/Safari -> Clear History and Webstie Data
Device: iPhone 12 Pro Max
iOS: 14.5
Xcode: 12.5

IOS Web App open links within web app

I am in the mist of creating a mobile web app and have both meta tags
I have an iphone 5 on 7.0.4
When I click on a regular link like the one below it, opens up a mobile safari window and leaves the webapp. I also tried setting the target to _self and same behavior.
Sign in
I then used my ipad which was on 7.0.3 and it worked as should, not opening mobile safari on links. I think proceeded to update my ipad to 7.0.4 and the same issue as I had on my ipad.
Anyone ran into this issue and or knows a fix ?
Thanks
Since iOS 7.0.4 all links in WebApps open in Safari. As a workaround you can use Javascript:
window.location.href='text.html'
But remember that these steps will not be captured in history (so there is no ability to use Javascript like history.back() ..).
Alternatively, if you are using a menu in your web app, try to combine iframe and Javascript, you can change the content of your iframe with this Javascipt:
document.getElementById("frame").src = new_content.html
This will prevent your WebApp to open up links in Safari and stay in WebApp view.

Create iOS Home Screen Shortcuts on Chrome for iOS

I have a web app that allows the user to add the web page to his home screen on the iphone.
That functionality exists with Safari.
Now they released the chrome browser for the iphone too. My question is how can I instruct the user to add the web page to his ios home screen. The chrome browser doesnt seem to have that functionality..?
Can I add a shortcut from chrome options so that it would appear on the iphone home page?
For completeness:
https://developer.chrome.com/multidevice/android/installtohomescreen
Does Add to homescreen work on Chrome for iOS?
No.
Can't change the default browser, but try this (found online a while ago). Add a bookmark in Safari called "Open in Chrome" with the following.
javascript:location.href=%22googlechrome%22+location.href.substring(4);
Will open the current page in Chrome. Not as convenient, but maybe someone will find it useful.
Source
Works for me.
The is no API for adding a shortcut to the home screen in iOS, so no third-party browser is capable of providing that functionality.

Resources