|
| 1 | +// |
| 2 | +// COSBeaconBaseInfoModel.h |
| 3 | +// COSBeaconAPI_Base |
| 4 | +// |
| 5 | +// Created by jackhuali on 2020/4/14. |
| 6 | +// Copyright © 2020 tencent.com. All rights reserved. |
| 7 | +// |
| 8 | + |
| 9 | +#import <Foundation/Foundation.h> |
| 10 | +#import "COSBeaconOStarContent.h" |
| 11 | +#import "COSBeaconReportConfig.h" |
| 12 | + |
| 13 | + |
| 14 | +typedef enum : NSInteger |
| 15 | +{ |
| 16 | + COSBeaconNotReachable = 0, |
| 17 | + COSBeaconReachableViaWiFi, |
| 18 | + COSBeaconReachableViaWWAN, |
| 19 | + COSBeaconReachableUnknow |
| 20 | +} COSBeaconNetworkStatus; |
| 21 | + |
| 22 | +@class COSBeaconLocalConfig; |
| 23 | + |
| 24 | +NS_ASSUME_NONNULL_BEGIN |
| 25 | + |
| 26 | +/** |
| 27 | + 灯塔SDK采集的公共基础信息 |
| 28 | + 存储在单例里的属性,在多线程,采用atomic控制线程同步,重写set/get方法的属性需手动控制同步,不同步的属性在多线程时可能引起crash或计算结果不是预期的 |
| 29 | + */ |
| 30 | +@interface COSBeaconBaseInfoModel : NSObject |
| 31 | + |
| 32 | +/// 主App的appKey |
| 33 | +@property (copy) NSString *mainAppKey; |
| 34 | +/// 上报策略配置 |
| 35 | +@property (strong) COSBeaconReportConfig *config; |
| 36 | +/// 缓存各appKey的的附加参数,以通道的appKey作为key进行缓存 |
| 37 | +@property (copy) NSMutableDictionary<NSString *, NSDictionary *> *additionalInfoDict; |
| 38 | +/// 缓存各appKet的的userId,以通道的appKey作为key进行缓存 |
| 39 | +@property (copy) NSMutableDictionary<NSString *, NSString *> *userIdDict; |
| 40 | +/// 缓存各appKet的的openId,以通道的appKey作为key进行缓存 |
| 41 | +@property (copy) NSMutableDictionary<NSString *, NSString *> *openIdDict; |
| 42 | + |
| 43 | + |
| 44 | +/// COSBeaconOStar对象 |
| 45 | +@property (nonatomic, strong) COSBeaconOStarContent *ostar; |
| 46 | +/// ostarSDK版本号 |
| 47 | +@property (copy) NSString *ostarVersion; |
| 48 | + |
| 49 | + |
| 50 | +/// bundle相关 |
| 51 | +@property (copy, readonly) NSString *bundleId; |
| 52 | +/// 平台 id |
| 53 | +@property (assign, readonly) int platformId; |
| 54 | +/// 网关 ip |
| 55 | +@property (copy) NSString *gatewayIP; |
| 56 | +/// 硬件型号 |
| 57 | +@property (copy, readonly) NSString *hardwareModel; |
| 58 | +/// 国家 |
| 59 | +@property (copy, readonly) NSString *country; |
| 60 | +/// 语言 |
| 61 | +@property (copy, readonly) NSString *language; |
| 62 | +/// 单位GB |
| 63 | +@property (assign, readonly) long long romSize; |
| 64 | +/// openuuid 自建 |
| 65 | +@property (copy, readonly) NSString *openUdid; |
| 66 | +/// idfv |
| 67 | +@property (copy) NSString *idfv; |
| 68 | +/// idfa |
| 69 | +@property (copy) NSString *idfa; |
| 70 | +/// 是否越狱 |
| 71 | +@property (assign, readonly) BOOL isReet; |
| 72 | +/// 主通道的channelId |
| 73 | +@property (copy) NSString *channelId; |
| 74 | +/// 分辨率 |
| 75 | +@property (copy, readonly) NSString *resolution; |
| 76 | +/// sessionId |
| 77 | +@property (copy) NSString *sessionId; |
| 78 | + |
| 79 | +/// 缓存服务端返回的sId,请求时带上,给服务端从缓存取解密后的密钥 |
| 80 | +@property (copy) NSString *sId; |
| 81 | + |
| 82 | +/// 版本相关 |
| 83 | +@property (copy) NSString *appVersion; |
| 84 | +/// sdk 版本 |
| 85 | +@property (copy, readonly) NSString *sdkVersion; |
| 86 | +/// 系统版本 |
| 87 | +@property (copy, readonly) NSString *osVer; |
| 88 | +/// 系统版本 |
| 89 | +@property (assign, readonly) float osVerFloat; |
| 90 | +/// 是否纯新增用户,纯新增用户的定义是首次在某台设备上安装APP,卸载重装的不算纯新增 |
| 91 | +@property (assign) BOOL isnew; |
| 92 | +/// 是否版本新增用户 |
| 93 | +@property (assign) BOOL isNewWithVer; |
| 94 | +/// 是否升级版本 |
| 95 | +@property (assign, readonly) BOOL versionChanged; |
| 96 | +/// sdk是否升级版本 |
| 97 | +@property (assign, readonly) BOOL sdkVersionChanged; |
| 98 | + |
| 99 | +/// 网络相关 |
| 100 | +@property (copy, nullable) NSString *wifiName; |
| 101 | +/// imsi |
| 102 | +@property (copy, readonly) NSString *imsi; |
| 103 | +/// mac |
| 104 | +@property (copy, nullable) NSString *wifiMac; |
| 105 | +/// 终端获取的APN信息(cmwap、cmnet等) |
| 106 | +@property (copy) NSString *apn; |
| 107 | +/// 网络状态 |
| 108 | +@property (assign) COSBeaconNetworkStatus currentNetStatus; |
| 109 | +/// all_ssid |
| 110 | +@property (copy, readonly) NSString *wlanDevices; |
| 111 | + |
| 112 | +/// APP或者此SDK在运行过程中的一些运行时参数的模型类 |
| 113 | +@property (strong) COSBeaconLocalConfig *localConfig; |
| 114 | +/// 是否在后台 |
| 115 | +@property (assign) BOOL isBackground; |
| 116 | +/// 是否模拟器 |
| 117 | +@property (assign, readonly) BOOL isSimulator; |
| 118 | +/// 是否冷启动 |
| 119 | +@property (assign) BOOL isCold; |
| 120 | +/// 启动来源 |
| 121 | +@property (copy) NSString *launchSource; |
| 122 | +/// 设备名 |
| 123 | +@property (copy, readonly) NSString *deviceName DEPRECATED_MSG_ATTRIBUTE("安全合规建设,4.2.75以后不再采集"); |
| 124 | +/// 设备型号 |
| 125 | +@property (copy, readonly) NSString *deviceModel; |
| 126 | +/// 设备类型 |
| 127 | +@property (copy, readonly) NSString *deviceType; |
| 128 | +/// 电池 |
| 129 | +@property (copy, readonly) NSString *battery; |
| 130 | +/// aesKey |
| 131 | +@property (copy) NSString *aesKey; |
| 132 | +/// 加密 key |
| 133 | +@property (nonatomic, copy) NSString *aesKeyEncrypt; |
| 134 | +/// 与服务器进行时钟同步的时间差(单位毫秒) |
| 135 | +@property (assign) NSTimeInterval serverTimeDelta; |
| 136 | +/// app安装时间 |
| 137 | +@property (assign, readonly) long long appInstallTime; |
| 138 | + |
| 139 | +// 延迟初始化相关需要耗时的参数,需在子线程调用 |
| 140 | +- (void)initBaseInfo; |
| 141 | + |
| 142 | +// 初始化最基础infos,目前(4.1.29)只在检查appkey为异常时的201错误上报使用。 |
| 143 | +- (void)initBaseSimpleInfo; |
| 144 | + |
| 145 | +@end |
| 146 | + |
| 147 | +NS_ASSUME_NONNULL_END |
0 commit comments