diff --git a/app/build.gradle b/app/build.gradle
index 571219a..c6ecfad 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -82,7 +82,7 @@ android {
// app_icon : "@drawable/head_defaut",
JPUSH_PKGNAME: applicationId,
//JPush 上注册的包名对应的 Appkey.
- JPUSH_APPKEY : "5d63ef6fdf58ada352bb8f07",
+ JPUSH_APPKEY : "947f8f011d983fb90279742e",
//暂时填写默认值即可.
JPUSH_CHANNEL: "developer-n"]
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
@@ -97,7 +97,7 @@ android {
// app_icon : "@drawable/ysxy",
JPUSH_PKGNAME: applicationId,
//JPush 上注册的包名对应的 Appkey.
- JPUSH_APPKEY : "5d63ef6fdf58ada352bb8f07",
+ JPUSH_APPKEY : "947f8f011d983fb90279742e",
//暂时填写默认值即可.
JPUSH_CHANNEL: "developer-default"]
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index c56f79b..9b1e9d2 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -476,6 +476,31 @@
android:process=":music_v1" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/com/dahe/gldriver/base/App.kt b/app/src/main/java/com/dahe/gldriver/base/App.kt
index 1b5a1c2..79091e1 100644
--- a/app/src/main/java/com/dahe/gldriver/base/App.kt
+++ b/app/src/main/java/com/dahe/gldriver/base/App.kt
@@ -10,6 +10,8 @@ import android.content.Intent
import android.os.Process
import android.util.Log
import anet.channel.util.Utils.context
+import cn.jiguang.api.utils.JCollectionAuth
+import cn.jpush.android.api.JPushInterface
import com.alct.mdp.MDPLocationCollectionManager
import com.dahe.gldriver.BuildConfig
import com.dahe.gldriver.R
@@ -21,6 +23,7 @@ import com.dahe.gldriver.third.PlayerMusicService
import com.dahe.gldriver.third.SPUtil
import com.dahe.gldriver.ui.HomeActivity
import com.dahe.gldriver.utils.OrderUtils
+import com.dahe.gldriver.utils.SPUtils
import com.dahe.mylibrary.CommonBaseLibrary
import com.dahe.mylibrary.utils.AppUtils
import com.github.gzuliyujiang.dialog.DialogConfig
@@ -54,15 +57,12 @@ class App : Application() {
}
CrashReport.initCrashReport(getApplicationContext(), AppConfig.BUGLY_APP_ID, false);
-
-// SophixManager.getInstance().queryAndLoadNewPatch();
-
OssServiceUtil.getInstance().init();
- //E签宝
-// EsignSdk.getInstance().init(AppConfig.E_KEY, AppConfig.E_LICENSE)
initUmeng()
+ initJpush()
+
initThird()
var pendingIntent: PendingIntent = getActivity(
@@ -198,6 +198,19 @@ class App : Application() {
}
+ private fun initJpush(){
+ if (!SPUtils.instance.getIsFirstOpenApp(applicationContext)){
+ //打开日志开关,发布版本建议关闭
+ JPushInterface.setDebugMode(true)
+
+ //同意隐私政策,同意开启推送业务开关
+ JCollectionAuth.setAuth(this, true)
+ // 初始化SDK
+ // 初始化SDK
+ JPushInterface.init(this)
+ }
+ }
+
companion object {
var app: App? = null
}
diff --git a/app/src/main/java/com/dahe/gldriver/base/AppConfig.kt b/app/src/main/java/com/dahe/gldriver/base/AppConfig.kt
index bf599ed..b4f1438 100644
--- a/app/src/main/java/com/dahe/gldriver/base/AppConfig.kt
+++ b/app/src/main/java/com/dahe/gldriver/base/AppConfig.kt
@@ -28,6 +28,7 @@ object AppConfig {
const val IS_GO_MINE = "DA_HE_GO_MINE"
const val REFRSH = "DA_HE_REFRSH"
const val SUCCESS_TYPE = "DA_HE_SUCCESS_TYPE"
+ const val IS_SHOW_PRIVACY = "IS_SHOW_PRIVACY"
const val E_KEY = "19ac0aa74338e487e45057faf7212401"
const val E_LICENSE = "HF41uGxM/1i3CtW98DimoA97BlNTAnQ+DiEAihYmZ2jR1jqC4be253joEJbOJgFDIzp5aIoeuXSWWHFaDVfaHL2Pksbq5f8M8EqsVhP9q/i1xGYSYf6MJVlHdMAVLWgR0Kra+n8dVzkSDuZeyJuDsskAmZaGFQN1CqnWYCI1tmV1Tk4A57e9LQMed0U11QWjdshdU2DGqBXKmGE419PdW3NmIxOR2u9iB1OKBmvzCUT8RAYyBzSn/yhU++YJ25g5a8Pb5kOvi+eOh+PEFEcQL6oOp/CF4Iw5nadlsLhc+XEnVJpwL2myZBoSlVcKxrJKbRn1/DIgXBueKKnqhyHKdJlpqI9eghAlRF0p2Q4f23m89mWRZf4nhKzTeXGIjCTFO4TNVucrlGU7tyJcrRCDVdfV24fziH+hB3QGckpuYzzjefr7hZalLRJ/w8dPw/8dCY1wnWq3AJ3zw2g1PzMxl51q7AgdKvwc1ERcGBns0zb8PK6vGKCnJq3uHiJEnslbTI0MEosje+h+OPO7hf2QofErewjI19wHEOv4dTvuFLh3VmGFMObAmov5kI47705fjSxCvAPGATBrfUSwim+5EQ1hanc5IcXe0/nOTiRUNEpZ+x65zVydqAs7490yqQiIUQvPazEwcal7vH2OD54lCcgpxKxqdmGc5/bp5UnqB45+n+iuInV/Q9DMOQVk15uaVZmhS8VaCqH21CmfH/ZGLb9wiEpaRLrPZLKX3bK7MT9Z0/OlDnb2QUKU8LMMIhLuQQntzsf0Wn4kA/0e9QAJJQ=="
diff --git a/app/src/main/java/com/dahe/gldriver/push/PushMessageService.java b/app/src/main/java/com/dahe/gldriver/push/PushMessageService.java
new file mode 100644
index 0000000..08bcf6e
--- /dev/null
+++ b/app/src/main/java/com/dahe/gldriver/push/PushMessageService.java
@@ -0,0 +1,122 @@
+package com.dahe.gldriver.push;
+
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+
+import cn.jpush.android.api.CmdMessage;
+import cn.jpush.android.api.CustomMessage;
+import cn.jpush.android.api.JPushInterface;
+import cn.jpush.android.api.JPushMessage;
+import cn.jpush.android.api.NotificationMessage;
+import cn.jpush.android.service.JPushMessageService;
+
+public class PushMessageService extends JPushMessageService {
+ private static final String TAG = "PushMessageService";
+
+ @Override
+ public void onMessage(Context context, CustomMessage customMessage) {
+ Log.e(TAG, "[onMessage] " + customMessage);
+ Intent intent = new Intent("com.jiguang.demo.message");
+ intent.putExtra("msg", customMessage.message);
+ context.sendBroadcast(intent);
+ }
+
+ @Override
+ public void onNotifyMessageOpened(Context context, NotificationMessage message) {
+ Log.e(TAG, "[onNotifyMessageOpened] " + message);
+ try{
+ //打开自定义的Activity
+// Intent i = new Intent(context, TestActivity.class);
+// Bundle bundle = new Bundle();
+// bundle.putString(JPushInterface.EXTRA_NOTIFICATION_TITLE,message.notificationTitle);
+// bundle.putString(JPushInterface.EXTRA_ALERT,message.notificationContent);
+// i.putExtras(bundle);
+// i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP );
+// context.startActivity(i);
+ }catch (Throwable throwable){
+
+ }
+ }
+
+ @Override
+ public void onMultiActionClicked(Context context, Intent intent) {
+ Log.e(TAG, "[onMultiActionClicked] 用户点击了通知栏按钮");
+ String nActionExtra = intent.getExtras().getString(JPushInterface.EXTRA_NOTIFICATION_ACTION_EXTRA);
+
+ //开发者根据不同 Action 携带的 extra 字段来分配不同的动作。
+ if (nActionExtra == null) {
+ Log.d(TAG, "ACTION_NOTIFICATION_CLICK_ACTION nActionExtra is null");
+ return;
+ }
+ if (nActionExtra.equals("my_extra1")) {
+ Log.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮一");
+ } else if (nActionExtra.equals("my_extra2")) {
+ Log.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮二");
+ } else if (nActionExtra.equals("my_extra3")) {
+ Log.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮三");
+ } else {
+ Log.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮未定义");
+ }
+ }
+
+ @Override
+ public void onNotifyMessageArrived(Context context, NotificationMessage message) {
+ Log.e(TAG, "[onNotifyMessageArrived] " + message);
+ }
+
+ @Override
+ public void onNotifyMessageDismiss(Context context, NotificationMessage message) {
+ Log.e(TAG, "[onNotifyMessageDismiss] " + message);
+ }
+
+ @Override
+ public void onRegister(Context context, String registrationId) {
+ Log.e(TAG, "[onRegister] " + registrationId);
+ Intent intent = new Intent("com.jiguang.demo.message");
+ intent.putExtra("rid", registrationId);
+ context.sendBroadcast(intent);
+ }
+
+ @Override
+ public void onConnected(Context context, boolean isConnected) {
+ Log.e(TAG, "[onConnected] " + isConnected);
+ }
+
+ @Override
+ public void onCommandResult(Context context, CmdMessage cmdMessage) {
+ Log.e(TAG, "[onCommandResult] " + cmdMessage);
+ }
+
+ @Override
+ public void onTagOperatorResult(Context context, JPushMessage jPushMessage) {
+ TagAliasOperatorHelper.getInstance().onTagOperatorResult(context,jPushMessage);
+ super.onTagOperatorResult(context, jPushMessage);
+ }
+
+ @Override
+ public void onCheckTagOperatorResult(Context context, JPushMessage jPushMessage) {
+ TagAliasOperatorHelper.getInstance().onCheckTagOperatorResult(context,jPushMessage);
+ super.onCheckTagOperatorResult(context, jPushMessage);
+ }
+
+ @Override
+ public void onAliasOperatorResult(Context context, JPushMessage jPushMessage) {
+ TagAliasOperatorHelper.getInstance().onAliasOperatorResult(context,jPushMessage);
+ super.onAliasOperatorResult(context, jPushMessage);
+ }
+
+ @Override
+ public void onMobileNumberOperatorResult(Context context, JPushMessage jPushMessage) {
+ TagAliasOperatorHelper.getInstance().onMobileNumberOperatorResult(context,jPushMessage);
+ super.onMobileNumberOperatorResult(context, jPushMessage);
+ }
+
+ @Override
+ public void onNotificationSettingsCheck(Context context, boolean isOn, int source) {
+ super.onNotificationSettingsCheck(context, isOn, source);
+ Log.e(TAG, "[onNotificationSettingsCheck] isOn:" + isOn + ",source:" + source);
+ }
+
+}
diff --git a/app/src/main/java/com/dahe/gldriver/push/PushService.java b/app/src/main/java/com/dahe/gldriver/push/PushService.java
new file mode 100644
index 0000000..cffdb12
--- /dev/null
+++ b/app/src/main/java/com/dahe/gldriver/push/PushService.java
@@ -0,0 +1,8 @@
+package com.dahe.gldriver.push;
+
+
+import cn.jpush.android.service.JCommonService;
+
+public class PushService extends JCommonService {
+
+}
diff --git a/app/src/main/java/com/dahe/gldriver/push/TagAliasOperatorHelper.java b/app/src/main/java/com/dahe/gldriver/push/TagAliasOperatorHelper.java
new file mode 100644
index 0000000..ee8db44
--- /dev/null
+++ b/app/src/main/java/com/dahe/gldriver/push/TagAliasOperatorHelper.java
@@ -0,0 +1,105 @@
+package com.dahe.gldriver.push;
+
+import android.content.Context;
+import android.util.Log;
+
+import com.dahe.mylibrary.utils.ToastUtils;
+
+import cn.jpush.android.api.JPushMessage;
+
+/**
+ * 处理tagalias相关的逻辑
+ * */
+public class TagAliasOperatorHelper {
+ private static final String TAG = "JIGUANG-TagAliasHelper";
+
+ private Context context;
+
+ private static TagAliasOperatorHelper mInstance;
+ private TagAliasOperatorHelper(){
+ }
+ public static TagAliasOperatorHelper getInstance(){
+ if(mInstance == null){
+ synchronized (TagAliasOperatorHelper.class){
+ if(mInstance == null){
+ mInstance = new TagAliasOperatorHelper();
+ }
+ }
+ }
+ return mInstance;
+ }
+ public void init(Context context){
+ if(context != null) {
+ this.context = context.getApplicationContext();
+ }
+ }
+
+
+ public void onTagOperatorResult(Context context, JPushMessage jPushMessage) {
+ int sequence = jPushMessage.getSequence();
+ Log.i(TAG,"action - onTagOperatorResult, sequence:"+sequence+",tags:"+jPushMessage.getTags());
+ Log.i(TAG,"tags size:"+jPushMessage.getTags().size());
+ init(context);
+
+ if(jPushMessage.getErrorCode() == 0){
+ Log.i(TAG,"action - modify tag Success,sequence:"+sequence);
+ ToastUtils.showToast(context,"modify success");
+ }else{
+ String logs = "Failed to modify tags";
+ if(jPushMessage.getErrorCode() == 6018){
+ //tag数量超过限制,需要先清除一部分再add
+ logs += ", tags is exceed limit need to clean";
+ }
+ logs += ", errorCode:" + jPushMessage.getErrorCode();
+ Log.e(TAG, logs);
+ ToastUtils.showToast(context,logs);
+ }
+ }
+ public void onCheckTagOperatorResult(Context context, JPushMessage jPushMessage){
+ int sequence = jPushMessage.getSequence();
+ Log.i(TAG,"action - onCheckTagOperatorResult, sequence:"+sequence+",checktag:"+jPushMessage.getCheckTag());
+ init(context);
+ if(jPushMessage.getErrorCode() == 0){
+ String logs = "modify tag "+jPushMessage.getCheckTag() + " bind state success,state:"+jPushMessage.getTagCheckStateResult();
+ Log.i(TAG,logs);
+ ToastUtils.showToast(context,"modify success");
+ }else{
+ String logs = "Failed to modify tags, errorCode:" + jPushMessage.getErrorCode();
+ Log.e(TAG, logs);
+ ToastUtils.showToast(context,logs);
+ }
+ }
+ public void onAliasOperatorResult(Context context, JPushMessage jPushMessage) {
+ int sequence = jPushMessage.getSequence();
+ Log.i(TAG,"action - onAliasOperatorResult, sequence:"+sequence+",alias:"+jPushMessage.getAlias());
+ init(context);
+
+ if(jPushMessage.getErrorCode() == 0){
+ Log.i(TAG,"action - modify alias Success,sequence:"+sequence);
+ ToastUtils.showToast(context,"modify success");
+ }else{
+ String logs = "Failed to modify alias, errorCode:" + jPushMessage.getErrorCode();
+ Log.e(TAG, logs);
+ ToastUtils.showToast(context,logs);
+// MMKV.defaultMMKV().putString(AdvActivity.ALIAS_DATA, "");
+ }
+ }
+ //设置手机号码回调
+ public void onMobileNumberOperatorResult(Context context, JPushMessage jPushMessage) {
+ int sequence = jPushMessage.getSequence();
+ Log.i(TAG,"action - onMobileNumberOperatorResult, sequence:"+sequence+",mobileNumber:"+jPushMessage.getMobileNumber());
+ init(context);
+ if(jPushMessage.getErrorCode() == 0){
+ Log.i(TAG,"action - set mobile number Success,sequence:"+sequence);
+ ToastUtils.showToast(context,"modify success");
+ }else{
+ String logs = "Failed to set mobile number, errorCode:" + jPushMessage.getErrorCode();
+ Log.e(TAG, logs);
+ ToastUtils.showToast(context,logs);
+// MMKV.defaultMMKV().putString(AdvActivity.MN_DATA, "");
+ }
+ }
+
+
+
+}
diff --git a/app/src/main/java/com/dahe/gldriver/ui/LauncherActivity.kt b/app/src/main/java/com/dahe/gldriver/ui/LauncherActivity.kt
index 0f127ce..787abbc 100644
--- a/app/src/main/java/com/dahe/gldriver/ui/LauncherActivity.kt
+++ b/app/src/main/java/com/dahe/gldriver/ui/LauncherActivity.kt
@@ -4,11 +4,12 @@ import android.app.ActivityManager
import android.content.Context
import android.os.Bundle
import android.os.Process
+import cn.jiguang.api.utils.JCollectionAuth
+import cn.jpush.android.api.JPushInterface
import com.alct.mdp.MDPLocationCollectionManager
import com.amap.api.location.AMapLocationClient
import com.amap.api.maps.MapsInitializer
import com.dahe.gldriver.BuildConfig
-import com.dahe.gldriver.base.App
import com.dahe.gldriver.databinding.ActivityLauncherBinding
import com.dahe.gldriver.third.JTTProcess
import com.dahe.gldriver.third.SPUtil
@@ -56,6 +57,7 @@ class LauncherActivity : BaseActivity() {
AMapLocationClient.updatePrivacyAgree(mContext, true)
MapsInitializer.updatePrivacyAgree(this, true)
initThird()
+ initPush()
goNext()
}
} else {
@@ -70,7 +72,10 @@ class LauncherActivity : BaseActivity() {
//安联初始化
if (packageName == getCurrentProcessName(this)) {
//Log.e("--使用的测试环境--",BuildConfig.OPEN_API_URL);
- MDPLocationCollectionManager.initialize(applicationContext, BuildConfig.OPEN_AL_URL)
+ MDPLocationCollectionManager.initialize(
+ applicationContext,
+ BuildConfig.OPEN_AL_URL
+ )
}
//初始化交通厅
JTTProcess.init(application)
@@ -81,6 +86,16 @@ class LauncherActivity : BaseActivity() {
}
}
+ private fun initPush() {
+// if (SPUtils.instance.isShowPrivacy(mContext)) {
+ JCollectionAuth.setAuth(mContext, true)
+ // 初始化SDK
+ JPushInterface.setDebugMode(true)
+ JPushInterface.init(this)
+// }
+
+ }
+
override fun onDestroy() {
super.onDestroy()
mDisposable?.dispose()
diff --git a/app/src/main/java/com/dahe/gldriver/ui/account/authperson/AuthDriverActivity.kt b/app/src/main/java/com/dahe/gldriver/ui/account/authperson/AuthDriverActivity.kt
index a2ed2d9..0c39e3c 100644
--- a/app/src/main/java/com/dahe/gldriver/ui/account/authperson/AuthDriverActivity.kt
+++ b/app/src/main/java/com/dahe/gldriver/ui/account/authperson/AuthDriverActivity.kt
@@ -136,7 +136,7 @@ class AuthDriverActivity : BaseActivity() {
driverInfoBean.licensePhotoFaceUrl = picPath.picPath
it?.run {
driverInfoBean.run {
- licenseRegisterDate = initialIssueDate
+ licenseFirstGetDate = initialIssueDate
licenseApproveOrganization =
issueAuthority //发证机关
}
@@ -170,7 +170,7 @@ class AuthDriverActivity : BaseActivity() {
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
driverInfoBean.licensePhotoBackUrl = picPath.picPath
it?.run {
- driverInfoBean.recordNumber = recordNumber
+ driverInfoBean.licenseRecordNumber = recordNumber
}
}
}
diff --git a/app/src/main/java/com/dahe/gldriver/ui/account/authperson/EditDriverActivity.kt b/app/src/main/java/com/dahe/gldriver/ui/account/authperson/EditDriverActivity.kt
index c3c9e4d..e006f10 100644
--- a/app/src/main/java/com/dahe/gldriver/ui/account/authperson/EditDriverActivity.kt
+++ b/app/src/main/java/com/dahe/gldriver/ui/account/authperson/EditDriverActivity.kt
@@ -161,6 +161,7 @@ class EditDriverActivity : BaseActivity() {
driverInfoBean.licensePhotoFaceUrl = picPath.picPath
it?.run {
driverInfoBean.run {
+ licenseFirstGetDate = initialIssueDate
licenseApproveOrganization =
issueAuthority //发证机关
}
@@ -193,7 +194,9 @@ class EditDriverActivity : BaseActivity() {
ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
driverInfoBean.licensePhotoBackUrl = picPath.picPath
- ToastUtils.showToast(mContext, "驾驶证副页上传成功")
+ it?.run {
+ driverInfoBean.licenseRecordNumber = recordNumber
+ }
}
}
diff --git a/app/src/main/java/com/dahe/gldriver/utils/SPUtils.kt b/app/src/main/java/com/dahe/gldriver/utils/SPUtils.kt
index b188076..e511141 100644
--- a/app/src/main/java/com/dahe/gldriver/utils/SPUtils.kt
+++ b/app/src/main/java/com/dahe/gldriver/utils/SPUtils.kt
@@ -5,7 +5,6 @@ import com.dahe.gldriver.base.AppConfig
import com.dahe.glex.bean.UserBean
import com.dahe.mylibrary.net.JsonUtils
import com.dahe.mylibrary.utils.BaseSPUtils
-import com.google.gson.Gson
/**
* @ClassName SPUtils2
@@ -67,6 +66,14 @@ class SPUtils private constructor() : BaseSPUtils() {
put(context, AppConfig.IS_FIRST_OPEN, isFirstOpen)
}
+// fun isShowPrivacy(context: Context): Boolean {
+// return get(context, AppConfig.IS_SHOW_PRIVACY, false) as Boolean
+// }
+//
+// fun setIsShowPrivacy(context: Context, state: Boolean) {
+// put(context, AppConfig.IS_SHOW_PRIVACY, state)
+// }
+
/**
* 存服务器类型
diff --git a/mylibrary/src/main/java/com/dahe/mylibrary/base/BaseActivity.java b/mylibrary/src/main/java/com/dahe/mylibrary/base/BaseActivity.java
index a5ea2ce..83a6300 100644
--- a/mylibrary/src/main/java/com/dahe/mylibrary/base/BaseActivity.java
+++ b/mylibrary/src/main/java/com/dahe/mylibrary/base/BaseActivity.java
@@ -334,14 +334,16 @@ public abstract class BaseActivity extends AppCompatActi
public void onClick(View view) {
}
- @Override
- public Resources getResources() {
- Resources res = super.getResources();
- Configuration conf = new Configuration();
- conf.setToDefaults();
- res.updateConfiguration(conf, res.getDisplayMetrics());
- return res;
- }
+
+ //屏蔽字体大小对页面的影响
+// @Override
+// public Resources getResources() {
+// Resources res = super.getResources();
+// Configuration conf = new Configuration();
+// conf.setToDefaults();
+// res.updateConfiguration(conf, res.getDisplayMetrics());
+// return res;
+// }
/**
* 获取Drawable