测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
发布最后发布 | 2017年6月 |
由 AgenricWon 维护。
依赖关系 | |
WechatOpenSDK | >= 0 |
WeiboSDK | >= 0 |
AGTencentOpenAPI | >= 0 |
要运行示例项目,首先克隆仓库,然后从 Example 目录中运行 pod install
。
AGShareDesk 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
pod "AGShareDesk"
Agenric, [email protected]
AGShareDesk 在 MIT 许可下提供。有关更多信息,请参阅 LICENSE 文件。
目前仅为自有业务需求进行了简单定制,支持分享普通文本消息,以及带网址的分享,支持分享到 QQ、QQ 空间、新浪微博、微信朋友及微信朋友圈。
其中,您需要在 info.plist 文件中添加对应平台的 Scheme 以及白名单。如果您不了解如何操作,可以查看 AGShareDesk-Info.plist 中与
LSApplicationQueriesSchemes
对应的键值。如果您发现无法正常调用第三方 App,可能是申请的 key 已失效,您可以用自己的 key 替换。
@implementation AGAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[AGShareDesk shareInstance] registerWithWeiboAppKey:@"1818950315" weChatAppKey:@"wx42e8d6a9776ab49c" tencentAppId:@"1105318793"];
return YES;
}
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
[[AGShareDesk shareInstance] handleApplication:app withOpenURL:url options:options];
return YES;
}
// buttonIndex为选中的分享平台
[[AGShareDesk shareInstance] shareToChannel:buttonIndex withMessgaeObject:[ShareMessageObject messageWithTitle:@"分享标题" content:@"分享内容" link:@"http://www.baidu.com" logoIcon:[UIImage imageNamed:@"shareIcon"]] afterDelegate:self];
[!] The 'Pods-WeiBoTest' target has transitive dependencies that include static binaries:(省略)
尝试在 Podfile 文件顶部添加以下代码:
pre_install do |installer|
def installer.verify_no_static_framework_transitive_dependencies; end
end