bmkbussubscribeoption*option =[bmkbussubscribeoptionnew];// 订阅者信息option.subscriber=[bmksubscribernew];// 当前位置option.subscriber.location=cllocationcoordinate2dmake(39.921933,116.488962);// 线路唯一标识option.lineuid= @"99d2ad2863e9afa5fbdc85bb";// 上下车提醒站点索引option.stationindex=5;// 城市idoption.cityid= @"131";// 设置上下车提醒模块代理[bmkrealtimebusmanager sharedinstance].subscribedelegate= self;bool suc =[[bmkrealtimebusmanager sharedinstance] getonbussubscribe:option];if(suc){nslog(@"上车提醒订阅成功");}else{nslog(@"上车提醒订阅失败");}
-(void)ongetonrealtimebussubscribestatus:(bmkrealtimebussubscribetype)subscribetype {switch(subscribetype){casebmk_bus_subscribe_status_arrive_station:nslog(@"上车提醒:车辆还剩一站即将到站");break;casebmk_bus_subscribe_status_arrive_second:nslog(@"上车提醒:车辆还剩一分钟即将到站");break;casebmk_bus_subscribe_status_no_bus:nslog(@"上车提醒:公交还未发车或者未查询到实时公交车辆信息");break;casebmk_bus_subscribe_status_paramtter_error:nslog(@"上车提醒:参数错误");break;casebmk_bus_subscribe_status_location_timeout:nslog(@"上车提醒:更新实时位置超时");break;casebmk_bus_subscribe_status_data_error:nslog(@"上车提醒:实时公交数据请求错误");break;default:break;}}
// 取消上车提醒[[bmkrealtimebusmanager sharedinstance] removegetonbussubscribe];
调用方式参考上车提醒。
上一篇
下一篇
本篇文章对您是否有帮助?