加载中 ...
首页 > 常见问题 正文

sharesdk一句代码即可分享,快速实现社会化分享组件

2019-03-24 10:28:26 来源:沈阳软件公司 作者:沈阳软件开发

 (2)不要我们的分享菜单,只要编辑界面的接口:

 

Objective-C

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

#import

NSString *imgPath = [[NSBundle mainBundle] pathForResource:@"Sample" ofType:@"jpg"];

    NSDictionary *customContent = @{@"text":@"Lisa",

                                    @"title":@"题目",

                                    @"imgUrl":imgPath};

[ShareSDK showShareEditor:SSDKPlatformTypeSinaWeibo otherPlatformTypes:nil contentName:@"ShareSDK" customFields:customContent onShareStateChanged:^(SSDKResponseState state, SSDKPlatformType platformType, NSDictionary *userData, SSDKContentEntity *contentEntity, NSError *error, BOOL end) {

        switch (state) {

            case SSDKResponseStateSuccess:

            {

                UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"分享乐成"

                                                                    message:nil

                                                                   delegate:nil

                                                          cancelButtonTitle:@"确定"

                                                          otherButtonTitles:nil];

                [alertView show];

                break;

            }

            case SSDKResponseStateFail:

    &n设计软件

<a href=http://www.hvihi.com target=_blank class=infotextkey>沈阳<a href=http://www.hvihi.com target=_blank class=infotextkey>软件开发</a></a>,<a href=http://www.hvihi.com target=_blank class=infotextkey>沈阳<a href=http://www.hvihi.com target=_blank class=infotextkey>软件公司</a></a>

bsp;       {

                UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"分享失败"

                                                                    message:[NSString stringWithFormat:@"%@", error]

                                                                   delegate:nil

                                                          cancelButtonTitle:@"确定"

                                                          otherButtonTitles:nil];

                [alertView show];

                break;

            }

            default:

                break;

        }

 

    }];

“沈阳软件公司”的新闻页面文章、图片、音频、视频等稿件均为自媒体人、第三方机构发布或转载。如稿件涉及版权等问题,请与

我们联系删除或处理,客服QQ:55506560,稿件内容仅为传递更多信息之目的,不代表本网观点,亦不代表本网站赞同

其观点或证实其内容的真实性。