本文整理汇总了Java中com.xiaomi.mipush.sdk.MiPushMessage.getTopic方法的典型用法代码示例。如果您正苦于以下问题:Java MiPushMessage.getTopic方法的具体用法?Java MiPushMessage.getTopic怎么用?Java MiPushMessage.getTopic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.xiaomi.mipush.sdk.MiPushMessage
的用法示例。
在下文中一共展示了MiPushMessage.getTopic方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onNotificationMessageArrived
import com.xiaomi.mipush.sdk.MiPushMessage; //导入方法依赖的package包/类
@Override
public void onNotificationMessageArrived(Context context, MiPushMessage message) {
//String log = context.getString(R.string.arrive_notification_message, message.getContent());
//MainActivity.logList.add(0, getSimpleDate() + " " + log);
if (!TextUtils.isEmpty(message.getTopic())) {
mTopic = message.getTopic();
} else if (!TextUtils.isEmpty(message.getAlias())) {
mAlias = message.getAlias();
}
/*Message msg = Message.obtain();
msg.obj = log;
DemoApplication.getHandler().sendMessage(msg);*/
}
示例2: onReceivePassThroughMessage
import com.xiaomi.mipush.sdk.MiPushMessage; //导入方法依赖的package包/类
@Override
public void onReceivePassThroughMessage(Context context, MiPushMessage message) {
Log.v(MyApplication.TAG,
"onReceivePassThroughMessage is called. " + message.toString());
String log = context.getString(R.string.recv_passthrough_message, message.getContent());
MainActivity.logList.add(0, getSimpleDate() + " " + log);
if (!TextUtils.isEmpty(message.getTopic())) {
mTopic = message.getTopic();
} else if (!TextUtils.isEmpty(message.getAlias())) {
mAlias = message.getAlias();
}
Message msg = Message.obtain();
msg.obj = log;
MyApplication.getHandler().sendMessage(msg);
}
示例3: onNotificationMessageArrived
import com.xiaomi.mipush.sdk.MiPushMessage; //导入方法依赖的package包/类
@Override
public void onNotificationMessageArrived(Context context, MiPushMessage message) {
Log.v(MyApplication.TAG,
"onNotificationMessageArrived is called. " + message.toString());
String log = context.getString(R.string.arrive_notification_message, message.getContent());
MainActivity.logList.add(0, getSimpleDate() + " " + log);
if (!TextUtils.isEmpty(message.getTopic())) {
mTopic = message.getTopic();
} else if (!TextUtils.isEmpty(message.getAlias())) {
mAlias = message.getAlias();
}
Message msg = Message.obtain();
msg.obj = log;
MyApplication.getHandler().sendMessage(msg);
}
示例4: onReceivePassThroughMessage
import com.xiaomi.mipush.sdk.MiPushMessage; //导入方法依赖的package包/类
/**
* 接收服务器发送的透传消息
*
* @param context
* @param message
*/
@Override
public void onReceivePassThroughMessage(Context context, MiPushMessage message) {
mMessage = message.getContent();
if (!TextUtils.isEmpty(message.getTopic())) {
mTopic = message.getTopic();
} else if (!TextUtils.isEmpty(message.getAlias())) {
mAlias = message.getAlias();
}
// Log.d("TAG", "message:" + mMessage);
intent = new Intent();
chatHelper = new ChatMessageDataHelper(App.getAppContext());
if (mMessage.indexOf("^") != -1 && mMessage.indexOf("@") != -1) {
//user information
userInformation(mMessage);
} else if (mMessage.indexOf("&") != -1 && mMessage.indexOf("@") != -1) {
addFriendInformation(mMessage);
} else {
chatInformation(mMessage);
}
}
示例5: onReceivePassThroughMessage
import com.xiaomi.mipush.sdk.MiPushMessage; //导入方法依赖的package包/类
@Override
public void onReceivePassThroughMessage(Context context, MiPushMessage message) {
//String log = context.getString(R.string.recv_passthrough_message, message.getContent());
//MainActivity.logList.add(0, getSimpleDate() + " " + log);
if (!TextUtils.isEmpty(message.getTopic())) {
mTopic = message.getTopic();
} else if (!TextUtils.isEmpty(message.getAlias())) {
mAlias = message.getAlias();
}
/*Message msg = Message.obtain();
msg.obj = log;
DemoApplication.getHandler().sendMessage(msg);*/
}
示例6: onNotificationMessageClicked
import com.xiaomi.mipush.sdk.MiPushMessage; //导入方法依赖的package包/类
/**
* 接收服务器发来的通知栏消息
* (用户点击通知栏触发)
*
* @param context
* @param message
*/
@Override
public void onNotificationMessageClicked(Context context, MiPushMessage message) {
mMessage = message.getContent();
if (!TextUtils.isEmpty(message.getTopic())) {
mTopic = message.getTopic();
} else if (!TextUtils.isEmpty(message.getAlias())) {
mAlias = message.getAlias();
}
}
示例7: onNotificationMessageArrived
import com.xiaomi.mipush.sdk.MiPushMessage; //导入方法依赖的package包/类
/**
* 接收服务器发来的通知栏消息
* (消息到达客户端时触发,并且可以接收应用在前台时不弹出通知的通知消息)
*
* @param context
* @param message
*/
@Override
public void onNotificationMessageArrived(Context context, MiPushMessage message) {
mMessage = message.getContent();
if (!TextUtils.isEmpty(message.getTopic())) {
mTopic = message.getTopic();
} else if (!TextUtils.isEmpty(message.getAlias())) {
mAlias = message.getAlias();
}
// Log.d("TAG", "message通知:" + mMessage);
// Log.d("TAG", "Alias通知:" + mAlias);
}
示例8: onReceivePassThroughMessage
import com.xiaomi.mipush.sdk.MiPushMessage; //导入方法依赖的package包/类
@Override
public void onReceivePassThroughMessage(final Context context, MiPushMessage message) {
mMessage = message.getContent();
if (!TextUtils.isEmpty(message.getTopic())) {
mTopic = message.getTopic();
} else if (!TextUtils.isEmpty(message.getAlias())) {
mAlias = message.getAlias();
} else if (!TextUtils.isEmpty(message.getUserAccount())) {
mUserAccount = message.getUserAccount();
}
if (mPushInterface != null) {
final Message result = new Message();
result.setMessageID(message.getMessageId());
result.setTitle(message.getTitle());
result.setMessage(message.getContent());
result.setExtra(mMessage);
result.setTarget(Target.MIUI);
try {
// result.setExtra(JsonUtils.setJson(message.getExtra()).toString());
result.setExtra(message.getContent());
} catch (Exception e) {
L.i("onReceivePassThroughMessage: " + e.toString());
result.setExtra("{}");
}
JHandler.handler().post(new Runnable() {
@Override
public void run() {
mPushInterface.onCustomMessage(context, result);
}
});
}
}
示例9: onNotificationMessageClicked
import com.xiaomi.mipush.sdk.MiPushMessage; //导入方法依赖的package包/类
@Override
public void onNotificationMessageClicked(final Context context, MiPushMessage message) {
mMessage = message.getContent();
if (!TextUtils.isEmpty(message.getTopic())) {
mTopic = message.getTopic();
} else if (!TextUtils.isEmpty(message.getAlias())) {
mAlias = message.getAlias();
} else if (!TextUtils.isEmpty(message.getUserAccount())) {
mUserAccount = message.getUserAccount();
}
if (mPushInterface != null) {
final Message result = new Message();
result.setNotifyID(message.getNotifyId());
result.setMessageID(message.getMessageId());
result.setTitle(mTopic);
result.setMessage(mMessage);
result.setTarget(Target.MIUI);
try {
result.setExtra(JsonUtils.setJson(message.getExtra()).toString());
// result.setExtra(message.getContent());
} catch (Exception e) {
Log.e(TAG, "onNotificationMessageClicked: " + e.toString());
result.setExtra("{}");
}
JHandler.handler().post(new Runnable() {
@Override
public void run() {
mPushInterface.onMessageClicked(context, result);
}
});
}
}
示例10: onNotificationMessageArrived
import com.xiaomi.mipush.sdk.MiPushMessage; //导入方法依赖的package包/类
@Override
public void onNotificationMessageArrived(final Context context, MiPushMessage message) {
mMessage = message.getContent();
if (!TextUtils.isEmpty(message.getTopic())) {
mTopic = message.getTopic();
} else if (!TextUtils.isEmpty(message.getAlias())) {
mAlias = message.getAlias();
} else if (!TextUtils.isEmpty(message.getUserAccount())) {
mUserAccount = message.getUserAccount();
}
if (mPushInterface != null) {
final Message result = new Message();
result.setTitle(message.getTitle());
result.setMessageID(message.getMessageId());
result.setNotifyID(message.getNotifyId());
result.setMessage(message.getDescription());
result.setTarget(Target.MIUI);
try {
result.setExtra(JsonUtils.setJson(message.getExtra()).toString());
// result.setExtra(message.getContent());
} catch (Exception e) {
L.i("onReceivePassThroughMessage: " + e.toString());
result.setExtra("{}");
}
JHandler.handler().post(new Runnable() {
@Override
public void run() {
mPushInterface.onMessage(context, result);
}
});
}
}
示例11: onReceivePassThroughMessage
import com.xiaomi.mipush.sdk.MiPushMessage; //导入方法依赖的package包/类
/**
* 接收服务器推送的透传消息,消息封装在 MiPushMessage类中
*/
@Override
public void onReceivePassThroughMessage(final Context context, final MiPushMessage message) {
mMessage = message.getContent();
if (!TextUtils.isEmpty(message.getTopic())) {
mTopic = message.getTopic();
} else if (!TextUtils.isEmpty(message.getAlias())) {
mAlias = message.getAlias();
} else if (!TextUtils.isEmpty(message.getUserAccount())) {
mUserAccount = message.getUserAccount();
}
Log.d(TAG, "onReceivePassThroughMessage: " + message.toString());
if (mPushListener != null) {
final PushMessage result = new PushMessage();
result.setMessageID(message.getMessageId());
result.setTitle(message.getTitle());
result.setMessage(message.getContent());
result.setExtra(message.getExtra());
result.setTarget(PhoneTarget.MIUI);
PushHandler.handler().post(new Runnable() {
@Override
public void run() {
mPushListener.onCustomMessage(context, result);
}
});
}
}
示例12: onNotificationMessageClicked
import com.xiaomi.mipush.sdk.MiPushMessage; //导入方法依赖的package包/类
/**
* 接收服务器推送的通知消息,用户点击后触发
*/
@Override
public void onNotificationMessageClicked(final Context context, MiPushMessage message) {
mMessage = message.getContent();
if (!TextUtils.isEmpty(message.getTopic())) {
mTopic = message.getTopic();
} else if (!TextUtils.isEmpty(message.getAlias())) {
mAlias = message.getAlias();
} else if (!TextUtils.isEmpty(message.getUserAccount())) {
mUserAccount = message.getUserAccount();
}
Log.d(TAG, "onNotificationMessageClicked: " + message.toString());
if (mPushListener != null) {
final PushMessage result = new PushMessage();
result.setNotifyID(message.getNotifyId());
result.setMessageID(message.getMessageId());
result.setTitle(mTopic);
result.setMessage(mMessage);
result.setExtra(message.getExtra());
result.setTarget(PhoneTarget.MIUI);
PushHandler.handler().post(new Runnable() {
@Override
public void run() {
mPushListener.onMessageClicked(context, result);
}
});
}
}
示例13: onNotificationMessageArrived
import com.xiaomi.mipush.sdk.MiPushMessage; //导入方法依赖的package包/类
/**
* 接收服务器推送的通知消息,消息到达客户端时触发,还可以接受应用在前台时不弹出通知的通知消息
* 在MIUI上,只有应用处于启动状态,或者自启动白名单中,才可以通过此方法接受到该消息
*/
@Override
public void onNotificationMessageArrived(final Context context, MiPushMessage message) {
mMessage = message.getContent();
if (!TextUtils.isEmpty(message.getTopic())) {
mTopic = message.getTopic();
} else if (!TextUtils.isEmpty(message.getAlias())) {
mAlias = message.getAlias();
} else if (!TextUtils.isEmpty(message.getUserAccount())) {
mUserAccount = message.getUserAccount();
}
Log.d(TAG, "onNotificationMessageArrived: " + message.toString());
if (mPushListener != null) {
final PushMessage result = new PushMessage();
result.setTitle(message.getTitle());
result.setMessageID(message.getMessageId());
result.setNotifyID(message.getNotifyId());
result.setMessage(message.getDescription());
result.setExtra(message.getExtra());
result.setTarget(PhoneTarget.MIUI);
PushHandler.handler().post(new Runnable() {
@Override
public void run() {
mPushListener.onMessage(context, result);
}
});
}
}
示例14: onReceivePassThroughMessage
import com.xiaomi.mipush.sdk.MiPushMessage; //导入方法依赖的package包/类
@Override
public void onReceivePassThroughMessage(Context context, MiPushMessage message) {
//注意:本回调在非主UI线程
Log4jLog.d(LONG_TAG, "onReceivePassThroughMessage is called. " + message.toString());
if (!TextUtils.isEmpty(message.getTopic())) {
mTopic = message.getTopic();
} else if (!TextUtils.isEmpty(message.getAlias())) {
mAlias = message.getAlias();
}
}
示例15: onNotificationMessageClicked
import com.xiaomi.mipush.sdk.MiPushMessage; //导入方法依赖的package包/类
@Override
public void onNotificationMessageClicked(Context context, MiPushMessage message) {
//注意:本回调在非主UI线程
Log4jLog.d(LONG_TAG, "onNotificationMessageClicked is called. " + message.toString());
if (!TextUtils.isEmpty(message.getTopic())) {
mTopic = message.getTopic();
} else if (!TextUtils.isEmpty(message.getAlias())) {
mAlias = message.getAlias();
}
}