Commit a169e2a3 authored by jaguar-bot's avatar jaguar-bot

Bump version to 0.0.13

parent 7f32c4ec
...@@ -14,7 +14,7 @@ PODS: ...@@ -14,7 +14,7 @@ PODS:
- AFNetworking/Serialization (3.1.0) - AFNetworking/Serialization (3.1.0)
- AFNetworking/UIKit (3.1.0): - AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession - AFNetworking/NSURLSession
- GMBase (0.0.11): - GMBase (0.0.12):
- GMNetService - GMNetService
- GMPhobos - GMPhobos
- GMRefresh - GMRefresh
...@@ -26,7 +26,7 @@ PODS: ...@@ -26,7 +26,7 @@ PODS:
- TMCache (~> 2.1.0) - TMCache (~> 2.1.0)
- GMNetService (0.1.3): - GMNetService (0.1.3):
- AFNetworking (= 3.1.0) - AFNetworking (= 3.1.0)
- GMPhobos (0.2.13): - GMPhobos (0.2.18):
- GMCache (~> 0.1.0) - GMCache (~> 0.1.0)
- GMRefresh (0.1.4): - GMRefresh (0.1.4):
- MJRefresh (~> 3.1.0) - MJRefresh (~> 3.1.0)
...@@ -46,10 +46,10 @@ EXTERNAL SOURCES: ...@@ -46,10 +46,10 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
GMBase: 6cea1da64d6e0971f08852e4f4eefa2ae3a8c097 GMBase: 94f32e8b89b34cb383341b793c92fda876f5aded
GMCache: a7b06a2d8a5a1c7cf023055c631ba9a0cd7c39fc GMCache: a7b06a2d8a5a1c7cf023055c631ba9a0cd7c39fc
GMNetService: 2eb74ed62512078e9f00bc7006227a93c2acdf32 GMNetService: 2eb74ed62512078e9f00bc7006227a93c2acdf32
GMPhobos: 2f91b2b86285be7ae1e88c21628ccd7486a2afd8 GMPhobos: ea037939d26853e09774fd7e399f0b34fc6107aa
GMRefresh: 8d6ef25dbd38c2687fee713cc520012d47c7261e GMRefresh: 8d6ef25dbd38c2687fee713cc520012d47c7261e
JSONModel: 12523685c4b623553ccf844bbbf7007624317b2c JSONModel: 12523685c4b623553ccf844bbbf7007624317b2c
Masonry: a1a931a0d08870ed8ae415a2ea5ea68ebcac77df Masonry: a1a931a0d08870ed8ae415a2ea5ea68ebcac77df
......
...@@ -59,6 +59,8 @@ ...@@ -59,6 +59,8 @@
*/ */
- (void)setCurrentCityId:(NSString *)currentCityId; - (void)setCurrentCityId:(NSString *)currentCityId;
- (void)setGPS:(NSDictionary *)gps;
/** /**
* @brief 自定义事件,数量统计. * @brief 自定义事件,数量统计.
* *
......
...@@ -26,6 +26,8 @@ static NSString *sdkVersion = @"110"; ...@@ -26,6 +26,8 @@ static NSString *sdkVersion = @"110";
@property (assign, nonatomic) NSInteger userId; @property (assign, nonatomic) NSInteger userId;
@property (assign, nonatomic) BOOL logEnabled; @property (assign, nonatomic) BOOL logEnabled;
@property (strong, nonatomic) NSString *sessionId; @property (strong, nonatomic) NSString *sessionId;
@property (strong, nonatomic) NSString *lng;
@property (strong, nonatomic) NSString *lat;
@end @end
...@@ -51,6 +53,8 @@ static NSString *sdkVersion = @"110"; ...@@ -51,6 +53,8 @@ static NSString *sdkVersion = @"110";
_channelId = channelId; _channelId = channelId;
_logEnabled = NO; _logEnabled = NO;
_userId = 0; _userId = 0;
_lat = @"";
_lng = @"";
_currentCityId = @""; _currentCityId = @"";
_appVersion = [self getAppVersion]; _appVersion = [self getAppVersion];
[self setupNotification]; [self setupNotification];
...@@ -74,6 +78,17 @@ static NSString *sdkVersion = @"110"; ...@@ -74,6 +78,17 @@ static NSString *sdkVersion = @"110";
_currentCityId = currentCityId; _currentCityId = currentCityId;
} }
- (void)setGPS:(NSDictionary *)gps {
@try {
NSString *lng = gps[@"lng"];
NSString *lat = gps[@"lat"];
_lng = lng;
_lat = lat;
} @catch (NSException *exception) {
phobosLog(exception);
}
}
- (void)handleEventAfterInit{ - (void)handleEventAfterInit{
WMCacheService *cache = [WMCacheService sharedInstance]; WMCacheService *cache = [WMCacheService sharedInstance];
...@@ -83,6 +98,7 @@ static NSString *sdkVersion = @"110"; ...@@ -83,6 +98,7 @@ static NSString *sdkVersion = @"110";
/** 第一次打开APP埋点 **/ /** 第一次打开APP埋点 **/
if (![cache fetchObjectAtDiskWithkey:PhobosHaveOpenApp]) { if (![cache fetchObjectAtDiskWithkey:PhobosHaveOpenApp]) {
[Phobos track:@"device_activated" attributes:@{} sendNow:YES]; [Phobos track:@"device_activated" attributes:@{} sendNow:YES];
[Phobos track:@"device_activated" attributes:@{} sendNow:NO];
[cache storeObjectAtDiskWithkey:PhobosHaveOpenApp object:PhobosHaveOpenApp]; [cache storeObjectAtDiskWithkey:PhobosHaveOpenApp object:PhobosHaveOpenApp];
} }
} }
...@@ -218,7 +234,7 @@ static NSString *sdkVersion = @"110"; ...@@ -218,7 +234,7 @@ static NSString *sdkVersion = @"110";
NSArray *array = [[WMCacheService sharedInstance] fetchObjectAtDiskWithkey:PhobosCacheKey]; NSArray *array = [[WMCacheService sharedInstance] fetchObjectAtDiskWithkey:PhobosCacheKey];
//超过一定数量的话,统一发送一次 //超过一定数量的话,统一发送一次
if (array.count > PhobosShardCount) { if (array.count > PhobosShardCount) {
[sharedClient sendArray:array]; [sharedClient sendArray:array cleanCacheRightNow:YES];
} }
} }
...@@ -226,7 +242,8 @@ static NSString *sdkVersion = @"110"; ...@@ -226,7 +242,8 @@ static NSString *sdkVersion = @"110";
NSDictionary *dict = [sharedClient prepareDictionaryForEvent:eventId attributes:attributes]; NSDictionary *dict = [sharedClient prepareDictionaryForEvent:eventId attributes:attributes];
if (sendNow) { if (sendNow) {
NSArray *array = @[dict]; NSArray *array = @[dict];
[sharedClient sendArray:array]; // 实时发送的埋点,不能立即清楚缓存
[sharedClient sendArray:array cleanCacheRightNow:NO];
}else{ }else{
[sharedClient save:dict]; [sharedClient save:dict];
} }
...@@ -312,7 +329,10 @@ static NSString *sdkVersion = @"110"; ...@@ -312,7 +329,10 @@ static NSString *sdkVersion = @"110";
NSMutableDictionary *deviceParams = [NSMutableDictionary dictionaryWithObjectsAndKeys: NSMutableDictionary *deviceParams = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString],@"device_id", [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString],@"device_id",
[[[UIDevice currentDevice] identifierForVendor] UUIDString],@"idfv", [[[UIDevice currentDevice] identifierForVendor] UUIDString],@"idfv",
@"ios",@"device_type",nil]; @"ios",@"device_type",
@"Apple",@"manufacturer",
_lat,@"lat",
_lng,@"lng",nil];
NSMutableDictionary *appParams = [NSMutableDictionary dictionaryWithObjectsAndKeys: NSMutableDictionary *appParams = [NSMutableDictionary dictionaryWithObjectsAndKeys:
self.appName, @"name", self.appName, @"name",
self.appVersion, @"version", self.appVersion, @"version",
...@@ -363,18 +383,18 @@ static NSString *sdkVersion = @"110"; ...@@ -363,18 +383,18 @@ static NSString *sdkVersion = @"110";
- (void)fetchDataAndSend{ - (void)fetchDataAndSend{
NSArray *paramsArray = [[WMCacheService sharedInstance] fetchObjectAtDiskWithkey:PhobosCacheKey]; NSArray *paramsArray = [[WMCacheService sharedInstance] fetchObjectAtDiskWithkey:PhobosCacheKey];
if (paramsArray.count>0) { if (paramsArray.count>0) {
[self sendArray:paramsArray]; [self sendArray:paramsArray cleanCacheRightNow:YES];
} }
} }
/** /**
* @brief 发送数组 向Mars发送埋点数据,如果是实时发送的,http请求成功之后,不清楚已有的缓存数据。
* 针对普通埋点数据,发送成功之后,立即删除本地的缓存。
* @param array @author zhaiguojun 16-10-17 in (null)
* @param array 参数
* @since 0.0.1 @param now 是否立即清楚缓存
*/ */
- (void)sendArray:(NSArray *)array { - (void)sendArray:(NSArray *)array cleanCacheRightNow:(BOOL)clean {
if (_logEnabled) { if (_logEnabled) {
phobosLog([NSString stringWithFormat:@"array prepare to fly --✈: %@",array]); phobosLog([NSString stringWithFormat:@"array prepare to fly --✈: %@",array]);
} }
...@@ -384,7 +404,9 @@ static NSString *sdkVersion = @"110"; ...@@ -384,7 +404,9 @@ static NSString *sdkVersion = @"110";
if (compressedData) { if (compressedData) {
[PhobosUtil sendData:compressedData success:^(NSInteger code) { [PhobosUtil sendData:compressedData success:^(NSInteger code) {
phobosLog(@"✈ ---------- ✈ data arrived Mars"); phobosLog(@"✈ ---------- ✈ data arrived Mars");
[[WMCacheService sharedInstance] removeObjectAtDiskWithkey:PhobosCacheKey]; if (clean) {
[[WMCacheService sharedInstance] removeObjectAtDiskWithkey:PhobosCacheKey];
}
}]; }];
} }
} }
...@@ -459,5 +481,4 @@ static NSString *sdkVersion = @"110"; ...@@ -459,5 +481,4 @@ static NSString *sdkVersion = @"110";
} }
} }
@end @end
{ {
"name": "GMBase", "name": "GMBase",
"version": "0.0.11", "version": "0.0.12",
"summary": "更美iOS APP 的 Objective-C 基础Pod库", "summary": "更美iOS APP 的 Objective-C 基础Pod库",
"homepage": "http://git.gengmei.cc/gengmeiios/GMBase", "homepage": "http://git.gengmei.cc/gengmeiios/GMBase",
"license": "仅限北京更美互动信息科技有限公司内部使用", "license": "仅限北京更美互动信息科技有限公司内部使用",
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
"wangyang": "wangyang@gmei.com" "wangyang": "wangyang@gmei.com"
}, },
"source": { "source": {
"git": "http://git.gengmei.cc/gengmeiios/GMBase.git", "git": "git://git.gengmei.cc/gengmeiios/GMBase.git",
"tag": "0.0.11" "tag": "0.0.12"
}, },
"platforms": { "platforms": {
"ios": "8.0" "ios": "8.0"
......
...@@ -14,7 +14,7 @@ PODS: ...@@ -14,7 +14,7 @@ PODS:
- AFNetworking/Serialization (3.1.0) - AFNetworking/Serialization (3.1.0)
- AFNetworking/UIKit (3.1.0): - AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession - AFNetworking/NSURLSession
- GMBase (0.0.11): - GMBase (0.0.12):
- GMNetService - GMNetService
- GMPhobos - GMPhobos
- GMRefresh - GMRefresh
...@@ -26,7 +26,7 @@ PODS: ...@@ -26,7 +26,7 @@ PODS:
- TMCache (~> 2.1.0) - TMCache (~> 2.1.0)
- GMNetService (0.1.3): - GMNetService (0.1.3):
- AFNetworking (= 3.1.0) - AFNetworking (= 3.1.0)
- GMPhobos (0.2.13): - GMPhobos (0.2.18):
- GMCache (~> 0.1.0) - GMCache (~> 0.1.0)
- GMRefresh (0.1.4): - GMRefresh (0.1.4):
- MJRefresh (~> 3.1.0) - MJRefresh (~> 3.1.0)
...@@ -46,10 +46,10 @@ EXTERNAL SOURCES: ...@@ -46,10 +46,10 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
GMBase: 6cea1da64d6e0971f08852e4f4eefa2ae3a8c097 GMBase: 94f32e8b89b34cb383341b793c92fda876f5aded
GMCache: a7b06a2d8a5a1c7cf023055c631ba9a0cd7c39fc GMCache: a7b06a2d8a5a1c7cf023055c631ba9a0cd7c39fc
GMNetService: 2eb74ed62512078e9f00bc7006227a93c2acdf32 GMNetService: 2eb74ed62512078e9f00bc7006227a93c2acdf32
GMPhobos: 2f91b2b86285be7ae1e88c21628ccd7486a2afd8 GMPhobos: ea037939d26853e09774fd7e399f0b34fc6107aa
GMRefresh: 8d6ef25dbd38c2687fee713cc520012d47c7261e GMRefresh: 8d6ef25dbd38c2687fee713cc520012d47c7261e
JSONModel: 12523685c4b623553ccf844bbbf7007624317b2c JSONModel: 12523685c4b623553ccf844bbbf7007624317b2c
Masonry: a1a931a0d08870ed8ae415a2ea5ea68ebcac77df Masonry: a1a931a0d08870ed8ae415a2ea5ea68ebcac77df
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.0.11</string> <string>0.0.12</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.2.13</string> <string>0.2.18</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'GMBase' s.name = 'GMBase'
s.version = '0.0.12' s.version = '0.0.13'
s.summary = '更美iOS APP 的 Objective-C 基础Pod库' s.summary = '更美iOS APP 的 Objective-C 基础Pod库'
s.homepage = 'http://git.gengmei.cc/gengmeiios/GMBase' s.homepage = 'http://git.gengmei.cc/gengmeiios/GMBase'
s.license = '仅限北京更美互动信息科技有限公司内部使用' s.license = '仅限北京更美互动信息科技有限公司内部使用'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment