Is it possible that iOS Safari keeps a page opened while reloading that very same page? - ios

I have a Node.Js app that uses Socket.IO for a chat-like feature.
It works fine on desktop, but what happens sometimes on an iPhone is that when a user loads the page, they'll load it again and the system thinks that there's two people viewing this page already.
I've experienced this kind of caching error before with other stuff in my app (like it would take a few reloads for the page to fetch the new data – something that never happens to desktop and something that has to do with caching also I think).
Did anybody encounter a similar problem and know a solution?
Maybe there's some kind of directive I can give in the meta tags of my app to tell IOS browsers treat it differently?
Thanks!

Related

Why does my ReactJS site crash Safari browsers?

My website "www.CarpeDiction.com" works fine when accessed from any browser other than Safari. When accessed through Safari, whether desktop or mobile, the homepage works alright, but upon making a query in the site's search box, the 'search' view page crashes the browser after a few seconds, and none of the Material UI 'accordion' components on the page display any results.
There are no errors in the console logs so I'm not sure what the issue is.
The source code can be found here: https://www.github.com/relativelyIntuitive/CarpeDiction
This does indeed crash Safari, but it is also a problem in Google Chrome and all browsers. If you open the site in Chrome and go to the developer tools and the network tab, watch what happens when you search. The app goes into an infinite loop endlessly calling your api. You should fix that because it could get expensive and/or crash your server.
The problem looks like it comes from the way you are using your useEffect functions, for example here:
https://github.com/relativelyIntuitive/CarpeDiction/blob/b213c8ed3d41fdf90172ec1e9f48ebda8fca6616/client/src/components/search/Comments.js
When you get the results back from the api you update the state with
setComments(resComments);
However, you also have comments as a dependency of the effect, which recalls the api every time you update comments, so it calls the function again and again and goes into an endless loop.
[query, comments]);
So you either need to remove that comments dependency, or add some logic to prevent the loop. Or use a library to help, such as react-async-hooks
https://github.com/slorber/react-async-hook

Can't view/change input field in iframe on phonegap app

So here's the situation. I am using a third party digital document signing service called PandaDoc in my mobile application which is built on PhoneGap/Cordova and I am not able to change any of the input, text-type fields when attempting to do this via the mobile app on an iPhone (haven't tested Android yet).
Here are some things i noted about this:
1) When viewed online in Chrome (on my laptop) or on my phone in the Chrome browser everything works fine.
2) The only form elements that aren't working on mobile are the input (type=text) ones. The checkboxes work, the dropdowns work etc...
3) I don't know much about Angular.js but i can tell this third party app was built on it. When i inspect and compare the mobile vs web version i noticed that on the mobile version the input fields have these two directives:
ng-pristine and ng-touched
From what i can tell researching these, they seem to be mutually exclusive so not sure how that would affect things. Also the web version had:
ng-dirty and ng-valid-parse
both of which the mobile version did not have.
I know it would be best if i could post some code here but i don't know where to start. In my app there is just a simple embed script that puts the PandaDoc into an iFrame.
If you want to see the mobile test version of this app you can view it at http://dev.velexo.com/m2 I have a test user with a username of "mobile2" and the password is "pass". Unfortunately there is no easy way to send out the iphone app version of this and that is where the problem is.
Oh also, when you log into the application, click on the W9 Information button and then the Enter Your W9 button, this is what brings up the pandadoc
Also should have mentioned I'm using JQuery Mobile in the app.
Any advice/guidance would be welcome even if it's just a guess.
just looking over my old questions here. The answer to the actual question I asked is that you can not change anything in an iFrame from the parent frame unless both the domain and the port match due to the cross-domain policy restraints.
There are no ways around this that I am aware of.
The solution to my particular problem was to get rid of PandaDoc entirely because it just wasn't designed to be used on a mobile device. In the end i wrote my own javascript for creating a signature and passing to the backend where i used a php pdf generating library to construct the final document.

iOS - How to integrate my application into a browser?

Since I'm not even sure where and how to start solving my issue I will appreciate every smallest push to the right direction.
So, I need to write an iOS application that would keep track on some events of any or at least some webkit-based browsers, or even integrate my app's "Open with..." item into a browser's context menu.
Is it at least possible?
P.S. yeap, since there's no way to use browser extensions in iOS, I'm trying to find workarounds without need to implement my own browser but rather tiny 3-rd side application working along with some of existing browsers.

Does Apple accept apps with an embedded browser using UIWebView?

Can you tell me if Apple accepts an application that opens an embedded browser with most of the functionality living on a web application on the internet?
I have read contradicting opinions on this, and I have even seen several apps that seem to use an embedded browser for the main functionality of the app. Still I couldn't confirm this.
This way we could correct problems on the application functionality on the server with no need to submit another version of the app, while keeping the ease of release through the app store and the home screen shortcut.
Thanks!
I can't get the exact quote from the guidelines, but I know that Cordova apps are allowed, and updating the web files dynamically without going through a new native app version is also allowed, as long as:
* The updated code runs with the Safari Webkit engine (true for Cordova)
* The main functionality of the app is not changed
You say this is a bad idea because the user can save a bookmark on their home screen. This doesn't seem to me like a reason for something being a bad idea to me. If this is the only drawback then I would say go ahead and do it. Why should I care if someone wants to bookmark to my site? The app will not work very well outside the app anyway. If you have an actual logical reason why this is a bad idea instead of some emotional response then please bring it up.
I am doing this too in my application. I am under the impression that as long as you are pointing to a secure site then it should be okay. Please enlighten me: is there some good reason why Apple forces people to develop applications the hard way? A web application is hard enough without having to deal with some monolithic organisation imposing ridiculous rules on you.

workaround for contenteditable on iPad

I have a web application that uses TinyMce to allow rich text editing. Some of my customers are desperate to get it to work on iPad (which doesn't support contenteditable and therefore TinyMce doesn't work)
At the moment the only choices I have are:
Disallow rich text editing when i detect the browser is iPad. This is not much of a solution because my app relies heavily on rich text editing
Wait for iPad to support contentEditable
Write my own iPad app. This isn't really workable because it's a big complex app with loads of HTML and javascript and I would have to rewrite it all
Use another browser. As far as I know none of the other browsers support contenteditable either.
I'm really keen to find some workable solution. is there such thing as a rich text editor that doesn't require contenteditable? or does anyone have a clever idea I hadn't thought of?
Thanks in advance
Andy
As of June 2011, it looks like there may be support coming in iOS 5
http://www.tuaw.com/2011/06/08/will-ios-5s-safari-deliver-better-support-for-web-editors/
this observation (that it's working in the beta) has been confirmed by a colleague of mine too.
Write my own iPad app. This isn't
really workable because it's a big
complex app with loads of HTML and
javascript and I would have to rewrite
it all
Not necessarily true. You can embed the working part of your web app in a UIWebView component, which is basically Safari embedded in your app, and handle the not working part in the app (providing content). It would require work for sure, but maybe a lot less than rewriting the whole app for iPad.
At to this point there are no browsers on the ipad that will allow RTE. Actually there is only one phone giving full browser support for RTE (sry, i forgot the name of the phone).
Therefor, i think you almost showed all possible solutions (jv42's suggestion excluded) yourselve.

Resources