Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add switch for whether delete messages after existing chat room. #396

Merged
merged 13 commits into from
Aug 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update OPPO sdk to 2.1.0 , minSdkVersion increase to 19 which is requ…
…ired by OPPO sdk 2.1.0 .
  • Loading branch information
jinanzhuan committed Aug 12, 2020
commit 50c9f8fb14ec44261acf3267e77728581bcb305a
7 changes: 6 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
applicationId "com.hyphenate.chatuidemo"
//测试oppo离线消息,需修改包名如下,如果配置了FCM推送,同时替换google-services.json 中的 package_name 字段
//applicationId "com.hyphenate.chatuidemo.push"
minSdkVersion 17
minSdkVersion 19
targetSdkVersion 29
multiDexEnabled true
ndk {
Expand Down Expand Up @@ -62,10 +62,15 @@ dependencies {
implementation 'com.meizu.flyme.internet:push-internal:3.7.0@aar'//配置集成sdk
// hms push
implementation 'com.huawei.hms:push:4.0.2.300'
//oppo push
implementation (name:'oppo_push_v2.1.0',ext:'aar')
}

// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
repositories {
mavenCentral()
flatDir{
dirs 'libs'
}
}
Binary file removed app/libs/oppo_push_v2.0.2.jar
Binary file not shown.
Binary file added app/libs/oppo_push_v2.1.0.aar
Binary file not shown.
11 changes: 6 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -494,20 +494,21 @@

<!-- Oppo推送配置 start -->
<service
android:name="com.heytap.mcssdk.PushService"
android:name="com.heytap.msp.push.service.CompatibleDataMessageCallbackService"
android:permission="com.coloros.mcs.permission.SEND_MCS_MESSAGE">
<intent-filter>
<action android:name="com.coloros.mcs.action.RECEIVE_MCS_MESSAGE"/>
</intent-filter>
</service>
</service> <!--兼容Q以下版本-->

<service
android:name="com.heytap.mcssdk.AppPushService"
android:permission="com.heytap.mcs.permission.SEND_MCS_MESSAGE">
android:name="com.heytap.msp.push.service.DataMessageCallbackService"
android:permission="com.heytap.mcs.permission.SEND_PUSH_MESSAGE">
<intent-filter>
<action android:name="com.heytap.mcs.action.RECEIVE_MCS_MESSAGE"/>
<action android:name="com.heytap.msp.push.RECEIVE_MCS_MESSAGE"/>
</intent-filter>
</service>
</service> <!--兼容Q版本-->
<!-- Oppo推送配置 end -->

<!-- Mi推送配置 start -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import android.content.Context;
import android.support.multidex.MultiDex;

import com.heytap.msp.push.HeytapPushManager;
import com.hyphenate.chatuidemo.ui.UserActivityLifecycleCallbacks;
import com.hyphenate.easeui.EaseUI;
import com.hyphenate.push.EMPushHelper;
Expand Down Expand Up @@ -50,7 +51,8 @@ public void onCreate() {

// 请确保环信SDK相关方法运行在主进程,子进程不会初始化环信SDK(该逻辑在EaseUI.java中)
if (EaseUI.getInstance().isMainProcess(this)) {

//OPPO SDK升级到2.1.0后需要进行初始化
HeytapPushManager.init(this, true);
EMPushHelper.getInstance().setPushListener(new PushListener() {
@Override
public void onError(EMPushType pushType, long errorCode) {
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/com/hyphenate/chatuidemo/DemoHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import android.util.Log;
import android.widget.Toast;

import com.heytap.mcssdk.PushManager;
import com.heytap.msp.push.HeytapPushManager;
import com.hyphenate.EMCallBack;
import com.hyphenate.EMConferenceListener;
import com.hyphenate.EMConnectionListener;
Expand Down Expand Up @@ -70,6 +70,7 @@
import com.hyphenate.push.EMPushHelper;
import com.hyphenate.push.EMPushType;
import com.hyphenate.util.EMLog;
import com.vivo.push.PushManager;

import org.json.JSONException;
import org.json.JSONObject;
Expand Down Expand Up @@ -1876,8 +1877,8 @@ public void popActivity(Activity activity) {
public void showNotificationPermissionDialog() {
EMPushType pushType = EMPushHelper.getInstance().getPushType();
// oppo
if(pushType == EMPushType.OPPOPUSH && PushManager.isSupportPush(appContext)) {
PushManager.getInstance().requestNotificationPermission();
if(pushType == EMPushType.OPPOPUSH && HeytapPushManager.isSupportPush()) {
HeytapPushManager.requestNotificationPermission();
}
}
}