[ad_1]
I’ve an in-house iOS app that on launch will test a JSON file to see if there’s a new model to obtain and whether it is required or elective.
Nonetheless, it appears the app is utilizing a cached model of that file to test so it is going to by no means see updates. I understand how to trick it into by no means getting a cached model: sooner or later I will probably be passing in a timestamp as a parameter to the JSON URL. Nonetheless, till they get that replace I’ll have this subject. And I would like them to have the ability to get this replace with out having them re-download the app.
Is there any method to clear the cached model from the iPhone and make it possible for the app is just not utilizing it? On the server I’ve already disabled consumer cache by way of internet.config for the folder the JSON file is in and that did not resolve the problem.
Right here is the code I take advantage of to test for the updates:
protected async override void OnAppearing()
{
var CurrentVersion = new Model(DependencyService.Get<IScreen>().Model);
HelperFile myHelper = new HelperFile();
//var web page = new ContentPage();
//App.Present.MainPage = web page;
//Cross Info to Webservice
Uri jsonUrl1 = new Uri(string.Format("https://web site.com/mobileapp/VersionNo.json"));
var end result = await myHelper.GetResponseString(jsonUrl1);
JObject rss = JObject.Parse(end result);
var RecentVersion = new Model((string)rss["version"]);
var MinimumVersion = new Model((string)rss["minimum"]);
string ChangeLog = (string)rss["changelog"];
string ShowChangeLog = (string)rss["showchangelog"];
var isRequired = CurrentVersion.CompareTo(MinimumVersion);
var isOptional = CurrentVersion.CompareTo(RecentVersion);
if (isRequired < 0)
{
//go to pressured replace web page
var updatePopup = new UpdatePopup(false, RecentVersion, MinimumVersion, ChangeLog, ShowChangeLog);
await Navigation.PushPopupAsync(updatePopup);
}
else if (isOptional < 0)
{
//go to elective replace web page
var updatePopup = new UpdatePopup(true, RecentVersion, MinimumVersion, ChangeLog, ShowChangeLog);
await Navigation.PushPopupAsync(updatePopup);
}
else
{
App.Present.MainPage = new NavigationPage(new CheckUpdatedInformation());
}
}
[ad_2]
