Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
b95cad2f
Commit
b95cad2f
authored
Oct 22, 2018
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds analytics for reset password event.
parent
8bb8198b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
10 deletions
+39
-10
Analytics.kt
app/src/main/java/chat/rocket/android/analytics/Analytics.kt
+16
-9
AnalyticsManager.kt
...in/java/chat/rocket/android/analytics/AnalyticsManager.kt
+6
-0
PasswordPresenter.kt
...droid/settings/password/presentation/PasswordPresenter.kt
+5
-1
AnswersAnalytics.kt
...ay/java/chat/rocket/android/analytics/AnswersAnalytics.kt
+7
-0
GoogleAnalyticsForFirebase.kt
...at/rocket/android/analytics/GoogleAnalyticsForFirebase.kt
+5
-0
No files found.
app/src/main/java/chat/rocket/android/analytics/Analytics.kt
View file @
b95cad2f
...
@@ -12,7 +12,7 @@ interface Analytics {
...
@@ -12,7 +12,7 @@ interface Analytics {
* @param event The [AuthenticationEvent] used to log in.
* @param event The [AuthenticationEvent] used to log in.
* @param loginSucceeded True if successful logged in, false otherwise.
* @param loginSucceeded True if successful logged in, false otherwise.
*/
*/
fun
logLogin
(
event
:
AuthenticationEvent
,
loginSucceeded
:
Boolean
)
{}
fun
logLogin
(
event
:
AuthenticationEvent
,
loginSucceeded
:
Boolean
)
/**
/**
* Logs the sign up event.
* Logs the sign up event.
...
@@ -20,14 +20,14 @@ interface Analytics {
...
@@ -20,14 +20,14 @@ interface Analytics {
* @param event The [AuthenticationEvent] used to sign up.
* @param event The [AuthenticationEvent] used to sign up.
* @param signUpSucceeded True if successful signed up, false otherwise.
* @param signUpSucceeded True if successful signed up, false otherwise.
*/
*/
fun
logSignUp
(
event
:
AuthenticationEvent
,
signUpSucceeded
:
Boolean
)
{}
fun
logSignUp
(
event
:
AuthenticationEvent
,
signUpSucceeded
:
Boolean
)
/**
/**
* Logs the screen view event.
* Logs the screen view event.
*
*
* @param event The [ScreenViewEvent] to log.
* @param event The [ScreenViewEvent] to log.
*/
*/
fun
logScreenView
(
event
:
ScreenViewEvent
)
{}
fun
logScreenView
(
event
:
ScreenViewEvent
)
/**
/**
* Logs the message sent event.
* Logs the message sent event.
...
@@ -35,7 +35,7 @@ interface Analytics {
...
@@ -35,7 +35,7 @@ interface Analytics {
* @param event The [SubscriptionTypeEvent] to log.
* @param event The [SubscriptionTypeEvent] to log.
* @param serverUrl The server URL to log.
* @param serverUrl The server URL to log.
*/
*/
fun
logMessageSent
(
event
:
SubscriptionTypeEvent
,
serverUrl
:
String
)
{}
fun
logMessageSent
(
event
:
SubscriptionTypeEvent
,
serverUrl
:
String
)
/**
/**
* Logs the media upload event.
* Logs the media upload event.
...
@@ -43,14 +43,14 @@ interface Analytics {
...
@@ -43,14 +43,14 @@ interface Analytics {
* @param event The [SubscriptionTypeEvent] to log.
* @param event The [SubscriptionTypeEvent] to log.
* @param mimeType The mime type of the media uploaded to log.
* @param mimeType The mime type of the media uploaded to log.
*/
*/
fun
logMediaUploaded
(
event
:
SubscriptionTypeEvent
,
mimeType
:
String
)
{}
fun
logMediaUploaded
(
event
:
SubscriptionTypeEvent
,
mimeType
:
String
)
/**
/**
* Logs the reaction event.
* Logs the reaction event.
*
*
* @param event The [SubscriptionTypeEvent] to log.
* @param event The [SubscriptionTypeEvent] to log.
*/
*/
fun
logReaction
(
event
:
SubscriptionTypeEvent
)
{}
fun
logReaction
(
event
:
SubscriptionTypeEvent
)
/**
/**
* Logs the server switch event.
* Logs the server switch event.
...
@@ -58,10 +58,17 @@ interface Analytics {
...
@@ -58,10 +58,17 @@ interface Analytics {
* @param serverUrl The server URL to log.
* @param serverUrl The server URL to log.
* @param serverCount The number of server(s) the use own.
* @param serverCount The number of server(s) the use own.
*/
*/
fun
logServerSwitch
(
serverUrl
:
String
,
serverCount
:
Int
)
{}
fun
logServerSwitch
(
serverUrl
:
String
,
serverCount
:
Int
)
/**
/**
* Logs the admin opening.
* Logs the admin opening
event
.
*/
*/
fun
logOpenAdmin
()
{}
fun
logOpenAdmin
()
/**
* Logs the reset password event.
*
* @param resetPasswordSucceeded True if successful reset password, false otherwise.
*/
fun
logResetPassword
(
resetPasswordSucceeded
:
Boolean
)
}
}
app/src/main/java/chat/rocket/android/analytics/AnalyticsManager.kt
View file @
b95cad2f
...
@@ -70,4 +70,10 @@ class AnalyticsManager @Inject constructor(
...
@@ -70,4 +70,10 @@ class AnalyticsManager @Inject constructor(
analytics
.
forEach
{
it
.
logOpenAdmin
()
}
analytics
.
forEach
{
it
.
logOpenAdmin
()
}
}
}
}
}
fun
logResetPassword
(
resetPasswordSucceeded
:
Boolean
)
{
if
(
analyticsTrackingInteractor
.
get
())
{
analytics
.
forEach
{
it
.
logResetPassword
(
resetPasswordSucceeded
)
}
}
}
}
}
app/src/main/java/chat/rocket/android/settings/password/presentation/PasswordPresenter.kt
View file @
b95cad2f
package
chat.rocket.android.settings.password.presentation
package
chat.rocket.android.settings.password.presentation
import
chat.rocket.android.analytics.AnalyticsManager
import
chat.rocket.android.core.lifecycle.CancelStrategy
import
chat.rocket.android.core.lifecycle.CancelStrategy
import
chat.rocket.android.server.domain.GetCurrentServerInteractor
import
chat.rocket.android.server.domain.GetCurrentServerInteractor
import
chat.rocket.android.server.infraestructure.RocketChatClientFactory
import
chat.rocket.android.server.infraestructure.RocketChatClientFactory
...
@@ -14,6 +15,7 @@ import javax.inject.Inject
...
@@ -14,6 +15,7 @@ import javax.inject.Inject
class
PasswordPresenter
@Inject
constructor
(
class
PasswordPresenter
@Inject
constructor
(
private
val
view
:
PasswordView
,
private
val
view
:
PasswordView
,
private
val
strategy
:
CancelStrategy
,
private
val
strategy
:
CancelStrategy
,
private
val
analyticsManager
:
AnalyticsManager
,
serverInteractor
:
GetCurrentServerInteractor
,
serverInteractor
:
GetCurrentServerInteractor
,
factory
:
RocketChatClientFactory
factory
:
RocketChatClientFactory
)
{
)
{
...
@@ -30,10 +32,12 @@ class PasswordPresenter @Inject constructor(
...
@@ -30,10 +32,12 @@ class PasswordPresenter @Inject constructor(
client
.
updateProfile
(
me
.
id
,
null
,
null
,
password
,
null
)
client
.
updateProfile
(
me
.
id
,
null
,
null
,
password
,
null
)
}
}
analyticsManager
.
logResetPassword
(
true
)
view
.
showPasswordSuccessfullyUpdatedMessage
()
view
.
showPasswordSuccessfullyUpdatedMessage
()
view
.
hideLoading
()
}
catch
(
exception
:
RocketChatException
)
{
}
catch
(
exception
:
RocketChatException
)
{
analyticsManager
.
logResetPassword
(
false
)
view
.
showPasswordFailsUpdateMessage
(
exception
.
message
)
view
.
showPasswordFailsUpdateMessage
(
exception
.
message
)
}
finally
{
view
.
hideLoading
()
view
.
hideLoading
()
}
}
}
}
...
...
app/src/play/java/chat/rocket/android/analytics/AnswersAnalytics.kt
View file @
b95cad2f
...
@@ -67,4 +67,11 @@ class AnswersAnalytics : Analytics {
...
@@ -67,4 +67,11 @@ class AnswersAnalytics : Analytics {
)
)
override
fun
logOpenAdmin
()
=
Answers
.
getInstance
().
logCustom
(
CustomEvent
(
"open_admin"
))
override
fun
logOpenAdmin
()
=
Answers
.
getInstance
().
logCustom
(
CustomEvent
(
"open_admin"
))
override
fun
logResetPassword
(
resetPasswordSucceeded
:
Boolean
)
=
Answers
.
getInstance
()
.
logCustom
(
CustomEvent
(
"reset_password"
)
.
putCustomAttribute
(
"resetPasswordSucceeded"
,
resetPasswordSucceeded
.
toString
())
)
}
}
app/src/play/java/chat/rocket/android/analytics/GoogleAnalyticsForFirebase.kt
View file @
b95cad2f
...
@@ -60,4 +60,9 @@ class GoogleAnalyticsForFirebase @Inject constructor(val context: Context) :
...
@@ -60,4 +60,9 @@ class GoogleAnalyticsForFirebase @Inject constructor(val context: Context) :
}
}
override
fun
logOpenAdmin
()
=
firebaseAnalytics
.
logEvent
(
"open_admin"
,
null
)
override
fun
logOpenAdmin
()
=
firebaseAnalytics
.
logEvent
(
"open_admin"
,
null
)
override
fun
logResetPassword
(
resetPasswordSucceeded
:
Boolean
)
=
firebaseAnalytics
.
logEvent
(
"reset_password"
,
Bundle
(
1
).
apply
{
putBoolean
(
"resetPasswordSucceeded"
,
resetPasswordSucceeded
)
})
}
}
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