+ (void)startSdkWithAppId:(NSString *)appid delegate:(id<OneIDDelegate>)delegate;
OneIDFetch:error
回调接口返回 OneID 信息。#import <OneID/OneID.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// 启动OneID SDK
[OneID startSdkWithAppId:AppId delegate:self];
return YES;
}
/// SDK启动成功返回OneID信息
- (void)OneIDFetch:(NSDictionary *)info error:(NSError *)error {
/*
info内容示例:
"oneAID": "I-xxxxxxxxfae28cfc4c63708xxxxxxxx", //其中oneAID前缀 I-表示是iOS系统
"requestId": "xxx"
*/
NSLog(@"OneIDFetch:%@ error:%@", info, error);
}
+ (void)queryLbs;
OneIDQueryLbs:error
回调接口返回场景信息。[OneID queryLbs];
- (void)OneIDQueryLbs:(NSDictionary *)info error:(NSError *)error {
NSLog(@"OneIDQueryLbs:%@ error:%@", info, error);
}
回调方法OneIDQueryLbs中的info字典示例如下:
requestId: 单次请求ID
sceneInfoList: 场景信息
coarseAddress: 粗略位置
addressCode: 位置代码
{
"requestId": "xxxxxxxxf0eb4432897d6be2xxxxxxxx",
"poiSceneInfoList": [ //POI场景信息列表
{
"sceneTypeList": [
{ //一级分类,指该位置所属的场景的类型,如:交通设施服务、购物服务、餐饮服务等。
"st1": "餐饮服务"
}
]
}
],
"aoiSceneInfoList": [ //AOI场景信息列表
{
"sceneTypeList": [
{ //一级分类,指该位置所属的场景的类型,如:交通设施服务、购物服务、餐饮服务等。
"st1": "购物服务"
}
]
}
],
"sceneInfoList": [ //场景信息列表(POI场景信息列表和AOI场景信息列表都为空时,才会返回此项,准确度较低)
{
"sceneTypeList": [
{ //一级分类,指该位置所属的场景的类型,如:交通设施服务、购物服务、餐饮服务等。
"st1": "科教文化服务"
}
]
}
],
"coarseAddress": "xxxxxx",
"addressCode": {
//省Code
"province": "450000",
//市Code
"city": "450100",
//区Code
"area": "450108"
}
}
+ (NSDictionary*)oneIDFetchInfo;
NSLog(@"%@", [OneID oneIDFetchInfo]);
/*
返回值内容示例:
"oneAID": "I-xxxxxxxxfae28cfc4c63708xxxxxxxx", //其中oneAID前缀 I-表示是iOS系统
"requestId": "xxx"
*/
+ (NSString*)sdkVersion;
[OneID sdkVersion];
以上文档对您是否有帮助?