1 package com.netease.nimlib.sdk.mixpush;
3 import android.app.Service;
4 import android.content.Context;
5 import android.content.Intent;
6 import android.os.IBinder;
8 import androidx.annotation.Nullable;
10 import com.huawei.hms.push.RemoteMessage;
22 private static final String TAG =
"HWPushMessageService";
25 NimLog.mixPush(TAG +
" onCreate");
30 public IBinder
onBind(Intent intent) {
35 NimLog.mixPush(TAG +
" onNewToken, token=" + token);
36 MixPushPlatforms.getPushPlatform(PushType.HUA_WEI).onToken(token);
45 NimLog.mixPush(TAG +
" onMessageReceived");
49 NimLog.mixPush(TAG +
" onMessageSent");
53 NimLog.mixPush(TAG +
" onDeletedMessages");
57 NimLog.mixPush(TAG +
" onSendError, " + var2);
void onMessageReceived(RemoteMessage remoteMessage)
透传消息, 需要用户自己弹出通知
void onSendError(String var1, Exception var2)
void onNewToken(String token)
void onMessageSent(String s)
IBinder onBind(Intent intent)
void onCreate(Context context)
以下这些方法运行在非 UI 线程中, 与HuaWei的PHmsMessageService 方法一一对应。 当开发者自身也接入HuaWei...