Coder Social home page Coder Social logo

understanding / xfthirdsharesdkdemo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xufengbj/xfthirdsharesdkdemo

0.0 1.0 0.0 179 KB

第三方分享 微信好友 朋友圈 新浪微博 链接 图片 音频地址 分享 以及成功与失败回调 使用起来及其便捷

Ruby 1.05% Objective-C 98.95%

xfthirdsharesdkdemo's Introduction

该demo集成了微信SDK,新浪微博SDK,主要功能是:微信好友、微信朋友圈、新浪微博 分享 图片、链接、音频等的集成与封装。

使用方法:

1:首先 cd到改目录下面 pod install 下载所需SDK

2:具体调用方法如下:

 shareTitle = @"分享标题";
   shareDescription = @"分享描述";
   thumbImage = [UIImage imageNamed:@"60"];
   
   shareModel = [[XFShareModel alloc]init];
   shareModel.title = shareTitle;
   shareModel.shareDescription = shareDescription;
   shareModel.thumbImage = thumbImage;
   shareModel.webpageUrl = _shareUrl.text;
   shareModel.shareType = XFShareTypeWebPage;
   
   //分享链接 微信好友
   shareModel.shareType = XFShareTypeWebPage;
   [XFShareManager sharedInstance].shareStatuBlcok = ^(BOOL isScuess) {
   if (isScuess) {
   NSLog(@"分享成功");
   } else {
   NSLog(@"分享失败");
   }
   };
   [[XFShareManager sharedInstance]shareToWX:shareModel scene:WXSceneSession];
   //分享链接 微信朋友圈
   shareModel.shareType = XFShareTypeWebPage;
   [XFShareManager sharedInstance].shareStatuBlcok = ^(BOOL isScuess) {
   if (isScuess) {
   NSLog(@"分享成功");
   } else {
   NSLog(@"分享失败");
   }
   };
   [[XFShareManager sharedInstance]shareToWX:shareModel scene:WXSceneTimeline];
   //分享图片 微信朋友圈
   shareModel.shareType = XFShareTypeImage;
   shareModel.image = _shareImgView.image;
   [XFShareManager sharedInstance].shareStatuBlcok = ^(BOOL isScuess) {
   if (isScuess) {
   NSLog(@"分享成功");
   } else {
   NSLog(@"分享失败");
   }
   };
   [[XFShareManager sharedInstance]shareToWX:shareModel scene:WXSceneTimeline];
   
   //分享图片 新浪微博
   shareModel.shareType = XFShareTypeImage;
   shareModel.image = _shareImgView.image;
   [XFShareManager sharedInstance].shareStatuBlcok = ^(BOOL isScuess) {
   if (isScuess) {
   NSLog(@"分享成功");
   } else {
   NSLog(@"分享失败");
   }
   };
   [[XFShareManager sharedInstance] shareToWeibo:shareModel];

3:优点:可扩展性强,使用起来方便代码简洁。

xfthirdsharesdkdemo's People

Contributors

xufeng1990 avatar xufengbj avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.