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
006d0fde
Commit
006d0fde
authored
Aug 11, 2021
by
chengkun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加友盟统计api调用
parent
94ea343d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
65 additions
and
15 deletions
+65
-15
build.gradle
Components/BPush/build.gradle
+2
-0
BPush.kt
...src/main/java/com/yidian/shenghuoquan/bpush/base/BPush.kt
+6
-8
UmengPushPolicy.java
...ghuoquan/bpush/push/umengpush/helper/UmengPushPolicy.java
+2
-2
UmengshareUtils.kt
...yidian/shenghuoquan/bpush/push/umshare/UmengshareUtils.kt
+53
-0
ViVoPushPolicy.kt
...yidian/shenghuoquan/bpush/push/vivopush/ViVoPushPolicy.kt
+1
-1
BusinessApplication.kt
...ain/java/com/shenghuoquan/business/BusinessApplication.kt
+0
-3
config.gradle
config/config.gradle
+1
-1
No files found.
Components/BPush/build.gradle
View file @
006d0fde
...
@@ -70,4 +70,6 @@ dependencies {
...
@@ -70,4 +70,6 @@ dependencies {
implementation
rootProject
.
ext
.
dependencies
.
publicImplementation
implementation
rootProject
.
ext
.
dependencies
.
publicImplementation
testImplementation
rootProject
.
ext
.
dependencies
.
testImplementation
testImplementation
rootProject
.
ext
.
dependencies
.
testImplementation
androidTestImplementation
rootProject
.
ext
.
dependencies
.
androidTestImplementation
androidTestImplementation
rootProject
.
ext
.
dependencies
.
androidTestImplementation
implementation
'com.huawei.hms:push:5.3.0.304'
}
}
\ No newline at end of file
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/base/BPush.kt
View file @
006d0fde
...
@@ -8,11 +8,11 @@ import com.yidian.shenghuoquan.bpush.push.PushSdkManager
...
@@ -8,11 +8,11 @@ import com.yidian.shenghuoquan.bpush.push.PushSdkManager
import
com.yidian.shenghuoquan.bpush.push.huaweipush.HuaWeiPushPolicy
import
com.yidian.shenghuoquan.bpush.push.huaweipush.HuaWeiPushPolicy
import
com.yidian.shenghuoquan.bpush.push.mipush.MiPushPolicy
import
com.yidian.shenghuoquan.bpush.push.mipush.MiPushPolicy
import
com.yidian.shenghuoquan.bpush.push.oppopush.OppoPushPolicy
import
com.yidian.shenghuoquan.bpush.push.oppopush.OppoPushPolicy
import
com.yidian.shenghuoquan.bpush.push.umengpush.UmengPushPolicy
import
com.yidian.shenghuoquan.bpush.push.umengpush.helper.UmengPushPolicy
import
com.yidian.shenghuoquan.bpush.push.umengpush.helper.PushHelper
import
com.yidian.shenghuoquan.bpush.push.vivopush.ViVoPushPolicy
import
com.yidian.shenghuoquan.bpush.push.vivopush.ViVoPushPolicy
import
com.yidian.shenghuoquan.bpush.utils.SystemUtil
import
com.yidian.shenghuoquan.bpush.utils.SystemUtil
import
timber.log.Timber
import
timber.log.Timber
import
java.util.*
class
BPush
{
class
BPush
{
private
lateinit
var
pushSdkManager
:
PushSdkManager
private
lateinit
var
pushSdkManager
:
PushSdkManager
...
@@ -20,11 +20,11 @@ class BPush {
...
@@ -20,11 +20,11 @@ class BPush {
// 开关
// 开关
UMConfigure
.
setLogEnabled
(
true
)
UMConfigure
.
setLogEnabled
(
true
)
//预初始化
//预初始化
PushHelper
.
preInit
(
context
)
UmengPushPolicy
.
preInit
(
context
)
//正式初始化
//正式初始化
if
(
PushHelper
.
isMainProcess
(
context
))
{
if
(
UmengPushPolicy
.
isMainProcess
(
context
))
{
//建议在线程中执行初始化
//建议在线程中执行初始化
Thread
{
PushHelper
.
init
(
context
)
}.
start
()
Thread
{
UmengPushPolicy
.
init
(
context
)
}.
start
()
}
}
initPlatformPush
()
initPlatformPush
()
}
}
...
@@ -34,6 +34,7 @@ class BPush {
...
@@ -34,6 +34,7 @@ class BPush {
Timber
.
tag
(
"BPush"
).
i
(
"push sdk has initiallized"
)
Timber
.
tag
(
"BPush"
).
i
(
"push sdk has initiallized"
)
return
return
}
}
Timber
.
tag
(
"BPush"
).
i
(
"brand is ${SystemUtil.getDeviceBrand()}"
)
when
(
SystemUtil
.
getDeviceBrand
())
{
when
(
SystemUtil
.
getDeviceBrand
())
{
BrandConstant
.
HUAWEI
->
{
BrandConstant
.
HUAWEI
->
{
pushSdkManager
=
PushSdkManager
(
HuaWeiPushPolicy
())
pushSdkManager
=
PushSdkManager
(
HuaWeiPushPolicy
())
...
@@ -47,9 +48,6 @@ class BPush {
...
@@ -47,9 +48,6 @@ class BPush {
BrandConstant
.
XIAOMI
->
{
BrandConstant
.
XIAOMI
->
{
pushSdkManager
=
PushSdkManager
(
MiPushPolicy
())
pushSdkManager
=
PushSdkManager
(
MiPushPolicy
())
}
}
else
->
{
pushSdkManager
=
PushSdkManager
(
UmengPushPolicy
())
}
}
}
pushSdkManager
.
initSpecealSdk
()
pushSdkManager
.
initSpecealSdk
()
}
}
...
...
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/push/umengpush/helper/
PushHelper
.java
→
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/push/umengpush/helper/
UmengPushPolicy
.java
View file @
006d0fde
...
@@ -19,9 +19,9 @@ import com.umeng.message.entity.UMessage;
...
@@ -19,9 +19,9 @@ import com.umeng.message.entity.UMessage;
/**
/**
* PushSDK集成帮助类
* PushSDK集成帮助类
*/
*/
public
class
PushHelper
{
public
class
UmengPushPolicy
{
private
static
final
String
TAG
=
PushHelper
.
class
.
getSimpleName
();
private
static
final
String
TAG
=
UmengPushPolicy
.
class
.
getSimpleName
();
/**
/**
* 预初始化,已添加子进程中初始化sdk。
* 预初始化,已添加子进程中初始化sdk。
...
...
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/push/umshare/UmengshareUtils.kt
0 → 100644
View file @
006d0fde
package
com.yidian.shenghuoquan.bpush.push.umshare
import
android.app.Activity
import
android.widget.Toast
import
com.umeng.socialize.UMAuthListener
import
com.umeng.socialize.UMShareAPI
import
com.umeng.socialize.bean.SHARE_MEDIA
import
com.umeng.socialize.tracker.TrackerManager
import
com.umeng.socialize.tracker.TrackerResultHandler
import
com.yidian.shenghuoquan.bpush.app.BPushApplication
import
com.yidian.utils.ToastUtil
object
UmengshareUtils
{
fun
authLogin
(
activity
:
Activity
,
platform
:
SHARE_MEDIA
):
Map
<
String
,
String
>
{
var
authMap
:
Map
<
String
,
String
>
=
HashMap
()
UMShareAPI
.
get
(
activity
).
getPlatformInfo
(
activity
,
platform
,
object
:
UMAuthListener
{
override
fun
onStart
(
share_media
:
SHARE_MEDIA
)
{}
override
fun
onComplete
(
share_media
:
SHARE_MEDIA
,
i
:
Int
,
map
:
Map
<
String
,
String
>)
{
authMap
=
map
}
override
fun
onError
(
share_media
:
SHARE_MEDIA
,
i
:
Int
,
throwable
:
Throwable
)
{
ToastUtil
.
showToast
(
activity
,
throwable
.
message
)
}
override
fun
onCancel
(
share_media
:
SHARE_MEDIA
,
i
:
Int
)
{
ToastUtil
.
showToast
(
activity
,
"用户已取消"
)
}
})
return
authMap
}
fun
personStatistic
()
{
val
webUrl
=
"http://mobile.umeng.com/social"
val
appContext
=
BPushApplication
.
context
.
applicationContext
val
umid
=
TrackerManager
.
getUMID
(
appContext
)
if
(
umid
==
""
)
{
Toast
.
makeText
(
appContext
,
"UMID获取失败,请稍后重试!"
,
Toast
.
LENGTH_LONG
).
show
()
return
}
TrackerManager
.
requestTrackerCode
(
appContext
,
"5a12384aa40fa3551f0001d1"
,
umid
,
webUrl
,
"1235681"
,
null
,
object
:
TrackerResultHandler
{
override
fun
codeGenerateSuccess
(
content
:
String
)
{}
override
fun
codeGenerateFailed
(
t
:
Throwable
)
{}
})
}
}
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/push/vivopush/ViVoPushPolicy.kt
View file @
006d0fde
...
@@ -15,7 +15,7 @@ class ViVoPushPolicy: PushPolicy() {
...
@@ -15,7 +15,7 @@ class ViVoPushPolicy: PushPolicy() {
}
}
var
token
:
String
=
""
var
token
:
String
=
""
override
fun
initPushSdk
()
{
override
fun
initPushSdk
()
{
Timber
.
tag
(
"Vi
v
oPushPolicy"
).
i
(
"initPushSdk"
)
Timber
.
tag
(
"Vi
V
oPushPolicy"
).
i
(
"initPushSdk"
)
PushClient
.
getInstance
(
BPushApplication
.
context
).
initialize
()
PushClient
.
getInstance
(
BPushApplication
.
context
).
initialize
()
PushClient
.
getInstance
(
BPushApplication
.
context
).
turnOnPush
(
IPushActionListener
{
PushClient
.
getInstance
(
BPushApplication
.
context
).
turnOnPush
(
IPushActionListener
{
Timber
.
tag
(
"ViVoPushPolicy"
).
i
(
"state is $it"
)
Timber
.
tag
(
"ViVoPushPolicy"
).
i
(
"state is $it"
)
...
...
app/src/main/java/com/shenghuoquan/business/BusinessApplication.kt
View file @
006d0fde
...
@@ -5,7 +5,6 @@ import android.content.Context
...
@@ -5,7 +5,6 @@ import android.content.Context
import
android.content.res.Configuration
import
android.content.res.Configuration
import
android.os.Bundle
import
android.os.Bundle
import
com.orhanobut.hawk.Hawk
import
com.orhanobut.hawk.Hawk
import
com.umeng.commonsdk.UMConfigure
import
com.yidian.bcommon.app.YdBaseApplication
import
com.yidian.bcommon.app.YdBaseApplication
import
com.yidian.bcommon.http.ApiSaveCookiesInterceptor
import
com.yidian.bcommon.http.ApiSaveCookiesInterceptor
import
com.yidian.bcommon.http.ApiSetCookiesInterceptor
import
com.yidian.bcommon.http.ApiSetCookiesInterceptor
...
@@ -16,8 +15,6 @@ import com.yidian.bcommon.services.XPageService
...
@@ -16,8 +15,6 @@ import com.yidian.bcommon.services.XPageService
import
com.yidian.commonutil.CommonUtilLifecycleModule
import
com.yidian.commonutil.CommonUtilLifecycleModule
import
com.yidian.http.ServiceFactory
import
com.yidian.http.ServiceFactory
import
com.yidian.news.util.ProcessUtil
import
com.yidian.news.util.ProcessUtil
import
com.yidian.shenghuoquan.bpush.base.BPush
import
com.yidian.shenghuoquan.bpush.push.umengpush.helper.PushHelper
import
com.yidian.xpage.XPageManager
import
com.yidian.xpage.XPageManager
import
com.yidian.yac.core.core.YacAppSpec
import
com.yidian.yac.core.core.YacAppSpec
import
com.yidian.yac.core.zap.Zap
import
com.yidian.yac.core.zap.Zap
...
...
config/config.gradle
View file @
006d0fde
...
@@ -122,6 +122,7 @@ ext.dependencies = [
...
@@ -122,6 +122,7 @@ ext.dependencies = [
'com.umeng.umsdk:agoo_tlog:3.0.0.17'
,
'com.umeng.umsdk:agoo_tlog:3.0.0.17'
,
// 消息推送网络核心库,必须添加
// 消息推送网络核心库,必须添加
'com.umeng.umsdk:agoo_tnet4android:3.1.14.10'
,
'com.umeng.umsdk:agoo_tnet4android:3.1.14.10'
,
'com.umeng.umsdk:link:1.1.0'
,
'com.github.tbruyelle:rxpermissions:0.12'
,
'com.github.tbruyelle:rxpermissions:0.12'
,
'io.reactivex.rxjava3:rxandroid:3.0.0'
,
'io.reactivex.rxjava3:rxandroid:3.0.0'
,
...
@@ -141,7 +142,6 @@ ext.dependencies = [
...
@@ -141,7 +142,6 @@ ext.dependencies = [
'io.github.lucksiege:pictureselector:v2.7.3-rc05'
,
'io.github.lucksiege:pictureselector:v2.7.3-rc05'
,
// Compressor https://github.com/zetbaitsu/Compressor
// Compressor https://github.com/zetbaitsu/Compressor
'id.zelory:compressor:3.0.1'
,
'id.zelory:compressor:3.0.1'
,
'com.huawei.hms:push:5.3.0.304'
],
],
other
:
[
other
:
[
':CommonLib:BCommon'
':CommonLib:BCommon'
...
...
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