Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
GMPhobos
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMPhobos
Commits
141d78de
Commit
141d78de
authored
Sep 22, 2020
by
jz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
埋点数据增加 uqid
parent
2a14bd2d
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
17 deletions
+34
-17
GMViewController.m
Example/GMPhobos/GMViewController.m
+13
-1
NewPhobos.m
GMPhobos/Classes/NewPhobos.m
+3
-4
OldPhobos.m
GMPhobos/Classes/OldPhobos.m
+3
-0
Phobos.h
GMPhobos/Classes/Phobos.h
+1
-0
PhobosDevice.h
GMPhobos/Classes/PhobosDevice.h
+6
-1
PhobosDevice.m
GMPhobos/Classes/PhobosDevice.m
+8
-1
PhobosUtil.m
GMPhobos/Classes/PhobosUtil.m
+0
-10
No files found.
Example/GMPhobos/GMViewController.m
View file @
141d78de
...
@@ -53,10 +53,22 @@ NSString *const MockCityId = @"beijing";
...
@@ -53,10 +53,22 @@ NSString *const MockCityId = @"beijing";
[
_tableView
registerClass
:[
UITableViewCell
class
]
forCellReuseIdentifier
:
@"cell"
];
[
_tableView
registerClass
:[
UITableViewCell
class
]
forCellReuseIdentifier
:
@"cell"
];
[
self
.
view
addSubview
:
_tableView
];
[
self
.
view
addSubview
:
_tableView
];
[
PhobosUtil
getIDFAString
:
^
(
NSString
*
idfa
)
{
[
PhobosDevice
getIDFAString
:
^
(
NSDictionary
*
idfaDict
)
{
NSLog
(
@"%@"
,
idfaDict
);
}];
NSLog
(
@"getIDFA%@
\n
"
,[
PhobosDevice
getIDFA
])
;
;
NSLog
(
@"getDEVICEID=====%@
\n
"
,[
PhobosDevice
getDEVICEID
])
;
;
NSLog
(
@"getIDFV%@
\n
"
,
[
PhobosDevice
getIDFV
])
;
[
PhobosDevice
getIDFAString
:
^
(
NSDictionary
*
idfaDict
)
{
NSLog
(
@"%@"
,
idfaDict
);
}];
}];
}
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
...
...
GMPhobos/Classes/NewPhobos.m
View file @
141d78de
...
@@ -113,8 +113,7 @@ static NewPhobos *_sharedClient;
...
@@ -113,8 +113,7 @@ static NewPhobos *_sharedClient;
@"total_memory"
:
PhobosSafeString
([
PhobosUtil
getTotalMemorySize
]),
@"total_memory"
:
PhobosSafeString
([
PhobosUtil
getTotalMemorySize
]),
@"run_time"
:
PhobosSafeString
([
PhobosUtil
deviceRunTime
]),
@"run_time"
:
PhobosSafeString
([
PhobosUtil
deviceRunTime
]),
@"uuid"
:
PhobosSafeString
([
PhobosDevice
getDEVICEID
]),
@"uuid"
:
PhobosSafeString
([
PhobosDevice
getDEVICEID
]),
@"idfa"
:
PhobosSafeString
([
PhobosDevice
getIDFA
]),
@"uqid"
:
PhobosSafeString
([
PhobosDevice
getUQID
]),
@"idfv"
:
PhobosSafeString
([
PhobosDevice
getIDFV
]),
@"build_version_release"
:
PhobosSafeString
([[
UIDevice
currentDevice
]
systemVersion
]),
@"build_version_release"
:
PhobosSafeString
([[
UIDevice
currentDevice
]
systemVersion
]),
};
};
[
NewPhobos
track
:
@"device_opened"
attributes
:
dict
sendNow
:
YES
];
[
NewPhobos
track
:
@"device_opened"
attributes
:
dict
sendNow
:
YES
];
...
@@ -214,8 +213,7 @@ static NewPhobos *_sharedClient;
...
@@ -214,8 +213,7 @@ static NewPhobos *_sharedClient;
@"total_memory"
:
[
PhobosUtil
getTotalMemorySize
],
@"total_memory"
:
[
PhobosUtil
getTotalMemorySize
],
@"run_time"
:
[
PhobosUtil
deviceRunTime
],
@"run_time"
:
[
PhobosUtil
deviceRunTime
],
@"uuid"
:
PhobosSafeString
([
PhobosDevice
getDEVICEID
]),
@"uuid"
:
PhobosSafeString
([
PhobosDevice
getDEVICEID
]),
@"idfa"
:
PhobosSafeString
([
PhobosDevice
getIDFA
]),
@"uqid"
:
PhobosSafeString
([
PhobosDevice
getUQID
]),
@"idfv"
:
PhobosSafeString
([
PhobosDevice
getIDFV
]),
@"build_version_release"
:
[[
UIDevice
currentDevice
]
systemVersion
],
@"build_version_release"
:
[[
UIDevice
currentDevice
]
systemVersion
],
};
};
[
NewPhobos
trackSessionOverWithAttributes
:
dict
];
[
NewPhobos
trackSessionOverWithAttributes
:
dict
];
...
@@ -328,6 +326,7 @@ static NewPhobos *_sharedClient;
...
@@ -328,6 +326,7 @@ static NewPhobos *_sharedClient;
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getIDFA
])
forKey
:
@"idfa"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getIDFA
])
forKey
:
@"idfa"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getIDFV
])
forKey
:
@"idfv"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getIDFV
])
forKey
:
@"idfv"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getDEVICEID
])
forKey
:
@"device_id"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getDEVICEID
])
forKey
:
@"device_id"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getUQID
])
forKey
:
@"uqid"
];
[
deviceParams
setValue
:
@"ios"
forKey
:
@"device_type"
];
[
deviceParams
setValue
:
@"ios"
forKey
:
@"device_type"
];
[
deviceParams
setValue
:
@"Apple"
forKey
:
@"manufacturer"
];
[
deviceParams
setValue
:
@"Apple"
forKey
:
@"manufacturer"
];
[
deviceParams
setValue
:
@
(
self
.
gps
.
coordinate
.
latitude
)
forKey
:
@"lat"
];
[
deviceParams
setValue
:
@
(
self
.
gps
.
coordinate
.
latitude
)
forKey
:
@"lat"
];
...
...
GMPhobos/Classes/OldPhobos.m
View file @
141d78de
...
@@ -109,6 +109,7 @@ static OldPhobos *sharedClient = nil;
...
@@ -109,6 +109,7 @@ static OldPhobos *sharedClient = nil;
@"total_memory"
:
PhobosSafeString
([
PhobosUtil
getTotalMemorySize
]),
@"total_memory"
:
PhobosSafeString
([
PhobosUtil
getTotalMemorySize
]),
@"run_time"
:
PhobosSafeString
([
PhobosUtil
deviceRunTime
]),
@"run_time"
:
PhobosSafeString
([
PhobosUtil
deviceRunTime
]),
@"uuid"
:
PhobosSafeString
([
PhobosDevice
getDEVICEID
]),
@"uuid"
:
PhobosSafeString
([
PhobosDevice
getDEVICEID
]),
@"uqid"
:
PhobosSafeString
([
PhobosDevice
getUQID
]),
@"idfa"
:
PhobosSafeString
([
PhobosDevice
getIDFA
]),
@"idfa"
:
PhobosSafeString
([
PhobosDevice
getIDFA
]),
@"idfv"
:
PhobosSafeString
([
PhobosDevice
getIDFV
]),
@"idfv"
:
PhobosSafeString
([
PhobosDevice
getIDFV
]),
@"build_version_release"
:
PhobosSafeString
([[
UIDevice
currentDevice
]
systemVersion
]),
@"build_version_release"
:
PhobosSafeString
([[
UIDevice
currentDevice
]
systemVersion
]),
...
@@ -212,6 +213,7 @@ static OldPhobos *sharedClient = nil;
...
@@ -212,6 +213,7 @@ static OldPhobos *sharedClient = nil;
@"total_memory"
:
[
PhobosUtil
getTotalMemorySize
],
@"total_memory"
:
[
PhobosUtil
getTotalMemorySize
],
@"run_time"
:
[
PhobosUtil
deviceRunTime
],
@"run_time"
:
[
PhobosUtil
deviceRunTime
],
@"uuid"
:
[
PhobosDevice
getDEVICEID
],
@"uuid"
:
[
PhobosDevice
getDEVICEID
],
@"uqid"
:
PhobosSafeString
([
PhobosDevice
getUQID
]),
@"build_version_release"
:
[[
UIDevice
currentDevice
]
systemVersion
],
@"build_version_release"
:
[[
UIDevice
currentDevice
]
systemVersion
],
};
};
[
OldPhobos
track
:
@"on_app_session_over"
attributes
:
dict
];
[
OldPhobos
track
:
@"on_app_session_over"
attributes
:
dict
];
...
@@ -432,6 +434,7 @@ static OldPhobos *sharedClient = nil;
...
@@ -432,6 +434,7 @@ static OldPhobos *sharedClient = nil;
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getIDFA
])
forKey
:
@"idfa"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getIDFA
])
forKey
:
@"idfa"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getIDFV
])
forKey
:
@"idfv"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getIDFV
])
forKey
:
@"idfv"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getDEVICEID
])
forKey
:
@"device_id"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getDEVICEID
])
forKey
:
@"device_id"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getUQID
])
forKey
:
@"uqid"
];
[
deviceParams
setValue
:
@"ios"
forKey
:
@"device_type"
];
[
deviceParams
setValue
:
@"ios"
forKey
:
@"device_type"
];
[
deviceParams
setValue
:
@"Apple"
forKey
:
@"manufacturer"
];
[
deviceParams
setValue
:
@"Apple"
forKey
:
@"manufacturer"
];
[
deviceParams
setValue
:
@
(
self
.
gps
.
coordinate
.
latitude
)
forKey
:
@"lat"
];
[
deviceParams
setValue
:
@
(
self
.
gps
.
coordinate
.
latitude
)
forKey
:
@"lat"
];
...
...
GMPhobos/Classes/Phobos.h
View file @
141d78de
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
#import "PhobosPVProtocol.h"
#import "PhobosPVProtocol.h"
#import "PhobosConfig.h"
#import "PhobosConfig.h"
#import "PhobosDevice.h"
#import <CoreLocation/CLLocation.h>
#import <CoreLocation/CLLocation.h>
NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN
...
...
GMPhobos/Classes/PhobosDevice.h
View file @
141d78de
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN
typedef
void
(
^
PhobosGetIDFACompleteBlock
)(
NSDictionary
*
dict
);
typedef
void
(
^
PhobosGetIDFACompleteBlock
)(
NSDictionary
*
dict
);
@interface
PhobosDevice
:
NSObject
@interface
PhobosDevice
:
NSObject
...
@@ -21,9 +22,13 @@ typedef void (^PhobosGetIDFACompleteBlock)(NSDictionary *dict);
...
@@ -21,9 +22,13 @@ typedef void (^PhobosGetIDFACompleteBlock)(NSDictionary *dict);
/// 获取IDFV
/// 获取IDFV
+
(
NSString
*
)
getIDFV
;
+
(
NSString
*
)
getIDFV
;
/// 获取DEVICEID,
同步获取 取出的是默认第一次的idfv
/// 获取DEVICEID,
先获取idfa 获取不到会获取钥匙串中idfv 如果没有用idfv 生成
+
(
NSString
*
)
getDEVICEID
;
+
(
NSString
*
)
getDEVICEID
;
/// 获取UQID,同步获取取出的是默认第一次的idfv 如果没有用idfv 生成
+
(
NSString
*
)
getUQID
;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
GMPhobos/Classes/PhobosDevice.m
View file @
141d78de
...
@@ -84,9 +84,16 @@ NSString *defaultIDFA = @"00000000-0000-0000-0000-000000000000";
...
@@ -84,9 +84,16 @@ NSString *defaultIDFA = @"00000000-0000-0000-0000-000000000000";
return
[[[
UIDevice
currentDevice
]
identifierForVendor
]
UUIDString
];
return
[[[
UIDevice
currentDevice
]
identifierForVendor
]
UUIDString
];
}
}
#pragma mark - getDEVICEID
#pragma mark - getDEVICEID
+
(
NSString
*
)
getDEVICEID
{
+
(
NSString
*
)
getDEVICEID
{
NSString
*
idfa
=
[
self
getIDFA
];
if
(
!
[
self
checkIdfaIsNull
:
idfa
])
{
idfa
=
[
self
getUQID
];
}
return
idfa
;
}
+
(
NSString
*
)
getUQID
{
NSString
*
deviceId
=
[
self
getKeyChainService
:
DEVICEID
account
:
keyChainAccount
];
NSString
*
deviceId
=
[
self
getKeyChainService
:
DEVICEID
account
:
keyChainAccount
];
if
([
self
checkIdfaIsNull
:
deviceId
])
{
if
([
self
checkIdfaIsNull
:
deviceId
])
{
deviceId
=
[
self
getIDFV
];
deviceId
=
[
self
getIDFV
];
...
...
GMPhobos/Classes/PhobosUtil.m
View file @
141d78de
...
@@ -227,16 +227,6 @@
...
@@ -227,16 +227,6 @@
return
[
str
length
]
>
0
;
return
[
str
length
]
>
0
;
}
}
//+ (NSString *)deviceId {
// NSString *idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
// NSString *idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
//
// if (idfa != nil && ![idfa isEqualToString:@"00000000-0000-0000-0000-000000000000"]) {
// return idfa;
// }
//
// return idfv;
//}
+
(
NSString
*
)
getIPAddress
:
(
BOOL
)
preferIPv4
{
+
(
NSString
*
)
getIPAddress
:
(
BOOL
)
preferIPv4
{
NSArray
*
searchArray
=
preferIPv4
?
NSArray
*
searchArray
=
preferIPv4
?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment