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
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
19 deletions
+36
-19
GMViewController.m
Example/GMPhobos/GMViewController.m
+14
-2
NewPhobos.m
GMPhobos/Classes/NewPhobos.m
+4
-5
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,9 +53,21 @@ NSString *const MockCityId = @"beijing";
[
_tableView
registerClass
:[
UITableViewCell
class
]
forCellReuseIdentifier
:
@"cell"
];
[
self
.
view
addSubview
:
_tableView
];
[
Phobos
Util
getIDFAString
:
^
(
NSString
*
idfa
)
{
[
Phobos
Device
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
);
}];
}
...
...
GMPhobos/Classes/NewPhobos.m
View file @
141d78de
...
...
@@ -113,9 +113,8 @@ static NewPhobos *_sharedClient;
@"total_memory"
:
PhobosSafeString
([
PhobosUtil
getTotalMemorySize
]),
@"run_time"
:
PhobosSafeString
([
PhobosUtil
deviceRunTime
]),
@"uuid"
:
PhobosSafeString
([
PhobosDevice
getDEVICEID
]),
@"idfa"
:
PhobosSafeString
([
PhobosDevice
getIDFA
]),
@"idfv"
:
PhobosSafeString
([
PhobosDevice
getIDFV
]),
@"build_version_release"
:
PhobosSafeString
([[
UIDevice
currentDevice
]
systemVersion
]),
@"uqid"
:
PhobosSafeString
([
PhobosDevice
getUQID
]),
@"build_version_release"
:
PhobosSafeString
([[
UIDevice
currentDevice
]
systemVersion
]),
};
[
NewPhobos
track
:
@"device_opened"
attributes
:
dict
sendNow
:
YES
];
}
...
...
@@ -214,8 +213,7 @@ static NewPhobos *_sharedClient;
@"total_memory"
:
[
PhobosUtil
getTotalMemorySize
],
@"run_time"
:
[
PhobosUtil
deviceRunTime
],
@"uuid"
:
PhobosSafeString
([
PhobosDevice
getDEVICEID
]),
@"idfa"
:
PhobosSafeString
([
PhobosDevice
getIDFA
]),
@"idfv"
:
PhobosSafeString
([
PhobosDevice
getIDFV
]),
@"uqid"
:
PhobosSafeString
([
PhobosDevice
getUQID
]),
@"build_version_release"
:
[[
UIDevice
currentDevice
]
systemVersion
],
};
[
NewPhobos
trackSessionOverWithAttributes
:
dict
];
...
...
@@ -328,6 +326,7 @@ static NewPhobos *_sharedClient;
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getIDFA
])
forKey
:
@"idfa"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getIDFV
])
forKey
:
@"idfv"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getDEVICEID
])
forKey
:
@"device_id"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getUQID
])
forKey
:
@"uqid"
];
[
deviceParams
setValue
:
@"ios"
forKey
:
@"device_type"
];
[
deviceParams
setValue
:
@"Apple"
forKey
:
@"manufacturer"
];
[
deviceParams
setValue
:
@
(
self
.
gps
.
coordinate
.
latitude
)
forKey
:
@"lat"
];
...
...
GMPhobos/Classes/OldPhobos.m
View file @
141d78de
...
...
@@ -109,6 +109,7 @@ static OldPhobos *sharedClient = nil;
@"total_memory"
:
PhobosSafeString
([
PhobosUtil
getTotalMemorySize
]),
@"run_time"
:
PhobosSafeString
([
PhobosUtil
deviceRunTime
]),
@"uuid"
:
PhobosSafeString
([
PhobosDevice
getDEVICEID
]),
@"uqid"
:
PhobosSafeString
([
PhobosDevice
getUQID
]),
@"idfa"
:
PhobosSafeString
([
PhobosDevice
getIDFA
]),
@"idfv"
:
PhobosSafeString
([
PhobosDevice
getIDFV
]),
@"build_version_release"
:
PhobosSafeString
([[
UIDevice
currentDevice
]
systemVersion
]),
...
...
@@ -212,6 +213,7 @@ static OldPhobos *sharedClient = nil;
@"total_memory"
:
[
PhobosUtil
getTotalMemorySize
],
@"run_time"
:
[
PhobosUtil
deviceRunTime
],
@"uuid"
:
[
PhobosDevice
getDEVICEID
],
@"uqid"
:
PhobosSafeString
([
PhobosDevice
getUQID
]),
@"build_version_release"
:
[[
UIDevice
currentDevice
]
systemVersion
],
};
[
OldPhobos
track
:
@"on_app_session_over"
attributes
:
dict
];
...
...
@@ -432,6 +434,7 @@ static OldPhobos *sharedClient = nil;
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getIDFA
])
forKey
:
@"idfa"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getIDFV
])
forKey
:
@"idfv"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getDEVICEID
])
forKey
:
@"device_id"
];
[
deviceParams
setValue
:
PhobosSafeString
([
PhobosDevice
getUQID
])
forKey
:
@"uqid"
];
[
deviceParams
setValue
:
@"ios"
forKey
:
@"device_type"
];
[
deviceParams
setValue
:
@"Apple"
forKey
:
@"manufacturer"
];
[
deviceParams
setValue
:
@
(
self
.
gps
.
coordinate
.
latitude
)
forKey
:
@"lat"
];
...
...
GMPhobos/Classes/Phobos.h
View file @
141d78de
...
...
@@ -9,6 +9,7 @@
#import <Foundation/Foundation.h>
#import "PhobosPVProtocol.h"
#import "PhobosConfig.h"
#import "PhobosDevice.h"
#import <CoreLocation/CLLocation.h>
NS_ASSUME_NONNULL_BEGIN
...
...
GMPhobos/Classes/PhobosDevice.h
View file @
141d78de
...
...
@@ -8,6 +8,7 @@
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef
void
(
^
PhobosGetIDFACompleteBlock
)(
NSDictionary
*
dict
);
@interface
PhobosDevice
:
NSObject
...
...
@@ -21,9 +22,13 @@ typedef void (^PhobosGetIDFACompleteBlock)(NSDictionary *dict);
/// 获取IDFV
+
(
NSString
*
)
getIDFV
;
/// 获取DEVICEID,
同步获取 取出的是默认第一次的idfv
/// 获取DEVICEID,
先获取idfa 获取不到会获取钥匙串中idfv 如果没有用idfv 生成
+
(
NSString
*
)
getDEVICEID
;
/// 获取UQID,同步获取取出的是默认第一次的idfv 如果没有用idfv 生成
+
(
NSString
*
)
getUQID
;
@end
NS_ASSUME_NONNULL_END
GMPhobos/Classes/PhobosDevice.m
View file @
141d78de
...
...
@@ -84,9 +84,16 @@ NSString *defaultIDFA = @"00000000-0000-0000-0000-000000000000";
return
[[[
UIDevice
currentDevice
]
identifierForVendor
]
UUIDString
];
}
#pragma mark - 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
];
if
([
self
checkIdfaIsNull
:
deviceId
])
{
deviceId
=
[
self
getIDFV
];
...
...
GMPhobos/Classes/PhobosUtil.m
View file @
141d78de
...
...
@@ -227,16 +227,6 @@
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
{
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