Tabnine Logo
AVIMTypedMessage.getFrom
Code IndexAdd Tabnine to your IDE (free)

How to use
getFrom
method
in
com.avos.avoscloud.im.v2.AVIMTypedMessage

Best Java code snippets using com.avos.avoscloud.im.v2.AVIMTypedMessage.getFrom (Showing top 3 results out of 315)

origin: WuXiaolong/WoChat

  private void sendNotification(AVIMTypedMessage message, AVIMConversation conversation) {
    String notificationContent = message instanceof AVIMTextMessage ? ((AVIMTextMessage) message).getText() : context.getString(R.string.unspport_message_type);

    Intent intent = new Intent(context, NotificationBroadcastReceiver.class);
    intent.putExtra(AppConstant.CONVERSATION_ID, conversation.getConversationId());
    intent.putExtra(AppConstant.ACTIVITY_TITLE, conversation.getName());
    intent.putExtra(AppConstant.MEMBER_ID, message.getFrom());
//        NotificationUtils.showNotification(context, "新信息", notificationContent, null, intent);
  }
}
origin: WuXiaolong/WoChat

  @Override
  public void onMessage(AVIMTypedMessage message, AVIMConversation conversation, AVIMClient client) {
    Log.e("wxl", "MessageHandler onMessage");
    String clientID = "";
    try {
      clientID = AVImClientManager.getInstance().getClientId();

      if (client.getClientId().equals(clientID)) {
        Log.e("wxl", "MessageHandler onMessage clientID=" + clientID + ",client.getClientId()=" + client.getClientId() + ",message.getFrom()=" + message.getFrom());
        // 过滤掉自己发的消息
        if (!message.getFrom().equals(clientID)) {
          sendEvent(message, conversation);
//                    Log.e("wxl", "MessageHandler=" + NotificationUtils.isShowNotification(conversation.getConversationId()));
//                    if (NotificationUtils.isShowNotification(conversation.getConversationId())) {
//                        sendNotification(message, conversation);
//                    }
        }
      } else {
        client.close(null);
      }
    } catch (IllegalStateException e) {
      client.close(null);
    }
  }

origin: FreedomZZQ/YouJoin-Android

@Override
public void onMessage(AVIMTypedMessage message, AVIMConversation conversation, AVIMClient client){
  String clientID = "";
  try{
    clientID = AVImClientManager.getInstance().getClientId();
    if(client.getClientId().equals(clientID)){
      //过滤自己发的消息
      if(!message.getFrom().equals(clientID)){
        sendEvent(message, conversation);
      }
    }else {
      client.close(null);
    }
  }catch(IllegalStateException e){
    client.close(null);
    e.printStackTrace();
  }
}
com.avos.avoscloud.im.v2AVIMTypedMessagegetFrom

Popular methods of AVIMTypedMessage

  • getMessageType
  • computeFieldAttribute
  • getField
  • getMessage
  • initMessageType
  • parseMessage
    从 conversation 数据中解析 lastMessage

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • setScale (BigDecimal)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Socket (java.net)
    Provides a client-side TCP socket.
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • ImageIO (javax.imageio)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now