Refreshing the webview in iPhone app - iphone

In the home page of my iphone application i am calling a web page, users can do some actions(comment,like etc) from other tabs of my app-After that,when the come back to home page the web page must be refreshed(eg:- comment/like count must be incresed)
If user do the refreshing of home page(scroll up from top) the page is getting refreshed,but the client wanted to refresh it automatically
So i have loaded the web page in viewDidAppear method,
Now problem is-whenever user come back to home page it gets refreshed and showing from the top(if user go to detail from some link at bottom and come back,webpage shows the top)
how to prevent this,or is there any better idea for automatic refreshing ?

Perhaps a better way would be to use javascript to download the updates in the background, then update your content appropriately. UIWebView has a method –stringByEvaluatingJavaScriptFromString: which can be used to run javascript code. You could supply the method call to perform the refresh in your -viewDidLoad method.
Another option could be to download the HTML in the background, and compare it too what is displayed, if different, swap. That way content is only refreshed when needed. Although that still gives you the problem of content moving to the top.

Related

Full page view - Issues with Auto-fill code - Flutter

In my flutter app, I'm implementing a full page view using -
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
Now, It works just fine until I reach a page in the app that uses PinCodeTextField. In that page, a user can input the received OTP.
Now, the issue is that as soon as the page is opened, "Auto-fill code from Messages" appears and it brings back the notification bar as well as the bottom menu bar.
I have not implemented this feature and looks like somehow It has come on its own. Though, it is a nice feature to have, I really don't want it to mess up my app's full page view. Not until I restart the app, it goes back to full page view but again whenever I reach to a page with PinCodeTextField, that popup appears and messes things up.
Now, how do I force my app to go back to full page view ? If that is not possible, how do I stop Auto-fill code to keep coming on my screen on such pages ?? Kindly help.

The route.first page (MyHomePage) is updating even without a callback, function or notification listener

I can't really share code for this as it's for my entire ~large~ application, but is it normal for a flutter application's lower navigation stack to be updated when the current page is?
For example, in this page I have a standard form with a few TextFormFields:
Whenever I click on one to start typing the page sets state as expected, but by adding print("Update"); inside the build function of the bottom page of the navigation stack, I can see that page is being updated too. It happens on all pages I put on top of the first route page. I've also been experiencing that the home page gets slower as the app has been open for longer, could this be a cause for that problem too?

popAndReplacement shows page which is behind the poping page in Flutter

There are 3 screens in my app. When I use popAndPushNamed() in the 2nd page, it pops the 2nd page and shows the 3rd page, but when It pops it shows the 1st page behind it in milliseconds. how to avoid that?
is Animation the way?
or are there any other methods just like push and show 3rd page, and pop 2nd page when the 3rd page visible to the user?
popAndPushNamed() as the documentation suggests, pushes the new route but pops the old route simultaneously, and hence, there is a small moment where you can see the first page even if your new routes are fully opaque. Replace the method with Navigator.of(context).pushReplacementNamed() and it should work as expected.

Ionic either doesn't show back button or page doesn't load at all

I am trying to create a new page from an existing page with a back button. I have recreated the issue here in a plunkr. In the trip analytics option When I click the first card i.e. Enter Home address. I want the todayDetail .html page to come up with a back button. I have already tried two approaches
First approach The ng-click approach. In which I give $state.go(statename) to give that page. But then I wouldn't get a back button as the navigation stack is changed.
Second approach - If I keep the navigation stack i.e. keep the state name as initial.trips.today.todayDetail. The page doesn't load at all.
What is the issue? How should I go about it?

iphone: "preload" a view (tab bar controller)

Basically my app loads two RSS feeds - a blog feed and a twitter stream. These are in two different views in a tab bar controller. There is also a Home view which is the default view when the application launches.
Ok, so basically when you go from the Home tab to the blog or twitter tab then it takes a while to load. Fair enough, its trying to download everything off the internet.
My question is, while the user is on the home page is there any way of "preloading" the other views so that the viewDidAppear function is already run?
Or, maybe a way of having a "loading" screen, because at the moment it seems like the application has just crashed when you click on a tab, the tab doesn't even highlight until it has loaded the view.
Thanks a lot guys.
IMO it's not a good idea to preload the views themselves. But it might make sense to preload the data from the home screen (at least when you're connected to WiFi). To do that, decouple the loading code from the view, e.g. by moving it to a separate model class.
In general, you should implement all your network connections asynchronously to avoid freezing the UI during these operations.