引入极光
This commit is contained in:
parent
619042ae83
commit
3fabb4df22
@ -165,4 +165,6 @@ dependencies {
|
||||
implementation 'com.umeng.umsdk:uverify-crashshield:2.1.4'// 必选
|
||||
//推送
|
||||
implementation 'com.umeng.umsdk:push:6.6.3'// 必选
|
||||
|
||||
implementation 'cn.jiguang.sdk:jpush:5.3.1'
|
||||
}
|
@ -11,9 +11,14 @@ import com.dahe.gldriver.R
|
||||
import com.dahe.gldriver.net.Api
|
||||
import com.dahe.gldriver.oss.OssServiceUtil
|
||||
import com.dahe.gldriver.push.PushHelper
|
||||
import com.dahe.gldriver.ui.HomeActivity
|
||||
import com.dahe.gldriver.utils.OrderUtils
|
||||
import com.dahe.mylibrary.CommonBaseLibrary
|
||||
import com.dahe.mylibrary.utils.AppUtils
|
||||
import com.github.gzuliyujiang.dialog.DialogConfig
|
||||
import com.github.gzuliyujiang.dialog.DialogStyle
|
||||
import com.gyf.cactus.Cactus
|
||||
import com.gyf.cactus.callback.CactusBackgroundCallback
|
||||
import com.tencent.bugly.crashreport.CrashReport
|
||||
import com.umeng.commonsdk.UMConfigure
|
||||
import com.umeng.message.PushAgent
|
||||
@ -49,39 +54,39 @@ class App : Application() {
|
||||
// EsignSdk.getInstance().init(AppConfig.E_KEY, AppConfig.E_LICENSE)
|
||||
initUmeng()
|
||||
|
||||
// var pendingIntent: PendingIntent = getActivity(
|
||||
// applicationContext, 0,
|
||||
// Intent(applicationContext, HomeActivity::class.java),
|
||||
// FLAG_UPDATE_CURRENT
|
||||
// )
|
||||
// Cactus.instance
|
||||
// .isDebug(true)
|
||||
// //.setTitle("大河好运")
|
||||
//// .setContent("大河好运司机端为您提供服务")
|
||||
//// .setSmallIcon(R.mipmap.app_icon)
|
||||
//// .setChannelId(AppUtils.getAppPackageName())
|
||||
//// .setChannelName(AppUtils.getAppPackageName())
|
||||
// //可选,设置通知栏点击事件
|
||||
// .setPendingIntent(pendingIntent)
|
||||
// .setBackgroundMusicEnabled(true)//可选,退到后台是否可以播放音乐
|
||||
//// .setMusicInterval(20000)//设置音乐间隔时间,时间间隔越长,越省电,默认间隔时间是0
|
||||
var pendingIntent: PendingIntent = getActivity(
|
||||
applicationContext, 0,
|
||||
Intent(applicationContext, HomeActivity::class.java),
|
||||
FLAG_UPDATE_CURRENT
|
||||
)
|
||||
Cactus.instance
|
||||
.isDebug(true)
|
||||
.setTitle("大河好运")
|
||||
.setContent("大河好运司机端为您提供服务")
|
||||
.setSmallIcon(R.mipmap.app_icon)
|
||||
.setChannelId(AppUtils.getAppPackageName())
|
||||
.setChannelName(AppUtils.getAppPackageName())
|
||||
//可选,设置通知栏点击事件
|
||||
.setPendingIntent(pendingIntent)
|
||||
.setBackgroundMusicEnabled(true)//可选,退到后台是否可以播放音乐
|
||||
.setMusicInterval(20000)//设置音乐间隔时间,时间间隔越长,越省电,默认间隔时间是0
|
||||
// .setMusicId(R.raw.main) //可选,设置音乐
|
||||
//// .addCallback(new CactusCallback())//可选,运行时回调
|
||||
//// .setCrashRestartUIEnabled(true) //可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
|
||||
//// .setNotification(MyNotification.getInstance().getNotification(this))
|
||||
// .hideNotificationAfterO(true)
|
||||
// .addCallback {
|
||||
// OrderUtils.getInstance().upLocation(applicationContext)
|
||||
// }
|
||||
// .addBackgroundCallback(object : CactusBackgroundCallback {
|
||||
//
|
||||
// override fun onBackground(background: Boolean) {
|
||||
// if (background) {
|
||||
//// getBillLocation();
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// .register(this)
|
||||
// .addCallback(new CactusCallback())//可选,运行时回调
|
||||
// .setCrashRestartUIEnabled(true) //可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
|
||||
// .setNotification(MyNotification.getInstance().getNotification(this))
|
||||
.hideNotificationAfterO(true)
|
||||
.addCallback {
|
||||
OrderUtils.getInstance().upLocation(applicationContext)
|
||||
}
|
||||
.addBackgroundCallback(object : CactusBackgroundCallback {
|
||||
|
||||
override fun onBackground(background: Boolean) {
|
||||
if (background) {
|
||||
// getBillLocation();
|
||||
}
|
||||
}
|
||||
})
|
||||
.register(this)
|
||||
}
|
||||
|
||||
override fun attachBaseContext(base: Context) {
|
||||
|
@ -63,28 +63,28 @@ class UpLocationService2 : Service() {
|
||||
}
|
||||
|
||||
//获取文件输出路径
|
||||
// val path = Environment.getExternalStorageDirectory()
|
||||
// .toString() + "/crashinfo/"
|
||||
// val time: String = formatter.format(Date())
|
||||
// val time2: String = formatter2.format(Date())
|
||||
// val fileName = "crash-$time.txt"
|
||||
//
|
||||
// GDLocationUtils.instance.getLocation2(application) {
|
||||
// if (it.errorCode == 0 && it.latitude != 0.0) {
|
||||
// FileIOUtils.writeFileFromString(
|
||||
// path + fileName,
|
||||
// """当前时间:${time2},经纬度:${it.latitude}:${it.longitude}""",
|
||||
// true
|
||||
// )
|
||||
//
|
||||
// } else {
|
||||
// FileIOUtils.writeFileFromString(
|
||||
// path + fileName,
|
||||
// """当前时间:${time2},经纬度:${it.latitude}${it.errorInfo}""",
|
||||
// true
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
val path = Environment.getExternalStorageDirectory()
|
||||
.toString() + "/crashinfo/"
|
||||
val time: String = formatter.format(Date())
|
||||
val time2: String = formatter2.format(Date())
|
||||
val fileName = "crash-$time.txt"
|
||||
|
||||
GDLocationUtils.instance.getLocation2(application) {
|
||||
if (it.errorCode == 0 && it.latitude != 0.0) {
|
||||
FileIOUtils.writeFileFromString(
|
||||
path + fileName,
|
||||
"""当前时间:${time2},经纬度:${it.latitude}:${it.longitude}""",
|
||||
true
|
||||
)
|
||||
|
||||
} else {
|
||||
FileIOUtils.writeFileFromString(
|
||||
path + fileName,
|
||||
"""当前时间:${time2},经纬度:${it.latitude}${it.errorInfo}""",
|
||||
true
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -103,6 +103,7 @@ class UpLocationService2 : Service() {
|
||||
}
|
||||
|
||||
private val timeSum = 1000 * 60 * 3
|
||||
// private val timeSum = 1000 * 30
|
||||
|
||||
// private val timeSum = 3000
|
||||
private var timer: Timer? = null
|
||||
|
@ -170,6 +170,8 @@ class EditPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UserDetail>() {
|
||||
override fun onSuccess(t: CommonResponseBean<UserDetail>) {
|
||||
super.onSuccess(t)
|
||||
if (t.data==null)
|
||||
return
|
||||
perInfoBean = t.data
|
||||
var isOnlyShow =
|
||||
intent.extras?.getBoolean(AppConfig.IS_ONLY_SHOW, false) == true
|
||||
|
Loading…
Reference in New Issue
Block a user