1 package com.netease.nimlib.sdk.mixpush;
4 import android.content.Context;
5 import androidx.annotation.Nullable;
19 @SuppressWarnings(
"java:S1144")
22 private static final String TAG =
"NIMPushClient";
29 MixPushCache.init(config);
37 MixPushCache.setMixPushMessageHandler(handler);
51 if(MixPushCache.getContext() == null){
52 MixPushCache.setContext(context);
54 if(MixPushCache.getNotificationConfig() == null){
55 MixPushCache.setNotificationConfig(notificationConfig);
58 NotificationChannelCompat.createNIMMessageNotificationChannel(context,MixPushCache.getNotificationConfig());
59 TokenCallback tokenCallback =
new TokenCallback(){
61 public void onToken(@Nullable MixPushTokenImpl pushToken) {
62 if (pushToken == null || pushToken.isNotValid()) {
64 NimLog.i(TAG,
"getPushToken, reason: token null");
68 if (pushToken.getType() != requestPushType) {
70 NimLog.i(TAG,
"getPushToken, reason: token type not match");
79 MixPushPlatforms.registerPushSDK(context, requestPushType, tokenCallback);
81 MixPushPlatforms.registerAllPush(context, tokenCallback);
static void initPush(MixPushConfig config)
第三方推送消息回调接口,用户如果需要自行处理云信的第三方推送消息,则可实现该接口,并注册到NIMPushClie...
void onSuccess(T result)
操作成功
static void registerMixPushMessageHandler(MixPushMessageHandler handler)
注册第三方推送消息接收handler 在云信SDK初始化 NimClient.init 接口前调用
Created by chenkang on 2017/11/20.
boolean autoSelectPushType
是否根据token自动选择推送类型