From 11aeb95fd718d58144ae9fed1d1c76eb15cd3a05 Mon Sep 17 00:00:00 2001 From: 18142669586 <1669783059@qq.com> Date: Fri, 21 Oct 2022 13:23:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=B7=E6=AD=8C=E5=8C=85=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E4=B8=8D=E8=8E=B7=E5=8F=96=E6=8E=A8=E5=B9=BF=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java | 2 -- .../com/shayu/phonelive/utils/CustomMessageReceiver.java | 7 ++++++- .../main/java/com/yunbao/main/activity/EntryActivity.java | 7 ++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java b/app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java index 6914d8d0b..fa761d83c 100644 --- a/app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java +++ b/app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java @@ -5,9 +5,7 @@ import android.os.Handler; import android.os.Looper; import android.util.Log; import android.widget.Toast; - import com.yunbao.common.utils.FileUtil; - import java.io.File; import java.io.PrintWriter; import java.io.StringWriter; diff --git a/app/src/main/java/com/shayu/phonelive/utils/CustomMessageReceiver.java b/app/src/main/java/com/shayu/phonelive/utils/CustomMessageReceiver.java index 7da523062..e5776571b 100644 --- a/app/src/main/java/com/shayu/phonelive/utils/CustomMessageReceiver.java +++ b/app/src/main/java/com/shayu/phonelive/utils/CustomMessageReceiver.java @@ -157,7 +157,12 @@ public class CustomMessageReceiver extends PushMessageReceiver { // 设置通知的点击行为:这里启动一个 Activity Intent intent = new Intent(context, MainActivity.class); intent.setFlags(FLAG_ACTIVITY_CLEAR_TOP); - PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); + PendingIntent pendingIntent; + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) { + pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE); + } else { + pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_ONE_SHOT); + } String channelId = createNotificationChannel(context, "my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH); // 构建 remoteView RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.notification_message); diff --git a/main/src/main/java/com/yunbao/main/activity/EntryActivity.java b/main/src/main/java/com/yunbao/main/activity/EntryActivity.java index 0b9fd5630..e97a16d76 100644 --- a/main/src/main/java/com/yunbao/main/activity/EntryActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/EntryActivity.java @@ -122,7 +122,7 @@ public class EntryActivity extends AppCompatActivity { private TwitterLoginButton tt_login_button; public static Activity activity; private static String mLoginType = Constants.MOB_PHONE;//登录方式 - private String mPromoCode = "";//推广码 + public String mPromoCode = "";//推广码 private String mUuidDevice = "";//手机唯一标识符 private static boolean mFirstLogin;//是否是第一次登录 private static boolean mShowInvite;//显示邀请码弹窗 @@ -672,8 +672,9 @@ public class EntryActivity extends AppCompatActivity { */ private void loginBuyThird(LoginData data) { mLoginType = data.getType(); - - + if(CommonAppConfig.IS_GOOGLE_PLAY==true) { + mPromoCode = ""; + } MainHttpUtil.loginByThird(data.getOpenID(), mPromoCode, mUuidDevice, data.getNickName(), data.getAvatar(), data.getType(), new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) {