Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
M
magicbox
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
magicbox
Commits
18372f31
Commit
18372f31
authored
Apr 02, 2022
by
王雪伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[提交人]:王雪伟
[提交简述] :加入上报事件戳 [实现方案] :
parent
e3d59db6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
154 additions
and
21 deletions
+154
-21
Appli.kt
app/src/main/java/com/zhangxin/magicbox/Appli.kt
+1
-1
version.properties
app/version.properties
+2
-2
GooglePayHelper.kt
cms/src/main/java/com/zxhl/cms/googlepay/GooglePayHelper.kt
+137
-10
PayActivity.kt
cms/src/main/java/com/zxhl/cms/pay/PayActivity.kt
+6
-1
EventUtils.kt
cms/src/main/java/com/zxhl/cms/utils/EventUtils.kt
+8
-7
No files found.
app/src/main/java/com/zhangxin/magicbox/Appli.kt
View file @
18372f31
...
@@ -48,7 +48,7 @@ class Appli : Application() {
...
@@ -48,7 +48,7 @@ class Appli : Application() {
val
afDevKey
=
"bbVuECGrv5oci77w97NMVg"
val
afDevKey
=
"bbVuECGrv5oci77w97NMVg"
val
appsflyer
:
AppsFlyerLib
=
AppsFlyerLib
.
getInstance
()
val
appsflyer
:
AppsFlyerLib
=
AppsFlyerLib
.
getInstance
()
// For debug - remove in production
// For debug - remove in production
appsflyer
.
setDebugLog
(
tru
e
)
appsflyer
.
setDebugLog
(
fals
e
)
//optional
//optional
appsflyer
.
setMinTimeBetweenSessions
(
0
)
appsflyer
.
setMinTimeBetweenSessions
(
0
)
appsflyer
.
init
(
afDevKey
,
null
,
this
)
appsflyer
.
init
(
afDevKey
,
null
,
this
)
...
...
app/version.properties
View file @
18372f31
PACKAGE_NAME
=
com.zhangxin.magicbox
PACKAGE_NAME
=
com.zhangxin.magicbox
VERSION_CODE
=
13
VERSION_CODE
=
14
VERSION_NAME
=
1.0.3.5
VERSION_NAME
=
1.0.3.6
\ No newline at end of file
\ No newline at end of file
cms/src/main/java/com/zxhl/cms/googlepay/GooglePayHelper.kt
View file @
18372f31
This diff is collapsed.
Click to expand it.
cms/src/main/java/com/zxhl/cms/pay/PayActivity.kt
View file @
18372f31
...
@@ -282,7 +282,6 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -282,7 +282,6 @@ class PayActivity : BaseActivity(), PayContract.View,
EventUtils
.
onEvent
(
"pay_fail"
)
EventUtils
.
onEvent
(
"pay_fail"
)
mLoading
?.
setResult
(
false
,
"Pay for failure"
,
1000
)
mLoading
?.
setResult
(
false
,
"Pay for failure"
,
1000
)
}
}
}
}
fun
setBootmPrice
()
{
fun
setBootmPrice
()
{
...
@@ -516,15 +515,18 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -516,15 +515,18 @@ class PayActivity : BaseActivity(), PayContract.View,
var
googlePay
:
GooglePayHelper
?
=
null
var
googlePay
:
GooglePayHelper
?
=
null
private
fun
googlePay
(
goodsId
:
String
)
{
private
fun
googlePay
(
goodsId
:
String
)
{
if
(
goodsId
==
""
)
{
if
(
goodsId
==
""
)
{
EventUtils
.
onEvent
(
"GooglePayGoodsIdNull"
)
return
return
}
}
mLoading
?.
setLoading
(
getString
(
R
.
string
.
wait_ing2
))
mLoading
?.
setLoading
(
getString
(
R
.
string
.
wait_ing2
))
mLoading
?.
show
()
mLoading
?.
show
()
EventUtils
.
onEvent
(
"GooglePayStart"
,
"开始支付"
)
googlePay
?.
googlePay
(
goodsId
,
"6"
,
object
:
GooglePayCallBack
{
googlePay
?.
googlePay
(
goodsId
,
"6"
,
object
:
GooglePayCallBack
{
override
fun
onPaySuccess
(
purchase
:
GooglePayResult
,
googleJson
:
String
)
{
override
fun
onPaySuccess
(
purchase
:
GooglePayResult
,
googleJson
:
String
)
{
mPresenter
?.
verifyPay
(
googleJson
,
GOOGLE_PAY
)
mPresenter
?.
verifyPay
(
googleJson
,
GOOGLE_PAY
)
//mLoading?.setResult(true, "Pay for success", 1000)
//mLoading?.setResult(true, "Pay for success", 1000)
EventUtils
.
onEvent
(
"GooglePaySuccess"
)
EventUtils
.
onEvent
(
"GooglePaySuccess"
)
EventUtils
.
onEvent
(
"GooglePayEnd"
,
"支付结束_成功"
)
}
}
override
fun
onCancel
()
{
override
fun
onCancel
()
{
...
@@ -532,6 +534,7 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -532,6 +534,7 @@ class PayActivity : BaseActivity(), PayContract.View,
mLoading
?.
setResult
(
false
,
"pay cancel"
,
1000
)
mLoading
?.
setResult
(
false
,
"pay cancel"
,
1000
)
}
}
EventUtils
.
onEvent
(
"GooglePayCancel"
)
EventUtils
.
onEvent
(
"GooglePayCancel"
)
EventUtils
.
onEvent
(
"GooglePayEnd"
,
"支付结束_取消"
)
}
}
override
fun
onError
(
error
:
String
)
{
override
fun
onError
(
error
:
String
)
{
...
@@ -540,6 +543,8 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -540,6 +543,8 @@ class PayActivity : BaseActivity(), PayContract.View,
mLoading
?.
setResult
(
false
,
"pay error"
,
1000
)
mLoading
?.
setResult
(
false
,
"pay error"
,
1000
)
}
}
EventUtils
.
onEvent
(
"GooglePayError"
,
error
)
EventUtils
.
onEvent
(
"GooglePayError"
,
error
)
EventUtils
.
onEvent
(
"GooglePayEnd"
,
"支付结束_异常 msg:${error}"
)
}
}
})
})
}
}
...
...
cms/src/main/java/com/zxhl/cms/utils/EventUtils.kt
View file @
18372f31
...
@@ -39,20 +39,21 @@ object EventUtils {
...
@@ -39,20 +39,21 @@ object EventUtils {
fun
onEvent
(
action
:
String
)
{
fun
onEvent
(
action
:
String
)
{
val
jsonObj
=
getJSON
(
action
)
val
jsonObj
=
getJSON
(
action
)
jsonObj
.
put
(
"time"
,
"${System.currentTimeMillis()}"
)
apiClient
(
jsonObj
)
apiClient
(
jsonObj
)
appFlayerEvent
(
action
,
""
)
appFlayerEvent
(
action
,
jsonObj
)
// MobclickAgent.onEvent(AppContext.get(), action)
// MobclickAgent.onEvent(AppContext.get(), action)
}
}
fun
onEvent
(
action
:
String
,
value
:
String
)
{
fun
onEvent
(
action
:
String
,
value
:
String
)
{
val
jsonObj
=
getJSON
(
action
)
val
jsonObj
=
getJSON
(
action
)
jsonObj
.
put
(
"value"
,
value
)
jsonObj
.
put
(
"value"
,
value
)
jsonObj
.
put
(
"time"
,
"${System.currentTimeMillis()}"
)
apiClient
(
jsonObj
)
apiClient
(
jsonObj
)
appFlayerEvent
(
action
,
value
)
appFlayerEvent
(
action
,
jsonObj
)
// MobclickAgent.onEvent(AppContext.get(), action, value)
// MobclickAgent.onEvent(AppContext.get(), action, value)
}
}
// /**
// /**
// * 统计新用户首次登陆 男女生
// * 统计新用户首次登陆 男女生
// */
// */
...
@@ -73,9 +74,9 @@ object EventUtils {
...
@@ -73,9 +74,9 @@ object EventUtils {
private
fun
apiClient
(
data
:
JSONObject
)
{
private
fun
apiClient
(
data
:
JSONObject
)
{
val
str
=
data
.
toString
()
val
str
=
data
.
toString
()
Log
.
d
(
"EventUtils"
,
str
)
//
Log.d("EventUtils", str)
val
key
=
AESUtils
.
encrypt
(
str
)
val
key
=
AESUtils
.
encrypt
(
str
)
Log
.
d
(
"EventUtils"
,
key
)
//
Log.d("EventUtils", key)
EventApiClient
.
cfgApi
.
requestEvent
(
"behavior"
,
key
).
subscribeOn
(
Schedulers
.
io
())
EventApiClient
.
cfgApi
.
requestEvent
(
"behavior"
,
key
).
subscribeOn
(
Schedulers
.
io
())
.
subscribe
(
object
:
Observer
<
Any
>
{
.
subscribe
(
object
:
Observer
<
Any
>
{
override
fun
onComplete
()
{
override
fun
onComplete
()
{
...
@@ -117,9 +118,9 @@ object EventUtils {
...
@@ -117,9 +118,9 @@ object EventUtils {
}
}
fun
appFlayerEvent
(
action
:
String
,
value
:
String
)
{
fun
appFlayerEvent
(
action
:
String
,
data
:
JSONObject
)
{
var
eventValues
=
HashMap
<
String
,
Any
>()
var
eventValues
=
HashMap
<
String
,
Any
>()
eventValues
[
action
]
=
value
eventValues
[
action
]
=
data
.
toString
()
AppsFlyerLib
.
getInstance
().
logEvent
(
AppContext
.
get
(),
action
,
eventValues
,
object
:
AppsFlyerRequestListener
{
AppsFlyerLib
.
getInstance
().
logEvent
(
AppContext
.
get
(),
action
,
eventValues
,
object
:
AppsFlyerRequestListener
{
override
fun
onSuccess
()
{
override
fun
onSuccess
()
{
Log
.
e
(
"appsflyer"
,
"onSuccess"
)
Log
.
e
(
"appsflyer"
,
"onSuccess"
)
...
...
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