Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
7826f50c
Commit
7826f50c
authored
Aug 13, 2021
by
shiyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
友盟统计开启账号统计,并在奔溃时上传手机号
parent
6db4e0c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
66 deletions
+12
-66
UMConfigUtils.kt
...n/src/main/java/com/yidian/bcommon/utils/UMConfigUtils.kt
+7
-66
LoginLifeCircleActivity.kt
...shenghuoquan/bsetting/ui/login/LoginLifeCircleActivity.kt
+5
-0
No files found.
CommonLib/BCommon/src/main/java/com/yidian/bcommon/utils/UMConfigUtils.kt
View file @
7826f50c
...
...
@@ -2,10 +2,14 @@ package com.yidian.bcommon.utils
import
android.content.Context
import
android.os.Bundle
import
com.orhanobut.hawk.Hawk
import
com.umeng.analytics.MobclickAgent
import
com.umeng.commonsdk.UMConfigure
import
com.umeng.message.entity.UMessage
import
com.umeng.umcrash.UMCrash
import
com.umeng.umcrash.UMCrashCallback
import
com.yidian.bcommon.constant.AppConfig
import
com.yidian.bcommon.constant.HawkConfig
import
com.yidian.bcommon.constant.RunConfig
import
com.yidian.bcommon.constant.XRouterPathConstants
import
com.yidian.xarc.xbase.utils.ChannelUtil
...
...
@@ -35,73 +39,10 @@ class UMConfigUtils {
AppConfig
.
UMTestPushSecret
)
}
//
// // todo 分享设置,需要区分环境
// PlatformConfig.setWeixin(AppConfig.WeChatAppKey, AppConfig.WeChatAppSecret)
// PlatformConfig.setWXFileProvider(AppConfig.FileProvider)
// PlatformConfig.setQQZone(AppConfig.QQAppKey, AppConfig.QQAppSecret)
// PlatformConfig.setQQFileProvider(AppConfig.FileProvider)
// PlatformConfig.setSinaWeibo(AppConfig.SinaAppKey, AppConfig.SinaAppSecret, AppConfig.SinaCallBackUrl)
//
// // todo 推送设置,需要区分环境
// val mPushAgent = PushAgent.getInstance(context)
// mPushAgent.register(object : IUmengRegisterCallback {
// override fun onSuccess(deviceToken: String) {
// //注册成功会返回deviceToken deviceToken是推送消息的唯一标志
// Log.i("umpush", "注册成功:deviceToken:--------> $deviceToken")
// Hawk.put(HawkConfig.UmToken, deviceToken)
// addAlias()
// }
//
// private fun addAlias() {
// val token = ToolsUtil.getYDEncryptionToken()
// mPushAgent.addAlias(token, AppConfig.UMType) { isSuccess, message ->
// Log.d("song_test", "addAlias 绑定成功与否 = $isSuccess message = $message")
// }
// }
//
// override fun onFailure(s: String, s1: String) {
// Log.e("umpush", "注册失败:--------> s:$s,s1:$s1")
// }
// })
//
// // 接收自定义消息
// val messageHandler = object : UmengMessageHandler() {
// override fun dealWithCustomMessage(p0: Context?, p1: UMessage?) {
// super.dealWithCustomMessage(p0, p1)
// Log.e("umpush", "dealWithCustomMessage接收自定义消息:--------> ${p1!!.custom}")
// }
// }
//
// val notificationClickHandler: UmengNotificationClickHandler = object : UmengNotificationClickHandler() {
// override fun dealWithCustomAction(context: Context, msg: UMessage) {
// super.dealWithCustomAction(context, msg)
// Toast.makeText(context, msg.custom, Toast.LENGTH_LONG).show()
// Log.e("umpush", "dealWithCustomAction接收消息:--------> ${msg.custom}")
// }
//
// override fun launchApp(p0: Context?, p1: UMessage?) {
// super.launchApp(p0, p1)
// goToJump(p1)
// }
//
// override fun openUrl(p0: Context?, p1: UMessage?) {
// super.openUrl(p0, p1)
// Log.e("umpush", "openUrl接收自定义消息:--------> ${p1!!.custom}")
// }
//
// override fun openActivity(p0: Context?, p1: UMessage?) {
// super.openActivity(p0, p1)
// Log.e("umpush", "openActivity接收自定义消息:--------> ${p1!!.custom}")
// }
//
//
// }
// mPushAgent.notificationClickHandler = notificationClickHandler
// mPushAgent.messageHandler = messageHandler
//选择AUTO页面采集模式,统计SDK基础指标无需手动埋点可自动采集。建议在宿主App的Application.onCreate函数中调用此函数。
MobclickAgent
.
setPageCollectionMode
(
MobclickAgent
.
PageMode
.
AUTO
);
MobclickAgent
.
setPageCollectionMode
(
MobclickAgent
.
PageMode
.
AUTO
)
// 友盟崩溃的回调,上传手机号
UMCrash
.
registerUMCrashCallback
{
Hawk
.
get
(
HawkConfig
.
Mobile
,
""
)
}
}
private
fun
goToJump
(
p1
:
UMessage
?)
{
...
...
Components/BSetting/src/main/java/com/yidian/shenghuoquan/bsetting/ui/login/LoginLifeCircleActivity.kt
View file @
7826f50c
...
...
@@ -4,6 +4,7 @@ import android.os.Bundle
import
android.view.View
import
androidx.core.content.ContextCompat
import
com.orhanobut.hawk.Hawk
import
com.umeng.analytics.MobclickAgent
import
com.yidian.bcommon.constant.AppConfig
import
com.yidian.bcommon.constant.HawkConfig
import
com.yidian.bcommon.constant.XRouterPathConstants.Companion.LOGIN_LIFE_CIRCLE
...
...
@@ -142,6 +143,8 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>(), View.OnFoc
Hawk
.
put
(
HawkConfig
.
Mobile
,
loginResponse
.
mobile
)
Hawk
.
put
(
HawkConfig
.
Nickname
,
loginResponse
.
nick_name
)
Hawk
.
put
(
HawkConfig
.
Avatar
,
loginResponse
.
avatar
)
// 上传用户id到友盟
MobclickAgent
.
onProfileSignIn
(
loginResponse
.
user_id
.
toString
())
// 登录成功后请求生活号列表接口
ZapTicket
(
ZapServiceNameConstants
.
LifeNumberListService
).
withAction
(
ZapServiceActionConstants
.
ActionRequestList
)
.
onResult
{
result
->
...
...
@@ -181,6 +184,8 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>(), View.OnFoc
Hawk
.
put
(
HawkConfig
.
LoginStatus
,
false
)
// 生活号id
StorageUtil
.
deleteLifeAccountId
()
// 友盟账号统计退出
MobclickAgent
.
onProfileSignOff
()
// 通过服务 清除内存中的认证数据
ZapTicket
(
ZapServiceNameConstants
.
LifeNumberListService
)
.
withAction
(
ZapServiceActionConstants
.
ActionClearAuthenticationData
)
...
...
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