1 package com.netease.nimlib.sdk.mixpush;
4 import android.content.Context;
5 import androidx.annotation.Nullable;
20 @SuppressWarnings(
"java:S1144")
23 private static final String TAG =
"NIMPushClient";
30 MixPushCache.init(config);
38 MixPushCache.setMixPushMessageHandler(handler);
52 if(MixPushCache.getContext() == null){
53 MixPushCache.setContext(context);
55 if(MixPushCache.getNotificationConfig() == null){
56 MixPushCache.setNotificationConfig(notificationConfig);
59 NotificationChannelCompat.createNIMMessageNotificationChannel(context,MixPushCache.getNotificationConfig());
60 TokenCallback tokenCallback =
new TokenCallback(){
62 public void onToken(@Nullable MixPushTokenImpl pushToken) {
63 if (pushToken == null || pushToken.isNotValid()) {
65 NimLog.i(TAG,
"getPushToken, reason: token null");
69 if (pushToken.getType() != requestPushType) {
71 NimLog.i(TAG,
"getPushToken, reason: token type not match");
80 MixPushPlatforms.registerPushSDK(context, requestPushType, tokenCallback);
82 MixPushPlatforms.registerAllPush(context, tokenCallback);
91 MixPushCore.setManuallyProvidePushTokenCallback(callback);
static void initPush(MixPushConfig config)
static void registerManuallyProvidePushTokenCallback(IManualProvidePushTokenCallback callback)
注册用户自主提供的推送token的回调,仅在 MixPushConfig#manualProvidePushToken 为true时有效 ...
第三方推送消息回调接口,用户如果需要自行处理云信的第三方推送消息,则可实现该接口,并注册到NIMPushClie...
void onSuccess(T result)
操作成功
static void registerMixPushMessageHandler(MixPushMessageHandler handler)
注册第三方推送消息接收handler 在云信SDK初始化 NimClient.init 接口前调用
Created by chenkang on 2017/11/20.
boolean autoSelectPushType
是否根据token自动选择推送类型