本文整理汇总了Java中cn.bmob.im.BmobNotifyManager类的典型用法代码示例。如果您正苦于以下问题:Java BmobNotifyManager类的具体用法?Java BmobNotifyManager怎么用?Java BmobNotifyManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BmobNotifyManager类属于cn.bmob.im包,在下文中一共展示了BmobNotifyManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}