Check the update page
-(void) renew{
Nsdictionary *infodic = [[NSBundle mainbundle]infodictionary];
NSString *version = [infodic valueforkey:@ "cfbundleshortversionstring"];
NSString *ipstr = [NSObject deviceipadress];
NSString *PARAMIP = ipstr;
Nstimeinterval time = [[NSDate date]timeintervalsince1970];
Long i = time;
NSString *paramtime = [NSString stringwithformat:@ "%ld", I];
NSString *signstr = [NSString stringwithformat:@ "%@%@%@%@", paramtime,paramip,@ "Phone_ios", @ " d556bd3337cd909b49eb5e33f46ad65c "];
NSString *md5str = [Signstr Md5hash];
NSString *mdstr = [Md5str lowercasestring];
NSString *sign = mdstr;
NSString *key = @ "Phone_ios";
Nsdictionary *param = @{
@ "type": @2,
@ "Version": Version
};
Nsdictionary *dict = @{
@ "Paramtime": Paramtime,
@ "PARAMIP": PARAMIP,
@ ' sign ': sign,
@ "key": Key,
@ "param":p Aram
};
Afhttprequestoperationmanager *manager = [Afhttprequestoperationmanager manager];
Manager.requestserializer = [Afjsonrequestserializer serializer];
Manager.responseserializer = [Afjsonresponseserializer serializer];
Manager.responseSerializer.acceptableContentTypes = [Nsset setwithobject:@ "Application/json"];
[Manager Post:renewurl Parameters:dict success:^ (afhttprequestoperation *operation, id responseobject) {
Nsdictionary *resultdic = responseobject[@ "Result"];
_upgradeurl = resultdic[@ "Upgradeurl"];
_force = resultdic[@ "Isforce"];
NSLog (@ "_force--------%@", _force);
NSLog (@ "%@", resultdic);
if ([resultdic[@ "Isforce"]compare:@0]!=nsorderedsame) {
Uialertview *isforceview = [[Uialertview alloc]initwithtitle:@ "Special hints" message:@ "discover new version" Delegate:self CancelButtonTitle : @ "Cancel" otherbuttontitles:@ "Download", nil];
[Isforceview show];
}else if ([resultdic[@ "version"]compare:version]! = nsorderedsame) {
Uialertview *resultview = [[Uialertview alloc]initwithtitle:@ ' hint ' message:@ ' discover new version ' Delegate:self cancelButtonTitle:@ ' Cancel "otherbuttontitles:@" Download "nil";
[Resultview show];
}else{
return;
}
} failure:^ (Afhttprequestoperation *operation, Nserror *error) {
Uialertview *errorview = [[Uialertview alloc]initwithtitle:@ ' hint ' message:@ ' network problematic ' delegate:self cancelButtonTitle:@ ' Cancel "otherbuttontitles:@" OK ", nil";
[Errorview show];
NSLog (@ "%@", error);
}];
}
The ability to check for updates in iOS opens app implementation