IOS集成调用

接口文件说明

移动app提供的接口包,包含一些库文件和一个资源包, 在二次开发时,需要在自己的项目中引入这些文件,包含的文件和说明具体如下:

     —语音识别:iflyMSC.framework

     —高德地图:MAMapKit.framework和libMASearchKit.a

ps:资源包中含可配置的xml内容,视图以及部分图片,资源包的具体内容如下图所示:

调用与实现

移动app提供了登录与服务器地址管理、资源树控制器、资源展现控制器三个接口,对这三个接口的调用和实现可以满足用户个性化需求。接口的具体作用和实现方法如下:

登录及服务器地址管理

可以通过调用调用GezAccess类方法来实现服务器地址设置及登录功能,+(NSString*) loginWithUserName:(NSString*) userName andUserPwd:(NSString*) userPwd 。返回结果格式如下:

{"loginrlt":"0","failmsg":"密码错误!"}
loginrlt : 0 登录失败,1登录成功
failmsg : 记录失败原因。

示例代码如下:

//"登录"按钮触发事件

    - (IBAction)loginAction:(id)sender {
    NSString *userName = userNameUIText.text;
    NSString *userPwd = userPwdUIText.text;
    NSString *tempResult = [GezAccess loginWithUserName:userName andUserPwd:userPwd];
    NSInteger loginResult = [[[tempResult JSONValue] objectForKey:@"loginrlt"] intValue];
    //{"loginrlt":"0","failmsg":"密码错误!"}
    if(loginResult == 1){
      [GezAccess updateLatestAccessSuccessUserName:userName andUserPwd:userPwd];
        [self.delegate gotoGezResourceTreeUIViewController:tempResult];
    }else{
        NSString *errorMsg = [[tempResult JSONValue] objectForKey:@"failmsg"];
        UIAlertView *uav = [[UIAlertView alloc]initWithTitle:@"提示:" message:errorMsg delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil];
        [uav show];
    }
}

具体可参照演示项目CinemaAssistant中LoginUIView.m和LoginUIViewController.m

资源树控制器

调用资源树控制器后,修改配置文件CustomGezResourceTree.geojson,可以实现对资源列表界面的的定制修改,例如修改资源树管理器界面上的图片,修改app版本信息等。

资源树控制器配置文件的具体说明如下:

//运行时不显示的组件。

"removeMenu": "1000112,1000114,1000115,10001331"

//配置可以改变图标的矢量图的组件,组件tag为1000111

"changeMenuSvg": [
                            {
                                "tag": "1000111",
                                "fontName": "iconfont",
                                "text": "7pm3"
                            }
],

//可以改变图片组件,图片的配置

"changeMenuImage": [
                            {
                                "tag": "10001333",
                                "image": "checkBox_yes",
                                "backImage": ""
                            },
                            {
                                "tag": "10001341",
                                "image": "chkon",
                                "backImage": ""
                            }
      ],

//可以修改组件显示内容

"changeContent": [
                            {
                                "tag": "10001013",
                                "text": "集深移动应用"
                            },
                            {
                                "tag": "10001014",
                                "text": "v1.9.2(IOS)"
                            },
                            {
                                "tag": "10001015",
                                "text": "北京集深信息系统技术有限公司"
                            }
    ],

//增加用户自定义图片

"addCustomButton": [
                            {
                                "parentTag": "1000135",
                                "image":"chkon",
                                "frame": "130,220,50,50",
                                "command":"logoutAction"
                            }
    ],

具体定制修改内容,可以根据用户需求进行提供。

资源展现控制器

资源展现控制器对应报表展现界面,资源展现控器对应的配置文件为:customGezResourceShow.geojson。目前资源控制器配置文件提供增加自定义菜单和修改顶层菜单的功能。配置文件的具体内容如下:

"addCustomButton": [
            {
                         "parentTag": "100011",
                          "fontName": "iconfont",
                          "text": "7pm3",
                           "frame": "250,10,50,50",
                            "divFrame":"168,50,130,100"
                           "children": [
                                            {
                                               "fontName": "iconfont",
                                                "text": "7piK",
                                              "frame": "0,0,50,50",
                                              "command":"query"
                                            },
                                            {
                                               "fontName": "iconfont",
                                               "text": "7piZ",
                                               "frame": "0,50,50,50",
                                                command":"submit"
                                            }
                                ]
                            }
]

资源包中的图片

资源包中包含几个图片,用户可以直接替换对应的图片文件来进行冠名修改。

打包与发布

在完成接口的调用、实现后,需要申请付费账号,使用证书和授权,需要对自己的项目进行打包。再将打好的包提交到苹果进行审核审核。具体打包和审核流程可参考苹果官方文档:https://developer.apple.com/cn/support/appstore