Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lib_base
Overview
Overview
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
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sikang
lib_base
Commits
b747efaa
Commit
b747efaa
authored
Jan 23, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugFix
parent
8fa938d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
src/main/java/tech/starwin/utils/TrackEventHelper.java
+14
-0
No files found.
src/main/java/tech/starwin/utils/TrackEventHelper.java
View file @
b747efaa
...
...
@@ -18,6 +18,7 @@ import tech.starwin.LibConfig;
*/
public
class
TrackEventHelper
{
public
static
final
String
REST_URL
=
"rest_url"
;
public
static
OnTrackEventListener
onTrackEventListener
=
null
;
/**
* click埋点,CONTENT_TYPE = view.getTag()
...
...
@@ -52,6 +53,9 @@ public class TrackEventHelper {
bundle
.
putString
(
FirebaseAnalytics
.
Param
.
CONTENT_TYPE
,
eventName
);
//FireBase 埋点
FirebaseAnalytics
.
getInstance
(
context
).
logEvent
(
FirebaseAnalytics
.
Event
.
SELECT_CONTENT
,
bundle
);
if
(
onTrackEventListener
!=
null
)
{
onTrackEventListener
.
onActionClick
(
eventName
);
}
}
/**
...
...
@@ -60,6 +64,9 @@ public class TrackEventHelper {
public
static
void
logEvent
(
String
eventName
)
{
//FireBase 埋点
FirebaseAnalytics
.
getInstance
(
LibConfig
.
getContext
()).
logEvent
(
eventName
,
null
);
if
(
onTrackEventListener
!=
null
)
{
onTrackEventListener
.
onActionEvent
(
eventName
);
}
}
...
...
@@ -68,6 +75,13 @@ public class TrackEventHelper {
*/
private
static
final
int
CACHE_EXPIRATION_SECONDS
=
60
*
5
;
//remoteConfig 刷新频率
public
interface
OnTrackEventListener
{
void
onActionEvent
(
String
eventName
);
void
onActionClick
(
String
eventName
);
}
// public static void fetchRemoteConfig() {
// final FirebaseRemoteConfig config = FirebaseRemoteConfig.getInstance();
// config.fetch(CACHE_EXPIRATION_SECONDS)
...
...
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