Skip to content

macji/ShareKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ShareKit

目前支持 Weibo SDK , WeChat SDK , QQ SDK

如何使用

  1. 启动的时候
ShareKit *share = [ShareKit sharedInstance];
// sinaweibo
[share sinaWeiboSetupWithAppKey:kSinaWeiboAppKey
                      appSecret:kSinaWeiboAppSecret
                 appRedirectURI:kSinaWeiboAppRedirectURI
              ssoCallbackScheme:kSinaWeiboScheme];
// wechat 
[share weChatSetupWithAppKey:kWeChatAppID];
  1. 接管URL
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
  return [[ShareKit sharedInstance] handleOpenURL:url];
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
  return [[ShareKit sharedInstance] handleOpenURL:url];
}
  1. 在相关的需要分享的地方
ShareKit *share = [ShareKit sharedInstance];
// 分享到微博
[share sinaWeiboSendWithText:text
                   imageData:imageData
              authCompletion:^(NSError *error) {}
                     success:^{}
                     failure:^(NSError *error) {}]

更多请参考 ShareKit.h

About

Share to Weibo, WeChat

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published