iOS version update: Tune interface
Three states returned in the background 1. Force Update 2. No update required 3. The user chooses whether to update
-(void) requesttocheckversion
{
Elifenetrequestdata *req = [[Elifenetrequestdata alloc] init];
[Req setstring:mfappversionshort forkey:@ "Versionno"];
[Req setstring:@ "iphone" forkey:@ "Osname"];
[[Elifenetapiclient sharedclient] requestpostwithtype:eliferequest_getversion args: [req todictionary]
success:^ (id responseobject) {
int forceupgrade = [[Responseobject objectforkey:@ "Forceupgrade"] intvalue];
Self.updateurl = [Responseobject objectforkey:@ "Upgradeurl"];
if (Forceupgrade = = 1) {
Force update
[[UIApplication sharedapplication] Openurl:[nsurl URLWithString:self.updateUrl]];
return;
}else if (Forceupgrade = = 2) {
No update required
Return
}else if (Forceupgrade = = 3) {
User chooses whether to update alert
Uialertview *alert = [[Uialertview alloc] initwithtitle:@ "" message:@ "have a new version, do you want to update now? "Delegate:self cancelbuttontitle:@" Cancel "otherbuttontitles:@" OK ", nil];
Alert.tag = 1012;
[Alert show];
}
} failure:^ (Nserror *error) {
}];
}
Iosapp version Update