YOUPAILZLiveFollowAttachment.m 986 B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // YOUPAILZLiveFollowAttachment.m
  3. // TIANYAN
  4. //
  5. // Created by CY on 2021/6/2.
  6. // Copyright © 2021 leo. All rights reserved.
  7. //
  8. #import "YOUPAILZLiveFollowAttachment.h"
  9. @implementation YOUPAILZLiveFollowAttachment
  10. - (NSString *)encodeAttachment
  11. {
  12. NSDictionary *dict = @{
  13. CMType : @(CustomOnLiveFollow),
  14. CMData : @{
  15. CMRoomId: self.roomid?self.roomid:@"",
  16. CMMsg: self.msg ?self.msg:@"",
  17. }
  18. };
  19. NSData *data = [NSJSONSerialization dataWithJSONObject:dict
  20. options:0
  21. error:nil];
  22. NSString *content = nil;
  23. if (data) {
  24. content = [[NSString alloc] initWithData:data
  25. encoding:NSUTF8StringEncoding];
  26. }
  27. return content;
  28. }
  29. @end