《省钱达人》与《猎豆优选》UI相同版。域名tbk

DRShareManager.m 1.0KB

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // DRShareManager.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/8/14.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "DRShareManager.h"
  9. @implementation DRShareManager
  10. + (void)shareImageWithplatformType:(UMSocialPlatformType)platformType withImg:(id)img complete:(void (^)(id result,NSError *error))complete{
  11. //创建分享消息对象
  12. UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
  13. //创建图片内容对象
  14. UMShareImageObject *shareObject = [[UMShareImageObject alloc] init];
  15. //如果有缩略图,则设置缩略图
  16. // shareObject.thumbImage = [UIImage imageNamed:@"share_appicon"];
  17. [shareObject setShareImage:img];
  18. //分享消息对象设置分享内容对象
  19. messageObject.shareObject = shareObject;
  20. [[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:nil completion:^(id data, NSError *error) {
  21. if (complete) {
  22. complete(data,error);
  23. }
  24. }];
  25. }
  26. @end