Aggregated data iOS SDK National Vehicle violation Demo example

Source: Internet
Author: User

1. Add the Aggregation Data SDK (Juheapis.framework) to your program, and the packages that the SDK relies on include:

650) this.width=650; "Src=" http://yspe2371e4aa7697989.yunshipei.cn/ Dhlwzt1mdyzzaxplptcymczzcmm9yuhsmgndvxpru1v5umlvevjtbhraetvpykc5bkxttnparzr1ym1wmepuskdnakf4tkrfd01ea3hnreeytkrrm05qvwxnm Fozwvhsbgntmwhjbxnstwtzeupuskdkr1y0zenvevjtrklvakjqukc5mlresktjmkl5wtnwwk0wnxjzbwsxzfzwwvvywlznamw1wwpot1ddvxlsbvp2ym5rbe 1rwtfzvfpntlv3evzdvxlsbvp2ym5semfycgxkvephtkrbd0puskdabwxzyknvevjra3dta0psytbarfrvrwxnmffsttbrbe1rwmthwe56yjj4mlptvxlsamn 3slrkr1ozsmhkbwwwzvnvevjstnzkwfjvuldgemrbpt0= "style=" border:0px; "/>


2, find the Express query interface macro in the JHSDKAPIPath.h file of the Aggregation SDK framework, and the dictionary parameters

/**
@brief Vehicle violation Query--1, get support City interface

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4C/33/wKiom1Q4wAzR-5wHAADN0khBXwA835.jpg "style=" float: none; "title=" 1.png "alt=" Wkiom1q4wazr-5whaadn0khbxwa835.jpg "/>

*/
#define Kjhapis_life_wz_citys @ "Juhe.apis.wz.citys"//1, get support for City interface

/**
@brief Vehicle violation query--2, request illegal query interface

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4C/34/wKioL1Q4wEOwgh84AAGY9QJ9Q7A963.jpg "style=" float: none; "title=" 2.png "alt=" Wkiol1q4weowgh84aagy9qj9q7a963.jpg "/>

*/
#define Kjhapis_life_wz_query @ "Juhe.apis.wz.query"//2, Request illegal query interface

/**
@brief Vehicle violation Inquiry--3, vehicle (number plate) type numbering query interface

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4C/33/wKiom1Q4wAzzfZYcAACS11lIPIk717.jpg "style=" float: none; "title=" 3.png "alt=" Wkiom1q4wazzfzycaacs11lipik717.jpg "/>

*/
#define KJHAPIS_LIFE_WZ_HPZL @ "JUHE.APIS.WZ.HPZL"//3, Vehicle (number plate) type numbering query interface

/**
@brief Vehicle violation query--4, interface remaining number of queries

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4C/34/wKioL1Q4wEPCNZQpAABIXxknGus632.jpg "style=" float: none; "title=" 4.png "alt=" Wkiol1q4wepcnzqpaabixxkngus632.jpg "/>

*/
#define Kjhapis_life_wz_status @ "Juhe.apis.wz.status"//4, number of interfaces remaining query

3, The interface calls the method in the program (changes the VIEWCONTROLLER.M to. mm)

#import "ViewController.h"

#import <JuheApis/JuheAPI.h>
#import <JuheApis/JHOpenidSupplier.h>
#import <JuheApis/JHSDKAPIPath.h>

@interface Viewcontroller ()
@end

@implementation Viewcontroller

-(void) Viewdidload {
[Super Viewdidload];
Additional setup after loading the view, typically from a nib.
[[Jhopenidsupplier Sharesupplier] registerjuheapibyopenid:@ "applied to the OpenID"];

uibutton* Beginbtn=[uibutton Buttonwithtype:uibuttontypesystem];
Beginbtn.frame=cgrectmake (20, 111, 280, 40);
[Beginbtn settitle:@ "Start" forstate:uicontrolstatenormal];
[Beginbtn Settitlecolor:[uicolor Darkgraycolor] forstate:uicontrolstatenormal];
[Beginbtn addtarget:self Action: @selector (Dotestaction) forcontrolevents:uicontroleventtouchupinside];
[Beginbtn setbackgroundimage:[uiimage imagenamed:@ "Button5"] forstate:uicontrolstatenormal];
[Self.view ADDSUBVIEW:BEGINBTN];
}

-(void) dotestaction
{
/* 1, get support for City interface */
[Self test:kjhapis_life_wz_citys parameters: @{@ "province": @ "JS", @ "Dtype": @ "JSON"}];
/* 2, request a violation of the query interface */
[Self test:kjhapis_life_wz_query parameters: @{@ ' dtype ': @ "JSON", @ "City": @ "SH", @ "HPHM": @ "su l50a11", @ "HPZL": @ "" "}];
/* 3, Vehicle (plate) Type Number query interface */
[Self TEST:KJHAPIS_LIFE_WZ_HPZL parameters: @{@ "Dtype": @ "JSON"}];
/* 4, Number of interfaces remaining query */
[Self test:kjhapis_life_wz_status parameters: @{@ "Dtype": @ "JSON"}];

}

-(void) Test: (NSString *) path parameters: (nsdictionary *) parameters{

Juheapi *juheapi = [Juheapi Sharejuheapi];
[Juheapi Executeworkwithapi:path
Parameters:parameters
success:^ (id responseobject) {
if ([[Parameters objectforkey:@ "Dtype"] isequaltostring:@ "xml"]) {
NSLog (@ "***xml*** \%@", responseobject);
}else{
int error_code = [[Responseobject objectforkey:@ "Error_code"] intvalue];
if (!error_code) {
NSLog (@ "%@", responseobject);
}else{
NSLog (@ "%@", responseobject);
}
}

} failure:^ (Nserror *error) {
NSLog (@ "error:%@", error.description);
}];
}

-(void) didreceivememorywarning {
[Super didreceivememorywarning];
Dispose of any resources the can be recreated.
}

@end


4, National vehicle violation interface return data description and error code description


1. API:JUHE.APIS.WZ.CITYS (macro: Kjhapis_life_wz_citys)

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4C/33/wKiom1Q4wJvi0gTKAAJSol13vNw630.jpg "style=" float: none; "title=" 1.png "alt=" Wkiom1q4wjvi0gtkaajsol13vnw630.jpg "/>

2. API:JUHE.APIS.WZ.QUERY (macro: Kjhapis_life_wz_query)


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4C/34/wKioL1Q4wNOCOSC4AAHRD02ZIk8212.jpg "style=" float: none; "title=" 2.png "alt=" Wkiol1q4wnocosc4aahrd02zik8212.jpg "/>

3. API:JUHE.APIS.WZ.HPZL (macro: KJHAPIS_LIFE_WZ_HPZL)


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4C/33/wKiom1Q4wJyj407dAACziR5Thcg386.jpg "style=" float: none; "title=" 3.png "alt=" Wkiom1q4wjyj407daaczir5thcg386.jpg "/>

4. API:JUHE.APIS.WZ.STATUS (macro: Kjhapis_life_wz_status)

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4C/34/wKioL1Q4wNOgDBV0AACndBTZzdI963.jpg "style=" float: none; "title=" 4.png "alt=" Wkiol1q4wnogdbv0aacndbtzzdi963.jpg "/>

Error code


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4C/33/wKiom1Q4wJyR9cUlAAEZ-tdi8yM006.jpg "style=" float: none; "title=" 5.png "alt=" Wkiom1q4wjyr9culaaez-tdi8ym006.jpg "/>

5, more Aggregation Data SDK interface, Access here: Http://www.juhe.cn/juhesdk/idocs

Aggregated data iOS SDK National Vehicle violation Demo example

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.