本文整理汇总了Java中cn.bmob.im.BmobNotifyManager类的典型用法代码示例。如果您正苦于以下问题:Java BmobNotifyManager类的具体用法?Java BmobNotifyManager怎么用?Java BmobNotifyManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BmobNotifyManager类属于cn.bmob.im包,在下文中一共展示了BmobNotifyManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: showMsgNotify
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
public void showMsgNotify(Context context,BmobMsg msg) {
wakePhoneAndUnlock();
// 更新通知栏
int icon = R.mipmap.ic_launcher;
String trueMsg = "";
if(msg.getMsgType()==BmobConfig.TYPE_TEXT && msg.getContent().contains("\\ue")){
trueMsg = "[表情]";
}else if(msg.getMsgType()==BmobConfig.TYPE_IMAGE){
trueMsg = "[图片]";
}else if(msg.getMsgType()==BmobConfig.TYPE_VOICE){
trueMsg = "[语音]";
}else if(msg.getMsgType()==BmobConfig.TYPE_LOCATION){
trueMsg = "[位置]";
}else{
trueMsg = msg.getContent();
}
CharSequence tickerText = msg.getBelongNick() + ":" + trueMsg;
String contentTitle = msg.getBelongNick()+ " (" + mNewNum + "条新消息)";
Intent intent = new Intent(context, MessageActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("isshowchat", true);
BmobNotifyManager.getInstance(context).showNotifyWithExtras(application.isVoiceAllowed, application.isVibrateAllowed,icon, tickerText.toString(), contentTitle, tickerText.toString(),intent);
}
开发者ID:JoeSteven,项目名称:BiBi,代码行数:27,代码来源:MyMessageReceiver.java
示例2: showOtherNotify
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
/**
* ��ʾ������֪ͨ
*
* @param context
* @param fromname
* @param toId
* @param ticker
* @param cls
*/
private void showOtherNotify(Context context, String fromname, String toId,
String ticker, Class<?> cls) {
boolean isAllow = CustomApplication.getInstance().getSpUtil()
.isAllowPushNotify();
boolean isAllowVoice = CustomApplication.getInstance().getSpUtil()
.isAllowVoice();
boolean isAllowVibrate = CustomApplication.getInstance().getSpUtil()
.isAllowVibrate();
if (isAllow && currentUser != null
&& currentUser.getObjectId().equals(toId)) {
// ͬʱ����֪ͨ
BmobNotifyManager.getInstance(context).showNotify(isAllowVoice,
isAllowVibrate, R.drawable.ic_launcher, ticker, fromname,
ticker.toString(), NewFriendActivity.class);
}
}
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:26,代码来源:MyMessageReceiver.java
示例3: refreshInvite
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
public void refreshInvite(BmobInvitation message) {
boolean isAllow = CustomApplication.getInstance().getSpUtil()
.isAllowVoice();
if (isAllow) {
CustomApplication.getInstance().getMediaPlayer().start();
}
iv_contact_tips.setVisibility(View.VISIBLE);
if (currentTabIndex == 1) {
if (contactFragment != null) {
contactFragment.refresh();
}
} else {
// ͬʱ����֪ͨ
String tickerText = message.getFromname() + "������Ӻ���";
boolean isAllowVibrate = CustomApplication.getInstance().getSpUtil()
.isAllowVibrate();
BmobNotifyManager.getInstance(this).showNotify(isAllow,
isAllowVibrate, R.drawable.ic_launcher, tickerText,
message.getFromname(), tickerText.toString(),
NewFriendActivity.class);
}
}
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:23,代码来源:MainActivity.java
示例4: showOtherNotify
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
/**
* 显示其他Tag的通知 showOtherNotify
*/
public void showOtherNotify(Context context, String username, String toId,
String ticker, Class<?> cls) {
boolean isAllow = CustomApplcation.getInstance().getSpUtil()
.isAllowPushNotify();
boolean isAllowVoice = CustomApplcation.getInstance().getSpUtil()
.isAllowVoice();
boolean isAllowVibrate = CustomApplcation.getInstance().getSpUtil()
.isAllowVibrate();
if (isAllow && currentUser != null
&& currentUser.getObjectId().equals(toId)) {
// 同时提醒通知
BmobNotifyManager.getInstance(context).showNotify(isAllowVoice,
isAllowVibrate, R.drawable.ic_launcher, ticker, username,
ticker.toString(), NewFriendActivity.class);
}
}
开发者ID:nEdAy,项目名称:XPPLE_IM,代码行数:20,代码来源:MyMessageReceiver.java
示例5: refreshInvite
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
/**
* 刷新好友请求
*
* @Title: notifyAddUser
* @Description: TODO
* @param @param message
* @return void
* @throws
*/
private void refreshInvite(BmobInvitation message) {
boolean isAllow = CustomApplcation.getInstance().getSpUtil()
.isAllowVoice();
if (isAllow) {
CustomApplcation.getInstance().getMediaPlayer().start();
}
iv_contact_tips.setVisibility(View.VISIBLE);
if (currentTabIndex == 1) {
if (contactFragment != null) {
contactFragment.refresh();
}
} else {
// 同时提醒通知
String tickerText = message.getFromname() + "请求添加好友";
boolean isAllowVibrate = CustomApplcation.getInstance().getSpUtil()
.isAllowVibrate();
BmobNotifyManager.getInstance(this).showNotify(isAllow,
isAllowVibrate, R.drawable.ic_launcher, tickerText,
message.getFromname(), tickerText.toString(),
NewFriendActivity.class);
}
}
开发者ID:nEdAy,项目名称:XPPLE_IM,代码行数:32,代码来源:MainActivity.java
示例6: refreshInvite
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
/**
* @Title: notifyAddUser
* @Description: TODO
* @param @param message
* @return void
* @throws
*/
private void refreshInvite(BmobInvitation message){
boolean isAllow = CustomApplcation.getInstance().getSpUtil().isAllowVoice();
if(isAllow){
CustomApplcation.getInstance().getMediaPlayer().start();
}
iv_contact_tips.setVisibility(View.VISIBLE);
if(currentTabIndex==1){
if(contactFragment != null){
contactFragment.refresh();
}
}else{
String tickerText = message.getFromname()+"������Ӻ���";
boolean isAllowVibrate = CustomApplcation.getInstance().getSpUtil().isAllowVibrate();
BmobNotifyManager.getInstance(this).showNotify(isAllow,isAllowVibrate,R.drawable.ic_launcher, tickerText, message.getFromname(), tickerText.toString(),NewFriendActivity.class);
}
}
开发者ID:HuTianQi,项目名称:QQ,代码行数:25,代码来源:MainActivity.java
示例7: refreshInvite
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
/**
* ˢ�º�������
*
* @Title: notifyAddUser
* @Description: TODO
* @param @param message
* @return void
* @throws
*/
private void refreshInvite(BmobInvitation message) {
boolean isAllow = CustomApplication.getInstance().getSpUtil().isAllowVoice();
if (isAllow) {
CustomApplication.getInstance().getMediaPlayer().start();
}
iv_contact_tips.setVisibility(View.VISIBLE);
if (currentTabIndex == 1) {
if (contactFragment != null) {
contactFragment.refresh();
}
} else {
// ͬʱ����֪ͨ
String tickerText = message.getFromname() + "������Ӻ���";
boolean isAllowVibrate = CustomApplication.getInstance().getSpUtil().isAllowVibrate();
BmobNotifyManager.getInstance(this).showNotify(isAllow, isAllowVibrate, R.drawable.ic_launcher, tickerText, message.getFromname(), tickerText.toString(),
NewFriendActivity.class);
}
}
开发者ID:liuyanggithub,项目名称:Hi,代码行数:28,代码来源:MainActivity.java
示例8: refreshInvite
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
/** ˢ�º�������
* @Title: notifyAddUser
* @Description: TODO
* @param @param message
* @return void
* @throws
*/
private void refreshInvite(BmobInvitation message){
boolean isAllow = CustomApplication.getInstance().getSpUtil().isAllowVoice();
if(isAllow){
CustomApplication.getInstance().getMediaPlayer().start();
}
iv_contact_tips.setVisibility(View.VISIBLE);
if(currentTabIndex==1){
if(contactFragment != null){
contactFragment.refresh();
}
}else{
//ͬʱ����֪ͨ
String tickerText = message.getFromname()+"������Ӻ���";
boolean isAllowVibrate = CustomApplication.getInstance().getSpUtil().isAllowVibrate();
BmobNotifyManager.getInstance(this).showNotify(isAllow,isAllowVibrate,R.drawable.ic_launcher, tickerText, message.getFromname(), tickerText.toString(),NewFriendActivity.class);
}
}
开发者ID:liuyanggithub,项目名称:Hi,代码行数:25,代码来源:MainActivity1.java
示例9: onAddUser
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
@Override
public void onAddUser(BmobInvitation message) {
// 声音提示
boolean isAllow = CustomApplication.getInstance().getSpUtil().isAllowVoice();
if (isAllow) {
CustomApplication.getInstance().getMediaPlayer().start();
}
iv_contact_tips.setVisibility(View.VISIBLE);
if (currentTabIndex == 2) {
if (contactFragment != null) {
contactFragment.refresh();
}
} else {
String tickerText = message.getFromname() + "请求添加好友";
boolean isAllowVibrate = CustomApplication.getInstance().getSpUtil().isAllowVibrate();
BmobNotifyManager.getInstance(this).showNotify(isAllow, isAllowVibrate, R.drawable.icc_launcher, tickerText, message.getFromname(), tickerText, NewFriendActivity.class);
}
}
开发者ID:klob,项目名称:Diandi1.20,代码行数:19,代码来源:MainActivity.java
示例10: onResume
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
// 新消息到达,重新刷新界面
MyMessageReceiver.ehList.add(this);// 监听推送的消息
// 有可能锁屏期间,在聊天界面出现通知栏,这时候需要清除通知和清空未读消息数
BmobNotifyManager.getInstance(this).cancelNotify();
//清空消息未读数-这个要在刷新之后
MyMessageReceiver.mNewNum=0;
}
开发者ID:JoeSteven,项目名称:BiBi,代码行数:12,代码来源:MessageActivity.java
示例11: onResume
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
// 新消息到达,重新刷新界面
refresh();
MyMessageReceiver.ehList.add(this);// 监听推送的消息
// 有可能锁屏期间,在聊天界面出现通知栏,这时候需要清除通知和清空未读消息数
BmobNotifyManager.getInstance(this).cancelNotify();
BmobDB.create(this).resetUnread(mTargetId);
//清空消息未读数-这个要在刷新之后
MyMessageReceiver.mNewNum=0;
}
开发者ID:JoeSteven,项目名称:BiBi,代码行数:14,代码来源:ChatActivity.java
示例12: showMsgNotify
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
/**
* ��ʾ��������Ϣ��֪ͨ
*
* @param context
* @param msg
*/
protected void showMsgNotify(Context context, BmobMsg msg) {
// ����֪ͨ��
int icon = R.drawable.ic_launcher;
String trueMsg = "";
if (msg.getMsgType() == BmobConfig.TYPE_TEXT
&& msg.getContent().contains("\\ue")) {
trueMsg = "[����]";
} else if (msg.getMsgType() == BmobConfig.TYPE_IMAGE) {
trueMsg = "[ͼƬ]";
} else if (msg.getMsgType() == BmobConfig.TYPE_VOICE) {
trueMsg = "[����]";
} else if (msg.getMsgType() == BmobConfig.TYPE_LOCATION) {
trueMsg = "[�]";
} else {
trueMsg = msg.getContent();
}
CharSequence tickerText = msg.getBelongUsername() + ":" + trueMsg;
String contentTitle = msg.getBelongUsername()+ " (" + mNewNum + "������Ϣ)";
Intent intent = new Intent(context, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
boolean isAllowVoice = CustomApplication.getInstance().getSpUtil().isAllowVoice();
boolean isAllowVibrate = CustomApplication.getInstance().getSpUtil().isAllowVibrate();
BmobNotifyManager.getInstance(context).showNotifyWithExtras(isAllowVoice,isAllowVibrate,icon, tickerText.toString(), contentTitle, tickerText.toString(),intent);
}
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:34,代码来源:MyMessageReceiver.java
示例13: onResume
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
@Override
protected void onResume() {
super.onResume();
//����Ϣ�������ˢ�½���
initOrRefresh();
//�������͵���Ϣ
MyMessageReceiver.ehList.add(this);
//�п��������ڼ䣬������������֪ͨ������ʱ����Ҫ���֪ͨ�����δ����Ϣ��
BmobNotifyManager.getInstance(ChatActivity.this).cancelNotify();
BmobDB.create(this).resetUnread(targetId);
//�����Ϣδ����-���Ҫ��ˢ��֮��
MyMessageReceiver.mNewNum=0;
}
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:14,代码来源:ChatActivity.java
示例14: showMsgNotify
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
/**
* 显示与聊天消息的通知
*
* @Title: showNotify
* @return void
* @throws
*/
public void showMsgNotify(Context context, BmobMsg msg) {
// 更新通知栏
int icon = R.drawable.ic_launcher;
String trueMsg = "";
if (msg.getMsgType() == BmobConfig.TYPE_TEXT
&& msg.getContent().contains("\\ue")) {
trueMsg = "[表情]";
} else if (msg.getMsgType() == BmobConfig.TYPE_IMAGE) {
trueMsg = "[图片]";
} else if (msg.getMsgType() == BmobConfig.TYPE_VOICE) {
trueMsg = "[语音]";
} else if (msg.getMsgType() == BmobConfig.TYPE_LOCATION) {
trueMsg = "[位置]";
} else {
trueMsg = msg.getContent();
}
CharSequence tickerText = msg.getBelongUsername() + ":" + trueMsg;
String contentTitle = msg.getBelongUsername() + " (" + mNewNum
+ "条新消息)";
Intent intent = new Intent(context, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
boolean isAllowVoice = CustomApplcation.getInstance().getSpUtil()
.isAllowVoice();
boolean isAllowVibrate = CustomApplcation.getInstance().getSpUtil()
.isAllowVibrate();
BmobNotifyManager.getInstance(context).showNotifyWithExtras(
isAllowVoice, isAllowVibrate, icon, tickerText.toString(),
contentTitle, tickerText.toString(), intent);
}
开发者ID:nEdAy,项目名称:XPPLE_IM,代码行数:40,代码来源:MyMessageReceiver.java
示例15: onResume
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
// 新消息到达,重新刷新界面
initOrRefresh();
MyMessageReceiver.ehList.add(this);// 监听推送的消息
// 有可能锁屏期间,在聊天界面出现通知栏,这时候需要清除通知和清空未读消息数
BmobNotifyManager.getInstance(this).cancelNotify();
BmobDB.create(this).resetUnread(targetId);
// 清空消息未读数-这个要在刷新之后
MyMessageReceiver.mNewNum = 0;
}
开发者ID:nEdAy,项目名称:XPPLE_IM,代码行数:14,代码来源:ChatActivity.java
示例16: showMsgNotify
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
/**
* ��ʾ��������Ϣ��֪ͨ
* @Title: showNotify
* @return void
* @throws
*/
public void showMsgNotify(Context context,BmobMsg msg) {
int icon = R.drawable.ic_launcher;
String trueMsg = "";
if(msg.getMsgType()==BmobConfig.TYPE_TEXT && msg.getContent().contains("\\ue")){
trueMsg = "[表情]";
}else if(msg.getMsgType()==BmobConfig.TYPE_IMAGE){
trueMsg = "[图片]";
}else if(msg.getMsgType()==BmobConfig.TYPE_VOICE){
trueMsg = "[语音]";
}else if(msg.getMsgType()==BmobConfig.TYPE_LOCATION){
trueMsg = "[位置]";
}else{
trueMsg = msg.getContent();
}
CharSequence tickerText = msg.getBelongUsername() + ":" + trueMsg;
String contentTitle = msg.getBelongUsername()+ " (" + mNewNum + "条新消息)";
Intent intent = new Intent(context, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
boolean isAllowVoice = CustomApplcation.getInstance().getSpUtil().isAllowVoice();
boolean isAllowVibrate = CustomApplcation.getInstance().getSpUtil().isAllowVibrate();
BmobNotifyManager.getInstance(context).showNotifyWithExtras(isAllowVoice,isAllowVibrate,icon, tickerText.toString(), contentTitle, tickerText.toString(),intent);
}
开发者ID:HuTianQi,项目名称:QQ,代码行数:33,代码来源:MyMessageReceiver.java
示例17: showOtherNotify
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
public void showOtherNotify(Context context,String username,String toId,String ticker,Class<?> cls){
boolean isAllow = CustomApplcation.getInstance().getSpUtil().isAllowPushNotify();
boolean isAllowVoice = CustomApplcation.getInstance().getSpUtil().isAllowVoice();
boolean isAllowVibrate = CustomApplcation.getInstance().getSpUtil().isAllowVibrate();
if(isAllow && currentUser!=null && currentUser.getObjectId().equals(toId)){
BmobNotifyManager.getInstance(context).showNotify(isAllowVoice,isAllowVibrate,R.drawable.ic_launcher, ticker,username, ticker.toString(),NewFriendActivity.class);
}
}
开发者ID:HuTianQi,项目名称:QQ,代码行数:10,代码来源:MyMessageReceiver.java
示例18: onResume
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
initOrRefresh();
MyMessageReceiver.ehList.add(this);
BmobNotifyManager.getInstance(this).cancelNotify();
BmobDB.create(this).resetUnread(targetId);
MyMessageReceiver.mNewNum=0;
}
开发者ID:HuTianQi,项目名称:QQ,代码行数:14,代码来源:ChatActivity.java
示例19: onResume
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
// ����Ϣ�������ˢ�½���
initOrRefresh();
MyMessageReceiver.ehList.add(this);// �������͵���Ϣ
// �п��������ڼ䣬������������֪ͨ������ʱ����Ҫ���֪ͨ�����δ����Ϣ��
BmobNotifyManager.getInstance(this).cancelNotify();
BmobDB.create(this).resetUnread(targetId);
//�����Ϣδ����-���Ҫ��ˢ��֮��
MyMessageReceiver.mNewNum=0;
}
开发者ID:liuyanggithub,项目名称:Hi,代码行数:14,代码来源:ChatActivity.java
示例20: showMsgNotify
import cn.bmob.im.BmobNotifyManager; //导入依赖的package包/类
/**
* ��ʾ��������Ϣ��֪ͨ
* @Title: showNotify
* @return void
* @throws
*/
public void showMsgNotify(Context context,BmobMsg msg) {
// ����֪ͨ��
int icon = R.drawable.ic_launcher;
String trueMsg = "";
if(msg.getMsgType()==BmobConfig.TYPE_TEXT && msg.getContent().contains("\\ue")){
trueMsg = "[����]";
}else if(msg.getMsgType()==BmobConfig.TYPE_IMAGE){
trueMsg = "[ͼƬ]";
}else if(msg.getMsgType()==BmobConfig.TYPE_VOICE){
trueMsg = "[����]";
}else if(msg.getMsgType()==BmobConfig.TYPE_LOCATION){
trueMsg = "[�]";
}else{
trueMsg = msg.getContent();
}
CharSequence tickerText = msg.getBelongUsername() + ":" + trueMsg;
String contentTitle = msg.getBelongUsername()+ " (" + mNewNum + "������Ϣ)";
Intent intent = new Intent(context, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
boolean isAllowVoice = CustomApplication.getInstance().getSpUtil().isAllowVoice();
boolean isAllowVibrate = CustomApplication.getInstance().getSpUtil().isAllowVibrate();
BmobNotifyManager.getInstance(context).showNotifyWithExtras(isAllowVoice,isAllowVibrate,icon, tickerText.toString(), contentTitle, tickerText.toString(),intent);
}
开发者ID:liuyanggithub,项目名称:Hi,代码行数:33,代码来源:MyMessageReceiver.java
注:本文中的cn.bmob.im.BmobNotifyManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论