当前位置: 首页>>代码示例>>Java>>正文


Java MiPushMessage.getAlias方法代码示例

本文整理汇总了Java中com.xiaomi.mipush.sdk.MiPushMessage.getAlias方法的典型用法代码示例。如果您正苦于以下问题:Java MiPushMessage.getAlias方法的具体用法?Java MiPushMessage.getAlias怎么用?Java MiPushMessage.getAlias使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.xiaomi.mipush.sdk.MiPushMessage的用法示例。


在下文中一共展示了MiPushMessage.getAlias方法的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);*/
}
 
开发者ID:NicoLiutong,项目名称:miaosou,代码行数:17,代码来源:DemoMessageReceiver.java

示例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);
}
 
开发者ID:liuyongfeng90,项目名称:JKCloud,代码行数:18,代码来源:MessageReceiver.java

示例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);
}
 
开发者ID:liuyongfeng90,项目名称:JKCloud,代码行数:18,代码来源:MessageReceiver.java

示例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);
        }
    }
 
开发者ID:idisfkj,项目名称:HightCopyWX,代码行数:28,代码来源:WXMessageReceiver.java

示例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);*/
}
 
开发者ID:NicoLiutong,项目名称:miaosou,代码行数:16,代码来源:DemoMessageReceiver.java

示例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();
    }
}
 
开发者ID:idisfkj,项目名称:HightCopyWX,代码行数:17,代码来源:WXMessageReceiver.java

示例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);
    }
 
开发者ID:idisfkj,项目名称:HightCopyWX,代码行数:19,代码来源:WXMessageReceiver.java

示例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);
                }
            });
        }


    }
 
开发者ID:jiang111,项目名称:AndroidPush,代码行数:35,代码来源:MiuiReceiver.java

示例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);
                }
            });
        }
    }
 
开发者ID:jiang111,项目名称:AndroidPush,代码行数:33,代码来源:MiuiReceiver.java

示例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);
                }
            });
        }
    }
 
开发者ID:jiang111,项目名称:AndroidPush,代码行数:33,代码来源:MiuiReceiver.java

示例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);
            }
        });
    }

}
 
开发者ID:beanu,项目名称:smart-farmer-android,代码行数:33,代码来源:MiMessageReceiver.java

示例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);
            }
        });
    }
}
 
开发者ID:beanu,项目名称:smart-farmer-android,代码行数:35,代码来源:MiMessageReceiver.java

示例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);
            }
        });
    }

}
 
开发者ID:beanu,项目名称:smart-farmer-android,代码行数:36,代码来源:MiMessageReceiver.java

示例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();
    }
}
 
开发者ID:entboost,项目名称:EntboostIM,代码行数:12,代码来源:XiaoMiPushReceiver.java

示例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();
    }
}
 
开发者ID:entboost,项目名称:EntboostIM,代码行数:12,代码来源:XiaoMiPushReceiver.java


注:本文中的com.xiaomi.mipush.sdk.MiPushMessage.getAlias方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。