美文网首页
iOS 融云发送一条消息

iOS 融云发送一条消息

作者: 一只帅气的猿 | 来源:发表于2018-05-04 17:21 被阅读107次

    发送图片消息

    UIImageView *igv = [[UIImageView alloc] init];
    [igv setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",[UserInfo sharedUserInfo].baseurl ,[dict objectForKey:@"rewardGiftImg"]]]];
                    
    RCImageMessage *imageMessage = [RCImageMessage messageWithImage:igv.image];
                    
    [[RCIM sharedRCIM]sendMediaMessage:ConversationType_PRIVATE targetId:[dict objectForKey:@"fromUserId"]  content:imageMessage pushContent:nil pushData:nil progress:nil success:nil error:nil cancel:nil];
    
    
    

    发送文字消息

    RCTextMessage *ms = [RCTextMessage messageWithContent:[[zhaoDic objectForKey:@"msg"] decodeBase64String]];
    ms.senderUserInfo = userInfo;
                        
    [[RCIM sharedRCIM] sendMessage:ConversationType_PRIVATE targetId:[zhaoDic objectForKey:@"userId"] content:ms pushContent:nil pushData:nil success:nil error:nil];
    
    

    相关文章

      网友评论

          本文标题:iOS 融云发送一条消息

          本文链接:https://www.haomeiwen.com/subject/ptxjrftx.html