YOUPAILZLiveCarAttachment.m 1.1 KB

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