111
This commit is contained in:
parent
318a3dcf8c
commit
c303ad1f83
@ -32,7 +32,10 @@ import static com.yunbao.common.CommonAppContext.isReady;
|
|||||||
*/
|
*/
|
||||||
public class RongcloudIMManager {
|
public class RongcloudIMManager {
|
||||||
//融云开发者平台注册app唯一识别符
|
//融云开发者平台注册app唯一识别符
|
||||||
public static final String RONG_IM_KEY = "uwd1c0sxu1p71";
|
// public static final String RONG_IM_KEY = "uwd1c0sxu1p71";
|
||||||
|
//测试环境
|
||||||
|
public static final String RONG_IM_KEY = "pvxdm17jpd3hr";
|
||||||
|
|
||||||
private static final String CLASSNAME = "RongcloudIMManager";
|
private static final String CLASSNAME = "RongcloudIMManager";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -6,6 +6,8 @@ import android.animation.AnimatorListenerAdapter;
|
|||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
|
import android.app.NotificationChannel;
|
||||||
|
import android.app.PendingIntent;
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@ -125,11 +127,18 @@ import cn.rongcloud.rtc.api.RCRTCConfig;
|
|||||||
import cn.rongcloud.rtc.api.RCRTCEngine;
|
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||||
import io.reactivex.Observer;
|
import io.reactivex.Observer;
|
||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
|
import io.rong.imkit.config.RongConfigCenter;
|
||||||
|
import io.rong.imkit.notification.NotificationConfig;
|
||||||
import io.rong.imlib.RongIMClient;
|
import io.rong.imlib.RongIMClient;
|
||||||
import kotlin.Unit;
|
import kotlin.Unit;
|
||||||
|
|
||||||
import static com.yunbao.common.CommonAppContext.isReady;
|
import static com.yunbao.common.CommonAppContext.isReady;
|
||||||
|
|
||||||
|
import io.rong.imlib.model.Message;
|
||||||
|
import io.rong.push.PushManager;
|
||||||
|
import io.rong.push.PushType;
|
||||||
|
import kotlin.*;
|
||||||
|
|
||||||
@Route(path = RouteUtil.PATH_MAIN)
|
@Route(path = RouteUtil.PATH_MAIN)
|
||||||
public class MainActivity extends AbsActivity implements MainAppBarLayoutListener {
|
public class MainActivity extends AbsActivity implements MainAppBarLayoutListener {
|
||||||
|
|
||||||
@ -292,6 +301,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
|
|
||||||
// Log and toast
|
// Log and toast
|
||||||
Log.d(TAG, token);
|
Log.d(TAG, token);
|
||||||
|
PushManager.getInstance()
|
||||||
|
.onReceiveToken(MainActivity.this, PushType.GOOGLE_FCM, token);
|
||||||
Toast.makeText(MainActivity.this, token, Toast.LENGTH_SHORT).show();
|
Toast.makeText(MainActivity.this, token, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -392,6 +403,28 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
mViewPager.setCurrentItem(0);
|
mViewPager.setCurrentItem(0);
|
||||||
mTabButtonGroup.setCurPosition(0);
|
mTabButtonGroup.setCurPosition(0);
|
||||||
isInstructor();
|
isInstructor();
|
||||||
|
|
||||||
|
RongConfigCenter.notificationConfig().setInterceptor(new NotificationConfig.Interceptor() {
|
||||||
|
@Override
|
||||||
|
public boolean isNotificationIntercepted(Message message) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PendingIntent onPendingIntent(PendingIntent pendingIntent, Intent intent) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isHighPriorityMessage(Message message) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NotificationChannel onRegisterChannel(NotificationChannel notificationChannel) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
RxView.clicks(findViewById(R.id.banner_click))
|
RxView.clicks(findViewById(R.id.banner_click))
|
||||||
.throttleFirst(2, TimeUnit.SECONDS)
|
.throttleFirst(2, TimeUnit.SECONDS)
|
||||||
.subscribe(new Observer<Unit>() {
|
.subscribe(new Observer<Unit>() {
|
||||||
|
Loading…
Reference in New Issue
Block a user