├── Pods ├── Headers │ ├── Private │ │ └── OpenShare │ │ │ ├── OpenShare.h │ │ │ ├── OpenShare+QQ.h │ │ │ ├── OpenShare+Alipay.h │ │ │ ├── OpenShare+Renren.h │ │ │ ├── OpenShare+Weibo.h │ │ │ ├── OpenShare+Weixin.h │ │ │ └── OpenShareHeader.h │ └── Public │ │ └── OpenShare │ │ ├── OpenShare.h │ │ ├── OpenShare+QQ.h │ │ ├── OpenShare+Weibo.h │ │ ├── OpenShareHeader.h │ │ ├── OpenShare+Alipay.h │ │ ├── OpenShare+Renren.h │ │ └── OpenShare+Weixin.h ├── Target Support Files │ ├── OpenShare │ │ ├── OpenShare-prefix.pch │ │ ├── OpenShare-dummy.m │ │ └── OpenShare.xcconfig │ └── Pods │ │ ├── Pods-dummy.m │ │ ├── Pods.debug.xcconfig │ │ ├── Pods.release.xcconfig │ │ ├── Pods-frameworks.sh │ │ └── Pods-resources.sh ├── Manifest.lock ├── OpenShare │ ├── openshare │ │ ├── OpenShare+Alipay.h │ │ ├── OpenShareHeader.h │ │ ├── OpenShare+Renren.h │ │ ├── OpenShare+Weixin.h │ │ ├── OpenShare+Weibo.h │ │ ├── OpenShare+QQ.h │ │ ├── OpenShare+Alipay.m │ │ ├── OpenShare+Renren.m │ │ ├── OpenShare.h │ │ ├── OpenShare+Weibo.m │ │ ├── OpenShare+Weixin.m │ │ ├── OpenShare+QQ.m │ │ └── OpenShare.m │ ├── README.md │ └── LICENSE └── Pods.xcodeproj │ ├── xcuserdata │ └── HZD.xcuserdatad │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ ├── Pods.xcscheme │ │ └── OpenShare.xcscheme │ └── project.pbxproj ├── TWSNSDemo ├── a.jpg ├── ViewController.h ├── AppDelegate.h ├── main.m ├── AppDelegate.m ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── ViewController.m └── Info.plist ├── Podfile ├── TWSNS ├── Resources │ ├── share-qq@3x.png │ ├── share-qqzone@3x.png │ ├── share-weibo@3x.png │ ├── share-weixin@3x.png │ └── share-weixin-frends@3x.png ├── NSString+SNSAddition.h ├── TWSNSRequest.h ├── TWShareView.h ├── TWOAuth.h ├── TWShare.h ├── TWSNS.h ├── NSString+SNSAddition.m ├── TWSNSDefine.h ├── TWSNS.m ├── TWSNSRequest.m ├── TWShare.m ├── TWOAuth.m └── TWShareView.m ├── TWSNSDemo.xcworkspace ├── xcuserdata │ └── HZD.xcuserdatad │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist └── contents.xcworkspacedata ├── Podfile.lock ├── TWSNSDemo.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata ├── xcuserdata │ └── HZD.xcuserdatad │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── XTSNS.xcscheme └── project.pbxproj ├── README.md ├── TWSNS.podspec └── LICENSE /Pods/Headers/Private/OpenShare/OpenShare.h: -------------------------------------------------------------------------------- 1 | ../../../OpenShare/openshare/OpenShare.h -------------------------------------------------------------------------------- /Pods/Headers/Public/OpenShare/OpenShare.h: -------------------------------------------------------------------------------- 1 | ../../../OpenShare/openshare/OpenShare.h -------------------------------------------------------------------------------- /TWSNSDemo/a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laughmaker/TWSNS/HEAD/TWSNSDemo/a.jpg -------------------------------------------------------------------------------- /Pods/Headers/Private/OpenShare/OpenShare+QQ.h: -------------------------------------------------------------------------------- 1 | ../../../OpenShare/openshare/OpenShare+QQ.h -------------------------------------------------------------------------------- /Pods/Headers/Public/OpenShare/OpenShare+QQ.h: -------------------------------------------------------------------------------- 1 | ../../../OpenShare/openshare/OpenShare+QQ.h -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '7.0' 2 | inhibit_all_warnings! 3 | 4 | pod 'OpenShare', '~> 0.0.1' -------------------------------------------------------------------------------- /Pods/Headers/Public/OpenShare/OpenShare+Weibo.h: -------------------------------------------------------------------------------- 1 | ../../../OpenShare/openshare/OpenShare+Weibo.h -------------------------------------------------------------------------------- /Pods/Headers/Public/OpenShare/OpenShareHeader.h: -------------------------------------------------------------------------------- 1 | ../../../OpenShare/openshare/OpenShareHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Private/OpenShare/OpenShare+Alipay.h: -------------------------------------------------------------------------------- 1 | ../../../OpenShare/openshare/OpenShare+Alipay.h -------------------------------------------------------------------------------- /Pods/Headers/Private/OpenShare/OpenShare+Renren.h: -------------------------------------------------------------------------------- 1 | ../../../OpenShare/openshare/OpenShare+Renren.h -------------------------------------------------------------------------------- /Pods/Headers/Private/OpenShare/OpenShare+Weibo.h: -------------------------------------------------------------------------------- 1 | ../../../OpenShare/openshare/OpenShare+Weibo.h -------------------------------------------------------------------------------- /Pods/Headers/Private/OpenShare/OpenShare+Weixin.h: -------------------------------------------------------------------------------- 1 | ../../../OpenShare/openshare/OpenShare+Weixin.h -------------------------------------------------------------------------------- /Pods/Headers/Private/OpenShare/OpenShareHeader.h: -------------------------------------------------------------------------------- 1 | ../../../OpenShare/openshare/OpenShareHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Public/OpenShare/OpenShare+Alipay.h: -------------------------------------------------------------------------------- 1 | ../../../OpenShare/openshare/OpenShare+Alipay.h -------------------------------------------------------------------------------- /Pods/Headers/Public/OpenShare/OpenShare+Renren.h: -------------------------------------------------------------------------------- 1 | ../../../OpenShare/openshare/OpenShare+Renren.h -------------------------------------------------------------------------------- /Pods/Headers/Public/OpenShare/OpenShare+Weixin.h: -------------------------------------------------------------------------------- 1 | ../../../OpenShare/openshare/OpenShare+Weixin.h -------------------------------------------------------------------------------- /TWSNS/Resources/share-qq@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laughmaker/TWSNS/HEAD/TWSNS/Resources/share-qq@3x.png -------------------------------------------------------------------------------- /Pods/Target Support Files/OpenShare/OpenShare-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /TWSNS/Resources/share-qqzone@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laughmaker/TWSNS/HEAD/TWSNS/Resources/share-qqzone@3x.png -------------------------------------------------------------------------------- /TWSNS/Resources/share-weibo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laughmaker/TWSNS/HEAD/TWSNS/Resources/share-weibo@3x.png -------------------------------------------------------------------------------- /TWSNS/Resources/share-weixin@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laughmaker/TWSNS/HEAD/TWSNS/Resources/share-weixin@3x.png -------------------------------------------------------------------------------- /TWSNS/Resources/share-weixin-frends@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laughmaker/TWSNS/HEAD/TWSNS/Resources/share-weixin-frends@3x.png -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/OpenShare/OpenShare-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_OpenShare : NSObject 3 | @end 4 | @implementation PodsDummy_OpenShare 5 | @end 6 | -------------------------------------------------------------------------------- /TWSNSDemo.xcworkspace/xcuserdata/HZD.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - OpenShare (0.0.1) 3 | 4 | DEPENDENCIES: 5 | - OpenShare (~> 0.0.1) 6 | 7 | SPEC CHECKSUMS: 8 | OpenShare: a560580dbb729d5c0c3cc1ee84cd6aa4a07e94c6 9 | 10 | COCOAPODS: 0.39.0.beta.4 11 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - OpenShare (0.0.1) 3 | 4 | DEPENDENCIES: 5 | - OpenShare (~> 0.0.1) 6 | 7 | SPEC CHECKSUMS: 8 | OpenShare: a560580dbb729d5c0c3cc1ee84cd6aa4a07e94c6 9 | 10 | COCOAPODS: 0.39.0.beta.4 11 | -------------------------------------------------------------------------------- /TWSNSDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TWSNSDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // XTSNS 4 | // 5 | // Created by 何振东 on 15/9/8. 6 | // Copyright © 2015年 LZA. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Pods/Target Support Files/OpenShare/OpenShare.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/OpenShare" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/OpenShare" 3 | PODS_ROOT = ${SRCROOT} 4 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /TWSNSDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /TWSNSDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // XTSNS 4 | // 5 | // Created by 何振东 on 15/9/8. 6 | // Copyright © 2015年 LZA. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /TWSNSDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // XTSNS 4 | // 5 | // Created by 何振东 on 15/9/8. 6 | // Copyright © 2015年 LZA. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/OpenShare" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/OpenShare" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"OpenShare" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/OpenShare" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/OpenShare" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"OpenShare" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /TWSNS/NSString+SNSAddition.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+URL.h 3 | // XTSNS 4 | // 5 | // Created by 何振东 on 15/9/14. 6 | // Copyright © 2015年 LZA. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (SNSAddition) 12 | 13 | /// 将字符串进行Url编码 14 | - (NSString *)encodeURL; 15 | 16 | /// 将字符串进行Hash 17 | - (NSString *)hmacSha1WithKey:(NSString *)key; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/OpenShare/openshare/OpenShare+Alipay.h: -------------------------------------------------------------------------------- 1 | // 2 | // OpenShare+Alipay.h 3 | // openshare 4 | // 5 | // Created by LiuLogan on 15/6/4. 6 | // Copyright (c) 2015年 OpenShare . All rights reserved. 7 | // 8 | 9 | #import "OpenShare.h" 10 | 11 | @interface OpenShare (Alipay) 12 | +(void)connectAlipay; 13 | +(void)AliPay:(NSString*)link Success:(paySuccess)success Fail:(payFail)fail; 14 | @end 15 | -------------------------------------------------------------------------------- /Pods/OpenShare/openshare/OpenShareHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // OpenShareHeader.h 3 | // openshare 4 | // 5 | // Created by LiuLogan on 15/5/15. 6 | // Copyright (c) 2015年 OpenShare . All rights reserved. 7 | // 8 | 9 | #ifndef openshare_OpenShareHeader_h 10 | #define openshare_OpenShareHeader_h 11 | #import "OpenShare+QQ.h" 12 | #import "OpenShare+Weibo.h" 13 | #import "OpenShare+Weixin.h" 14 | #import "OpenShare+Renren.h" 15 | #import "OpenShare+Alipay.h" 16 | #endif 17 | -------------------------------------------------------------------------------- /TWSNS/TWSNSRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // XTRequest.h 3 | // XTSNS 4 | // 5 | // Created by 何振东 on 15/9/14. 6 | // Copyright © 2015年 LZA. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TWSNSRequest : NSObject 12 | 13 | + (void)get:(NSString *)urlPath completionHandler:(void (^)(id data, NSError *error))completionHandler; 14 | + (void)get:(NSString *)urlPath params:(NSDictionary *)params completionHandler:(void (^)(id, NSError *))completionHandler; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #基于[openshare](https://github.com/100apps/openshare)的社会化组件 2 | 包含第三方登录和分享 3 | 4 | * 目前完成微信、微博和qq平台的登录和分享 5 | * 分享部分主要是做了一些小封装,方便调用。 6 | * 第三方登录,在原[openshare](https://github.com/100apps/openshare)里,登录成功后,并没有获取用户信息,这里做了扩展,登录成功后,再去读取用户的相关信息 7 | 8 | pod安装方式 9 | 10 | pod 'TWSNS', '~> 1.0.5' 11 | 12 | 微信的获取用户信息接口:http://mp.weixin.qq.com/wiki/17/c0f37d5704f0b64713d5d2c37b468d75.html 13 | 14 | 微博的获取用户接口:http://open.weibo.com/wiki/2/users/show 15 | 16 | QQ的获取用户信息接口:http://wiki.open.qq.com/wiki/v3/user/get_info 17 | -------------------------------------------------------------------------------- /TWSNS/TWShareView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XTShareView.h 3 | // XTSNS 4 | // 5 | // Created by 何振东 on 15/9/9. 6 | // Copyright © 2015年 LZA. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TWSNS.h" 11 | #import "OpenShareHeader.h" 12 | 13 | @interface TWShareView : UIControl 14 | 15 | /// 便利方法获取分享视图 16 | + (instancetype)shareView; 17 | 18 | /// 显示分享视图 19 | - (void)showShareViewWithMessage:(OSMessage *)message completionHandler:(void (^)(OSMessage *message, NSError *error))completionHandler; 20 | 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/OpenShare/openshare/OpenShare+Renren.h: -------------------------------------------------------------------------------- 1 | // 2 | // OpenShare+Renren.h 3 | // openshare 4 | // 5 | // Created by LiuLogan on 15/5/19. 6 | // Copyright (c) 2015年 OpenShare . All rights reserved. 7 | // 8 | 9 | #import "OpenShare.h" 10 | 11 | @interface OpenShare (Renren) 12 | +(void)connectRenrenWithAppId:(NSString *)appId AndAppKey:(NSString*)appKey; 13 | +(BOOL)isRenrenInstalled; 14 | 15 | +(void)shareToRenrenSession:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail; 16 | +(void)shareToRenrenTimeline:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /TWSNS/TWOAuth.h: -------------------------------------------------------------------------------- 1 | // 2 | // XTOAuth.h 3 | // 4 | // 5 | // Created by 何振东 on 15/8/10. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | #import "TWSNSRequest.h" 12 | #import "TWSNS.h" 13 | #import "TWSNSDefine.h" 14 | 15 | /** 16 | * 第三方登录封装接口,提供登录,获取用户信息等 17 | */ 18 | @interface TWOAuth : NSObject 19 | 20 | /** 21 | * 登录到第三方平台 22 | * 23 | * @param platform 平台类型 24 | * @param completionHandler 完成后的代理,成功后会返回用户信息,失败后会返回失败信息 25 | */ 26 | + (void)loginToPlatform:(TWSNSPlatform)platform completionHandle:(void (^)(NSDictionary *data, NSError *error))completionHandler; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /TWSNS/TWShare.h: -------------------------------------------------------------------------------- 1 | // 2 | // XTShare.h 3 | // 4 | // 5 | // Created by 何振东 on 15/8/10. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | #import "TWSNS.h" 12 | #import "OpenShare.h" 13 | #import "TWSNSDefine.h" 14 | 15 | /** 16 | * 分享控制类 17 | */ 18 | @interface TWShare : NSObject 19 | 20 | /** 21 | * 分享消息的内容到相应平台 22 | * 23 | * @param message 分享消息 24 | * @param shareType 分享类型 25 | * @param completionHandler 成功失败代理 26 | */ 27 | + (void)shareMessage:(OSMessage *)message withShareType:(TWSNSShareType)shareType completionHandler:(void (^)(OSMessage *message, NSError *error))completionHandler; 28 | 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /TWSNS.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "TWSNS" 4 | s.version = "1.1.4" 5 | s.summary = "社会化分享和第三方登录模块" 6 | s.homepage = "https://github.com/laughmaker/TWSNS" 7 | s.license = { :type => "MIT", :file => "LICENSE" } 8 | s.author = { "hezhendong" => "wskrdfeai@gmail.com" } 9 | s.platform = :ios, "7.0" 10 | s.source = { :git => "https://github.com/laughmaker/TWSNS.git", :tag => s.version } 11 | s.source_files = "TWSNS/**" 12 | s.resources = "TWSNS/Resources/*.png" 13 | s.frameworks = "UIKit", "CoreGraphics", "Foundation" 14 | # s.libraries = "commoncrypto" 15 | s.dependency 'OpenShare', '~> 0.0.1' 16 | 17 | end 18 | -------------------------------------------------------------------------------- /TWSNS/TWSNS.h: -------------------------------------------------------------------------------- 1 | // 2 | // XTSNS.h 3 | // XTSNS 4 | // 5 | // Created by 何振东 on 15/9/9. 6 | // Copyright © 2015年 LZA. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TWShare.h" 11 | #import "TWShareView.h" 12 | #import "TWOAuth.h" 13 | #import "OpenShareHeader.h" 14 | #import "OpenShare.h" 15 | #import "TWSNSDefine.h" 16 | 17 | @interface TWSNS : NSObject 18 | 19 | //注册相应平台的信息 20 | + (void)registerWeiboAppId:(NSString *)appId secret:(NSString *)secret redirectURI:(NSString *)redirectURI; 21 | + (void)registerQQAppId:(NSString *)appId secret:(NSString *)secret; 22 | + (void)registerWeiXinAppId:(NSString *)appId secret:(NSString *)secret; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/HZD.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | OpenShare.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods.xcscheme 13 | 14 | isShown 15 | 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 6EB7BBA4823EE93AED27E42911F8803E 21 | 22 | primary 23 | 24 | 25 | FB4FEEBB366D994C57115C550AC4D73E 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /TWSNSDemo.xcodeproj/xcuserdata/HZD.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | XTSNS.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 28371DD71B9ED0100012CEF6 16 | 17 | primary 18 | 19 | 20 | 28371DF01B9ED0100012CEF6 21 | 22 | primary 23 | 24 | 25 | 28371DFB1B9ED0100012CEF6 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Pods/OpenShare/openshare/OpenShare+Weixin.h: -------------------------------------------------------------------------------- 1 | // 2 | // OpenShare+Weixin.h 3 | // openshare 4 | // 5 | // Created by LiuLogan on 15/5/18. 6 | // Copyright (c) 2015年 OpenShare . All rights reserved. 7 | // 8 | 9 | #import "OpenShare.h" 10 | 11 | @interface OpenShare (Weixin) 12 | /** 13 | * https://open.weixin.qq.com 在这里申请 14 | * 15 | * @param appId AppID 16 | */ 17 | +(void)connectWeixinWithAppId:(NSString *)appId; 18 | +(BOOL)isWeixinInstalled; 19 | 20 | +(void)shareToWeixinSession:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail; 21 | +(void)shareToWeixinTimeline:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail; 22 | +(void)shareToWeixinFavorite:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail; 23 | +(void)WeixinAuth:(NSString*)scope Success:(authSuccess)success Fail:(authFail)fail; 24 | +(void)WeixinPay:(NSString*)link Success:(paySuccess)success Fail:(payFail)fail; 25 | @end 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 xiaotujieshu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Pods/OpenShare/openshare/OpenShare+Weibo.h: -------------------------------------------------------------------------------- 1 | // 2 | // OpenShare+Weibo.h 3 | // openshare 4 | // 5 | // Created by LiuLogan on 15/5/18. 6 | // Copyright (c) 2015年 OpenShare . All rights reserved. 7 | // 8 | 9 | #import "OpenShare.h" 10 | 11 | @interface OpenShare (Weibo) 12 | 13 | /** 14 | * 可以点击「编辑」修改Bundle ID,要和这里的一致,否则auth的时候会返回error_code=21338 15 | * 16 | * @param appKey 申请到的appKey 17 | */ 18 | +(void)connectWeiboWithAppKey:(NSString *)appKey; 19 | +(BOOL)isWeiboInstalled; 20 | /** 21 | * 分享到微博,微博只支持三种类型:文本/图片/链接。根据OSMessage自动判定想分享的类型。 22 | * 23 | * @param msg 要分享的msg 24 | * @param success 分享成功回调 25 | * @param fail 分享失败回调 26 | */ 27 | +(void)shareToWeibo:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail; 28 | 29 | /** 30 | * 微博登录OAuth 31 | * 32 | * @param scope scope,如果不填写,默认是all 33 | * @param redirectURI 必须填写,可以通过http://open.weibo.com/apps/402180334/info/advanced编辑(后台不验证,但是必须填写一致) 34 | * @param success 登录成功回调 35 | * @param fail 登录失败回调 36 | */ 37 | +(void)WeiboAuth:(NSString*)scope redirectURI:(NSString*)redirectURI Success:(authSuccess)success Fail:(authFail)fail; 38 | @end 39 | -------------------------------------------------------------------------------- /TWSNS/NSString+SNSAddition.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+URL.m 3 | // XTSNS 4 | // 5 | // Created by 何振东 on 15/9/14. 6 | // Copyright © 2015年 LZA. All rights reserved. 7 | // 8 | 9 | #import "NSString+SNSAddition.h" 10 | #include 11 | #include 12 | 13 | @implementation NSString (SNSAddition) 14 | 15 | - (NSString *)encodeURL 16 | { 17 | return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(NULL, (__bridge CFStringRef)self, NULL, (__bridge CFStringRef)@"!*'();:@&=+$.,/?%#[]", kCFStringEncodingUTF8); 18 | } 19 | 20 | - (NSString *)hmacSha1WithKey:(NSString *)key 21 | { 22 | const char *cKey = [key cStringUsingEncoding:NSUTF8StringEncoding]; 23 | const char *cData = [self cStringUsingEncoding:NSUTF8StringEncoding]; 24 | 25 | char cHMAC[CC_SHA1_DIGEST_LENGTH]; 26 | 27 | CCHmac(kCCHmacAlgSHA1, cKey, strlen(cKey), cData, strlen(cData), cHMAC); 28 | 29 | NSData *HMAC = [[NSData alloc] initWithBytes:cHMAC length:CC_SHA1_DIGEST_LENGTH]; 30 | NSString *hash = [HMAC base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength]; 31 | return hash; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /TWSNS/TWSNSDefine.h: -------------------------------------------------------------------------------- 1 | // 2 | // XTSNSDefine.h 3 | // XTSNS 4 | // 5 | // Created by 何振东 on 15/9/9. 6 | // Copyright © 2015年 LZA. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // 定义社交平台类型 12 | typedef enum : NSUInteger { 13 | TWSNSPlatformWeiXin = 1, 14 | TWSNSPlatformQQ, 15 | TWSNSPlatformWeibo, 16 | } TWSNSPlatform; 17 | 18 | 19 | // 定义分享类型 20 | typedef enum : NSUInteger { 21 | TWSNSShareTypeWXSceneSession = 1, // 分享到微信会话 22 | TWSNSShareTypeWXSceneTimeline, // 分享到微信朋友圈 23 | TWSNSShareTypeQQ, // 分享到QQ好友 24 | TWSNSShareTypeQQZone, // 分享到QQ空间 25 | TWSNSShareTypeWeibo, // 分享到新浪微博 26 | } TWSNSShareType; 27 | 28 | 29 | // 定义相关常量定义Key 30 | static NSString *const kSNSPlatformWeixinIdKey = @"kSNSPlatformWeixinIdKey"; 31 | static NSString *const kSNSPlatformWeiboIdKey = @"kSNSPlatformWeiboIdKey"; 32 | static NSString *const kSNSPlatformQQIdKey = @"kSNSPlatformQQIdKey"; 33 | static NSString *const kSNSPlatformWeixinSecretKey = @"kSNSPlatformWeixinSecretKey"; 34 | static NSString *const kSNSPlatformWeiboSecretKey = @"kSNSPlatformWeiboSecretKey"; 35 | static NSString *const kSNSPlatformWeiboRedirectURIKey = @"kSNSPlatformWeiboRedirectURIKey"; 36 | static NSString *const kSNSPlatformQQSecretKey = @"kSNSPlatformQQSecretKey"; 37 | -------------------------------------------------------------------------------- /TWSNSDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // XTSNS 4 | // 5 | // Created by 何振东 on 15/9/8. 6 | // Copyright © 2015年 LZA. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "TWSNS.h" 11 | #import "NSString+SNSAddition.h" 12 | 13 | //#warning 请替换为自己的相关帐号进行测试 14 | ///微信第三方登录 15 | static NSString *const kWeiXinAppId = @""; 16 | static NSString *const kWeiXinAppSecret = @""; 17 | 18 | ///微博第三方登录 19 | static NSString *const kWeiBoAppId = @""; 20 | static NSString *const kWeiBoAppSecret = @""; 21 | static NSString *const kWeiBoAppRedirectURL = @""; 22 | 23 | ///QQ第三方登录 24 | static NSString *const kQQAppId = @""; 25 | static NSString *const kQQAppKey = @""; 26 | 27 | @interface AppDelegate () 28 | 29 | @end 30 | 31 | @implementation AppDelegate 32 | 33 | 34 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 35 | { 36 | [TWSNS registerQQAppId:kQQAppId secret:kQQAppKey]; 37 | [TWSNS registerWeiboAppId:kWeiBoAppId secret:kWeiBoAppSecret redirectURI:kWeiBoAppRedirectURL]; 38 | [TWSNS registerWeiXinAppId:kWeiXinAppId secret:kWeiXinAppSecret]; 39 | 40 | return YES; 41 | } 42 | 43 | 44 | - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation 45 | { 46 | if ([OpenShare handleOpenURL:url]) { 47 | return YES; 48 | } 49 | 50 | return YES; 51 | 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /TWSNS/TWSNS.m: -------------------------------------------------------------------------------- 1 | // 2 | // XTSNS.m 3 | // XTSNS 4 | // 5 | // Created by 何振东 on 15/9/9. 6 | // Copyright © 2015年 LZA. All rights reserved. 7 | // 8 | 9 | #import "TWSNS.h" 10 | 11 | @implementation TWSNS 12 | 13 | + (void)registerWeiboAppId:(NSString *)appId secret:(NSString *)secret redirectURI:(NSString *)redirectURI 14 | { 15 | [OpenShare connectWeiboWithAppKey:appId]; 16 | 17 | [[NSUserDefaults standardUserDefaults] setObject:appId forKey:kSNSPlatformWeiboIdKey]; 18 | [[NSUserDefaults standardUserDefaults] setObject:secret forKey:kSNSPlatformWeiboSecretKey]; 19 | [[NSUserDefaults standardUserDefaults] setObject:redirectURI forKey:kSNSPlatformWeiboRedirectURIKey]; 20 | [[NSUserDefaults standardUserDefaults] synchronize]; 21 | } 22 | 23 | + (void)registerQQAppId:(NSString *)appId secret:(NSString *)secret 24 | { 25 | [OpenShare connectQQWithAppId:appId]; 26 | 27 | [[NSUserDefaults standardUserDefaults] setObject:appId forKey:kSNSPlatformQQIdKey]; 28 | [[NSUserDefaults standardUserDefaults] setObject:secret forKey:kSNSPlatformQQSecretKey]; 29 | [[NSUserDefaults standardUserDefaults] synchronize]; 30 | } 31 | 32 | + (void)registerWeiXinAppId:(NSString *)appId secret:(NSString *)secret 33 | { 34 | [OpenShare connectWeixinWithAppId:appId]; 35 | 36 | [[NSUserDefaults standardUserDefaults] setObject:appId forKey:kSNSPlatformWeixinIdKey]; 37 | [[NSUserDefaults standardUserDefaults] setObject:secret forKey:kSNSPlatformWeixinSecretKey]; 38 | [[NSUserDefaults standardUserDefaults] synchronize]; 39 | } 40 | 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/OpenShare/openshare/OpenShare+QQ.h: -------------------------------------------------------------------------------- 1 | // 2 | // OpenShare+QQ.h 3 | // openshare 4 | // 5 | // Created by LiuLogan on 15/5/15. 6 | // Copyright (c) 2015年 OpenShare . All rights reserved. 7 | // 8 | 9 | #import "OpenShare.h" 10 | 11 | @interface OpenShare (QQ) 12 | /** 13 | * 连接QQ平台。可以分享到:qq好友/qq空间。只需要appId:http://op.open.qq.com/index.php?mod=appinfo&act=main&appid=1103194207#mobile|center 14 | * 需要添加CFBundleURLSchemes: 15 | * 16 | * tencent1103194207 17 | * tencent1103194207.content 18 | * QQ41C1685F 16进制表示的appid,可以通过new Number(1103194207).toString(16).toUpperCase()获取。 19 | * @param appId 所申请的应用的APP ID 20 | */ 21 | +(void)connectQQWithAppId:(NSString *)appId; 22 | +(BOOL)isQQInstalled; 23 | 24 | +(void)shareToQQFriends:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail; 25 | +(void)shareToQQZone:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail; 26 | +(void)shareToQQFavorites:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail; 27 | +(void)shareToQQDataline:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail; 28 | +(void)QQAuth:(NSString*)scope Success:(authSuccess)success Fail:(authFail)fail; 29 | /** 30 | * 打开WPA临时会话 31 | * 32 | * @param qqNumber 要聊天的QQ号 33 | */ 34 | +(void)chatWithQQNumber:(NSString*)qqNumber; 35 | /** 36 | * 打开某个群聊天。QQ客户端登录的QQ号,必须是groupNumber的成员才能聊天。 37 | * 38 | * @param groupNumber 群号码 39 | */ 40 | +(void)chatInQQGroup:(NSString*)groupNumber; 41 | /** 42 | * 是否能处理这个openUrl,如果能就返回YES,并且按照callback处理,否则返回NO,交给下一个处理。 43 | * 44 | * @param url openURL 45 | * @param success success callback 46 | * @param fail fail callback 47 | * 48 | * @return 是否能处理给定的url 49 | */ 50 | +(BOOL)QQ_handleOpenURL; 51 | @end 52 | -------------------------------------------------------------------------------- /TWSNSDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /TWSNSDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // XTSNS 4 | // 5 | // Created by 何振东 on 15/9/8. 6 | // Copyright © 2015年 LZA. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "TWSNS.h" 11 | 12 | 13 | @interface ViewController () 14 | - (IBAction)share:(id)sender; 15 | - (IBAction)qqLogin:(id)sender; 16 | 17 | - (IBAction)weiboLogin:(id)sender; 18 | - (IBAction)weixinLogin:(id)sender; 19 | 20 | @end 21 | 22 | @implementation ViewController 23 | 24 | - (void)viewDidLoad { 25 | [super viewDidLoad]; 26 | 27 | 28 | } 29 | 30 | 31 | - (IBAction)share:(id)sender 32 | { 33 | OSMessage *message = [[OSMessage alloc] init]; 34 | message.title = @"我爱我的因我觉得欢喜~~~这里是你要分享的内容"; 35 | message.image = UIImageJPEGRepresentation([UIImage imageNamed:@"a.jpg"], 0.1); 36 | message.thumbnail = UIImageJPEGRepresentation([UIImage imageNamed:@"a.jpg"], 0.1); 37 | message.desc = @"哈哈,这里是描述"; 38 | message.link = @"http://www.3water3.com"; 39 | [[TWShareView shareView] showShareViewWithMessage:message completionHandler:^(OSMessage *message, NSError *error) { 40 | NSLog(@"message:%@", message); 41 | NSLog(@"error:%@", error); 42 | }]; 43 | } 44 | 45 | - (IBAction)qqLogin:(id)sender { 46 | [TWOAuth loginToPlatform:TWSNSPlatformQQ completionHandle:^(NSDictionary *data, NSError *error) 47 | { 48 | NSLog(@"data:%@", data); 49 | NSLog(@"error:%@", error); 50 | }]; 51 | } 52 | 53 | - (IBAction)weiboLogin:(id)sender { 54 | [TWOAuth loginToPlatform:TWSNSPlatformWeibo completionHandle:^(NSDictionary *data, NSError *error) 55 | { 56 | NSLog(@"data:%@", data); 57 | NSLog(@"error:%@", error); 58 | }]; 59 | } 60 | 61 | - (IBAction)weixinLogin:(id)sender { 62 | [TWOAuth loginToPlatform:TWSNSPlatformWeiXin completionHandle:^(NSDictionary *data, NSError *error) 63 | { 64 | NSLog(@"data:%@", data); 65 | NSLog(@"error:%@", error); 66 | }]; 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/HZD.xcuserdatad/xcschemes/Pods.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/HZD.xcuserdatad/xcschemes/OpenShare.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /TWSNS/TWSNSRequest.m: -------------------------------------------------------------------------------- 1 | // 2 | // XTRequest.m 3 | // XTSNS 4 | // 5 | // Created by 何振东 on 15/9/14. 6 | // Copyright © 2015年 LZA. All rights reserved. 7 | // 8 | 9 | #import "TWSNSRequest.h" 10 | 11 | @implementation TWSNSRequest 12 | 13 | + (void)get:(NSString *)urlPath completionHandler:(void (^)(id data, NSError *error))completionHandler 14 | { 15 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlPath]]; 16 | request.HTTPMethod = @"GET"; 17 | 18 | NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { 19 | 20 | id responseObject = nil; 21 | NSError *err = nil; 22 | if (data) { 23 | responseObject = [NSJSONSerialization JSONObjectWithData:data options:0 error:&err]; 24 | } 25 | 26 | if (completionHandler) { 27 | dispatch_async(dispatch_get_main_queue(), ^{ 28 | completionHandler(responseObject, error); 29 | }); 30 | } 31 | }]; 32 | [task resume]; 33 | } 34 | 35 | + (void)get:(NSString *)urlPath params:(NSDictionary *)params completionHandler:(void (^)(id, NSError *))completionHandler 36 | { 37 | NSMutableString *paramsString = @"?".mutableCopy; 38 | for (NSString *key in params.allKeys) { 39 | [paramsString appendFormat:@"%@=%@&", key, params[key]]; 40 | } 41 | NSString *url = [NSString stringWithFormat:@"%@%@", urlPath, paramsString]; 42 | url = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 43 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]]; 44 | request.HTTPMethod = @"GET"; 45 | 46 | NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { 47 | id responseObject = nil; 48 | NSError *err = nil; 49 | if (data) { 50 | responseObject = [NSJSONSerialization JSONObjectWithData:data options:0 error:&err]; 51 | } 52 | 53 | if (completionHandler) { 54 | dispatch_async(dispatch_get_main_queue(), ^{ 55 | completionHandler(responseObject, error); 56 | }); 57 | } 58 | }]; 59 | [task resume]; 60 | } 61 | 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /TWSNSDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleURLTypes 22 | 23 | 24 | CFBundleTypeRole 25 | Editor 26 | CFBundleURLName 27 | weixin 28 | CFBundleURLSchemes 29 | 30 | 31 | 32 | CFBundleTypeRole 33 | Editor 34 | CFBundleURLName 35 | weibo.com 36 | CFBundleURLSchemes 37 | 38 | 39 | 40 | CFBundleTypeRole 41 | Editor 42 | CFBundleURLName 43 | tencent 44 | CFBundleURLSchemes 45 | 46 | 47 | 48 | CFBundleTypeRole 49 | Editor 50 | CFBundleURLName 51 | qq 52 | CFBundleURLSchemes 53 | 54 | 55 | 56 | CFBundleVersion 57 | 1 58 | LSApplicationQueriesSchemes 59 | 60 | weixin 61 | wechat 62 | 63 | LSRequiresIPhoneOS 64 | 65 | NSAppTransportSecurity 66 | 67 | NSAllowsArbitraryLoads 68 | 69 | 70 | UILaunchStoryboardName 71 | LaunchScreen 72 | UIMainStoryboardFile 73 | Main 74 | UIRequiredDeviceCapabilities 75 | 76 | armv7 77 | 78 | UISupportedInterfaceOrientations 79 | 80 | UIInterfaceOrientationPortrait 81 | UIInterfaceOrientationLandscapeLeft 82 | UIInterfaceOrientationLandscapeRight 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /Pods/OpenShare/openshare/OpenShare+Alipay.m: -------------------------------------------------------------------------------- 1 | // 2 | // OpenShare+Alipay.m 3 | // openshare 4 | // 5 | // Created by LiuLogan on 15/6/4. 6 | // Copyright (c) 2015年 OpenShare . All rights reserved. 7 | // 8 | 9 | #import "OpenShare+Alipay.h" 10 | 11 | @implementation OpenShare (Alipay) 12 | static NSString* schema=@"Alipay"; 13 | /** 14 | * 支付宝支付参数都是从服务器获得的,所以不需要注册key。但是还是需要先connect向OpenShare注册,以便回调。 15 | */ 16 | +(void)connectAlipay{ 17 | [self set:schema Keys:@{@"schema":schema}]; 18 | } 19 | 20 | +(BOOL)isAlipayInstalled{ 21 | return [self canOpen:@"alipay://"]; 22 | } 23 | +(void)AliPay:(NSString*)link Success:(paySuccess)success Fail:(payFail)fail{ 24 | [self setPaySuccessCallback:success]; 25 | [self setPayFailCallback:fail]; 26 | if ([self isAlipayInstalled]) { 27 | //支付宝为了用户体验,会把截屏放在支付的后面当背景,可选项。当然也可以用其他的自己生成的UIImage,比如[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Default@2x" ofType:@"png"]] 28 | UIImage *screenShot= [self screenshot]; 29 | //获取到fromAppUrlScheme,来设置截屏。 30 | NSString *linkStr=[self urlDecode:[link substringFromIndex:NSMaxRange([link rangeOfString:@"?"])]]; 31 | NSDictionary *linkDic=[NSJSONSerialization JSONObjectWithData:[linkStr dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:nil]; 32 | [[UIPasteboard generalPasteboard] setData:[NSKeyedArchiver archivedDataWithRootObject:@{@"image_data" :UIImagePNGRepresentation(screenShot),@"scheme" :linkDic[@"fromAppUrlScheme"]}] forPasteboardType:@"com.alipay.alipayClient.screenImage"]; 33 | //END 设置截屏(可以不设置,注释掉这块代码即可。)。 34 | 35 | [self openURL:link]; 36 | } 37 | } 38 | +(BOOL)Alipay_handleOpenURL{ 39 | NSURL* url=[self returnedURL]; 40 | if ([url.absoluteString rangeOfString:@"//safepay/"].location != NSNotFound) { 41 | NSError *err; 42 | NSDictionary *ret=[NSJSONSerialization JSONObjectWithData:[[self urlDecode:url.query]dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:&err]; 43 | if (err||ret[@"memo"]==[NSNull null]||[ret[@"memo"][@"ResultStatus"] intValue]!=9000) { 44 | if ([self payFailCallback]) { 45 | [self payFailCallback](ret,err?:[NSError errorWithDomain:@"alipay_pay" code:ret[@"memo"]!=[NSNull null]?[ret[@"memo"][@"ResultStatus"] intValue]:-1 userInfo:ret]); 46 | } 47 | }else{ 48 | if ([self paySuccessCallback]) { 49 | [self paySuccessCallback](ret); 50 | } 51 | } 52 | return YES; 53 | }else{ 54 | return NO; 55 | } 56 | } 57 | @end 58 | -------------------------------------------------------------------------------- /TWSNS/TWShare.m: -------------------------------------------------------------------------------- 1 | // 2 | // XTShare.m 3 | // 4 | // 5 | // Created by 何振东 on 15/8/10. 6 | // 7 | // 8 | 9 | #import "TWShare.h" 10 | #import "OpenShareHeader.h" 11 | #import "OpenShare.h" 12 | 13 | @implementation TWShare 14 | 15 | + (instancetype)share 16 | { 17 | return [[[self class] alloc] init]; 18 | } 19 | 20 | + (void)shareMessage:(OSMessage *)message withShareType:(TWSNSShareType)shareType completionHandler:(void (^)(OSMessage *message, NSError *error))completionHandler 21 | { 22 | if (shareType == TWSNSShareTypeWeibo) { 23 | [OpenShare shareToWeibo:message Success:^(OSMessage *message) { 24 | if (completionHandler) { 25 | completionHandler(message, nil); 26 | } 27 | } Fail:^(OSMessage *message, NSError *error) { 28 | if (completionHandler) { 29 | completionHandler(message, error); 30 | } 31 | }]; 32 | } else if (shareType == TWSNSShareTypeQQZone) { 33 | [OpenShare shareToQQZone:message Success:^(OSMessage *message) { 34 | if (completionHandler) { 35 | completionHandler(message, nil); 36 | } 37 | } Fail:^(OSMessage *message, NSError *error) { 38 | if (completionHandler) { 39 | completionHandler(message, error); 40 | } 41 | }]; 42 | } else if (shareType == TWSNSShareTypeQQ) { 43 | [OpenShare shareToQQFriends:message Success:^(OSMessage *message) { 44 | if (completionHandler) { 45 | completionHandler(message, nil); 46 | } 47 | } Fail:^(OSMessage *message, NSError *error) { 48 | if (completionHandler) { 49 | completionHandler(message, error); 50 | } 51 | }]; 52 | } else if (shareType == TWSNSShareTypeWXSceneTimeline) { 53 | [OpenShare shareToWeixinTimeline:message Success:^(OSMessage *message) { 54 | if (completionHandler) { 55 | completionHandler(message, nil); 56 | } 57 | } Fail:^(OSMessage *message, NSError *error) { 58 | if (completionHandler) { 59 | completionHandler(message, error); 60 | } 61 | }]; 62 | } else if (shareType == TWSNSShareTypeWXSceneSession) { 63 | [OpenShare shareToWeixinSession:message Success:^(OSMessage *message) { 64 | if (completionHandler) { 65 | completionHandler(message, nil); 66 | } 67 | } Fail:^(OSMessage *message, NSError *error) { 68 | if (completionHandler) { 69 | completionHandler(message, error); 70 | } 71 | }]; 72 | } 73 | } 74 | 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Pods/OpenShare/openshare/OpenShare+Renren.m: -------------------------------------------------------------------------------- 1 | // 2 | // OpenShare+Renren.m 3 | // openshare 4 | // 5 | // Created by LiuLogan on 15/5/19. 6 | // Copyright (c) 2015年 OpenShare . All rights reserved. 7 | // 8 | 9 | #import "OpenShare+Renren.h" 10 | 11 | @implementation OpenShare (Renren) 12 | static NSString* schema=@"Renren"; 13 | +(void)connectRenrenWithAppId:(NSString *)appId AndAppKey:(NSString*)appKey{ 14 | [self set:schema Keys:@{@"appid":appId,@"appkey":appKey}]; 15 | } 16 | +(BOOL)isRenrenInstalled{ 17 | return [self canOpen:@"renrenshare://share"]; 18 | } 19 | 20 | +(void)shareToRenrenSession:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail{ 21 | if ([self beginShare:schema Message:msg Success:success Fail:fail]) { 22 | [self openURL:[self genRenrenShareUrl:msg to:0]]; 23 | } 24 | } 25 | +(void)shareToRenrenTimeline:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail{ 26 | if ([self beginShare:schema Message:msg Success:success Fail:fail]) { 27 | [self openURL:[self genRenrenShareUrl:msg to:1]]; 28 | } 29 | } 30 | +(NSString*)genRenrenShareUrl:(OSMessage*)msg to:(int)shareTo{ 31 | NSString *msgType=@"Text"; 32 | NSMutableDictionary *dic=[[NSMutableDictionary alloc] initWithDictionary:@{@"title":msg.title}]; 33 | if(msg.multimediaType==OSMultimediaTypeAudio){ 34 | dic[@"description"]=msg.desc?:msg.title; 35 | dic[@"thumbData"]=msg.thumbnail?:msg.image; 36 | dic[@"url"]=msg.link; 37 | msgType=@"Voice"; 38 | }else if(msg.multimediaType==OSMultimediaTypeVideo){ 39 | dic[@"description"]=msg.desc?:msg.title; 40 | dic[@"thumbData"]=msg.thumbnail?:msg.image; 41 | dic[@"url"]=msg.link; 42 | msgType=@"Video"; 43 | }else{ 44 | if ([msg isEmpty:nil AndNotEmpty:@[@"image",@"link"]]) { 45 | //图文 46 | dic[@"description"]=msg.desc?:msg.title; 47 | dic[@"thumbData"]=msg.thumbnail?:msg.image; 48 | dic[@"url"]=msg.link; 49 | msgType=@"ImgText"; 50 | }else if ([msg isEmpty:@[@"link"] AndNotEmpty:@[@"image"]]) { 51 | //图片 52 | dic[@"imageData"]=msg.image; 53 | dic[@"thumbData"]=msg.thumbnail?:msg.image; 54 | msgType=@"ImgText"; 55 | }else if ([msg isEmpty:@[@"link"] AndNotEmpty:@[@"image"]]) { 56 | //文本 57 | dic[@"text"]=msg.desc?:msg.title; 58 | if (msg.link) { 59 | dic[@"url"]=msg.link; 60 | } 61 | msgType=@"Text"; 62 | } 63 | } 64 | [[UIPasteboard generalPasteboard] setData:[NSPropertyListSerialization dataWithPropertyList:dic format:NSPropertyListBinaryFormat_v1_0 options:0 error:nil] forPasteboardType:@"renren_share"]; 65 | return [NSString stringWithFormat:@"renrenshare://share?sdk_ver=1.0&app_id=%@&app_key=%@&callback=renrenshare%@&msgType=%@&target=%d&msgVer=1.0&msgData=renren_share",[self keyFor:schema][@"appid"],[self keyFor:schema][@"appkey"],[self keyFor:schema][@"appid"],msgType,shareTo]; 66 | } 67 | /** 68 | * 人人网回调,人人网不传回分享结果。 69 | * 70 | * @return 是否是人人网打开的 71 | */ 72 | +(BOOL)Renren_handleOpenURL{ 73 | NSURL* url=[self returnedURL]; 74 | if ([url.scheme hasPrefix:@"renrenshare"]) { 75 | if ([self shareSuccessCallback]) { 76 | [self shareSuccessCallback]([self message]); 77 | } 78 | return YES; 79 | }else{ 80 | return NO; 81 | } 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries 46 | local swift_runtime_libs 47 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 48 | for lib in $swift_runtime_libs; do 49 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 50 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 51 | code_sign_if_enabled "${destination}/${lib}" 52 | done 53 | } 54 | 55 | # Signs a framework with the provided identity 56 | code_sign_if_enabled() { 57 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 58 | # Use the current code_sign_identitiy 59 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 60 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 61 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 62 | fi 63 | } 64 | 65 | # Strip invalid architectures 66 | strip_invalid_archs() { 67 | binary="$1" 68 | # Get architectures for current file 69 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 70 | stripped="" 71 | for arch in $archs; do 72 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 73 | # Strip non-valid architectures in-place 74 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 75 | stripped="$stripped $arch" 76 | fi 77 | done 78 | if [[ "$stripped" ]]; then 79 | echo "Stripped $binary of architectures:$stripped" 80 | fi 81 | } 82 | 83 | -------------------------------------------------------------------------------- /Pods/OpenShare/openshare/OpenShare.h: -------------------------------------------------------------------------------- 1 | // 2 | // OpenShare.h 3 | // openshare 4 | // 5 | // Created by LiuLogan on 15/5/13. 6 | // Copyright (c) 2015年 OpenShare. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | /** 12 | 分享类型,除了news以外,还可能是video/audio/app等。 13 | */ 14 | typedef enum : NSUInteger { 15 | OSMultimediaTypeNews, 16 | OSMultimediaTypeAudio, 17 | OSMultimediaTypeVideo, 18 | OSMultimediaTypeApp, 19 | OSMultimediaTypeFile, 20 | OSMultimediaTypeUndefined 21 | } OSMultimediaType; 22 | /** 23 | * OSMessage保存分享消息数据。 24 | */ 25 | @interface OSMessage : NSObject 26 | @property NSString* title; 27 | @property NSString* desc; 28 | @property NSString* link; 29 | @property NSData* image; 30 | @property NSData* thumbnail; 31 | @property OSMultimediaType multimediaType; 32 | //for 微信 33 | @property NSString* extInfo; 34 | @property NSString* mediaDataUrl; 35 | @property NSString* fileExt; 36 | /** 37 | * 判断emptyValueForKeys的value都是空的,notEmptyValueForKeys的value都不是空的。 38 | * 39 | * @param emptyValueForKeys 空值的key 40 | * @param notEmptyValueForKeys 非空值的key 41 | * 42 | * @return YES/NO 43 | */ 44 | -(BOOL)isEmpty:(NSArray*)emptyValueForKeys AndNotEmpty:(NSArray*)notEmptyValueForKeys; 45 | @end 46 | 47 | 48 | typedef void (^shareSuccess)(OSMessage * message); 49 | typedef void (^shareFail)(OSMessage * message,NSError *error); 50 | typedef void (^authSuccess)(NSDictionary * message); 51 | typedef void (^authFail)(NSDictionary * message,NSError *error); 52 | typedef void (^paySuccess)(NSDictionary * message); 53 | typedef void (^payFail)(NSDictionary * message,NSError *error); 54 | /** 55 | 粘贴板数据编码方式,目前只有两种: 56 | 1. [NSKeyedArchiver archivedDataWithRootObject:data]; 57 | 2. [NSPropertyListSerialization dataWithPropertyList:data format:NSPropertyListBinaryFormat_v1_0 options:0 error:&err]; 58 | */ 59 | typedef enum : NSUInteger { 60 | OSPboardEncodingKeyedArchiver, 61 | OSPboardEncodingPropertyListSerialization, 62 | } OSPboardEncoding; 63 | @interface OpenShare : NSObject 64 | 65 | /** 66 | * 设置平台的key 67 | * 68 | * @param platform 平台名称 69 | * @param key NSDictionary格式的key 70 | */ 71 | +(void)set:(NSString*)platform Keys:(NSDictionary *)key; 72 | /** 73 | * 获取平台的key 74 | * 75 | * @param platform 平台名称,每个category自行决定。 76 | * 77 | * @return 平台的key(NSDictionary或nil) 78 | */ 79 | +(NSDictionary *)keyFor:(NSString*)platform; 80 | 81 | /** 82 | * 通过UIApplication打开url 83 | * 84 | * @param url 需要打开的url 85 | */ 86 | +(void)openURL:(NSString*)url; 87 | +(BOOL)canOpen:(NSString*)url; 88 | /** 89 | * 处理被打开时的openurl 90 | * 91 | * @param url openurl 92 | * 93 | * @return 如果能处理,就返回YES。够则返回NO 94 | */ 95 | +(BOOL)handleOpenURL:(NSURL*)url; 96 | +(shareSuccess)shareSuccessCallback; 97 | 98 | +(shareFail)shareFailCallback; 99 | 100 | +(void)setShareSuccessCallback:(shareSuccess)suc; 101 | 102 | +(void)setShareFailCallback:(shareFail)fail; 103 | 104 | +(NSURL*)returnedURL; 105 | 106 | +(NSDictionary*)returnedData; 107 | 108 | +(void)setReturnedData:(NSDictionary*)retData; 109 | 110 | +(NSMutableDictionary *)parseUrl:(NSURL*)url; 111 | 112 | +(void)setMessage:(OSMessage*)msg; 113 | 114 | +(OSMessage*)message; 115 | 116 | +(BOOL)beginShare:(NSString*)platform Message:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail; 117 | +(BOOL)beginAuth:(NSString*)platform Success:(authSuccess)success Fail:(authFail)fail; 118 | 119 | +(NSString*)base64Encode:(NSString *)input; 120 | +(NSString*)base64Decode:(NSString *)input; 121 | +(NSString*)CFBundleDisplayName; 122 | +(NSString*)CFBundleIdentifier; 123 | 124 | +(void)setGeneralPasteboard:(NSString*)key Value:(NSDictionary*)value encoding:(OSPboardEncoding)encoding; 125 | +(NSDictionary*)generalPasteboardData:(NSString*)key encoding:(OSPboardEncoding)encoding; 126 | +(NSString*)base64AndUrlEncode:(NSString *)string; 127 | +(NSString*)urlDecode:(NSString*)input; 128 | + (UIImage *)screenshot; 129 | 130 | +(authSuccess)authSuccessCallback; 131 | +(authFail)authFailCallback; 132 | 133 | +(void)setPaySuccessCallback:(paySuccess)suc; 134 | 135 | +(void)setPayFailCallback:(payFail)fail; 136 | 137 | +(paySuccess)paySuccessCallback; 138 | +(payFail)payFailCallback; 139 | 140 | @end 141 | 142 | 143 | -------------------------------------------------------------------------------- /TWSNSDemo.xcodeproj/xcuserdata/HZD.xcuserdatad/xcschemes/XTSNS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY="$(cd "${1%/*}" && pwd)" 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 66 | fi 67 | rm -f "$RESOURCES_TO_COPY" 68 | 69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 70 | then 71 | case "${TARGETED_DEVICE_FAMILY}" in 72 | 1,2) 73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 74 | ;; 75 | 1) 76 | TARGET_DEVICE_ARGS="--target-device iphone" 77 | ;; 78 | 2) 79 | TARGET_DEVICE_ARGS="--target-device ipad" 80 | ;; 81 | *) 82 | TARGET_DEVICE_ARGS="--target-device mac" 83 | ;; 84 | esac 85 | 86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 88 | while read line; do 89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 90 | XCASSET_FILES+=("$line") 91 | fi 92 | done <<<"$OTHER_XCASSETS" 93 | 94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 95 | fi 96 | -------------------------------------------------------------------------------- /TWSNS/TWOAuth.m: -------------------------------------------------------------------------------- 1 | // 2 | // XTOAuth.m 3 | // 4 | // 5 | // Created by 何振东 on 15/8/10. 6 | // 7 | // 8 | 9 | #import "TWOAuth.h" 10 | #import "NSString+SNSAddition.h" 11 | 12 | @implementation TWOAuth 13 | 14 | + (void)loginToPlatform:(TWSNSPlatform)platform completionHandle:(void (^)(NSDictionary *, NSError *))completionHandler 15 | { 16 | 17 | if (platform == TWSNSPlatformWeibo) { 18 | NSString *redirectURI = [[NSUserDefaults standardUserDefaults] objectForKey:kSNSPlatformWeiboRedirectURIKey]; 19 | [OpenShare WeiboAuth:@"all" redirectURI:redirectURI Success:^(NSDictionary *message) { 20 | [TWOAuth weiboOAuthWithMessage:message completionHandle:completionHandler]; 21 | } Fail:^(NSDictionary *message, NSError *error) { 22 | if (completionHandler) { 23 | completionHandler(message, error); 24 | } 25 | }]; 26 | } else if (platform == TWSNSPlatformQQ) { 27 | [OpenShare QQAuth:@"get_user_info,get_simple_userinfo,get_info" Success:^(NSDictionary *message) { 28 | [TWOAuth qqOAuthWithMessage:message completionHandle:completionHandler]; 29 | } Fail:^(NSDictionary *message, NSError *error) { 30 | if (completionHandler) { 31 | completionHandler(message, error); 32 | } 33 | }]; 34 | } else if (platform == TWSNSPlatformWeiXin) { 35 | [OpenShare WeixinAuth:@"snsapi_userinfo" Success:^(NSDictionary *message) { 36 | [TWOAuth weixinOAuthWithMessage:message completionHandle:completionHandler]; 37 | } Fail:^(NSDictionary *message, NSError *error) { 38 | if (completionHandler) { 39 | completionHandler(message, error); 40 | } 41 | }]; 42 | } 43 | } 44 | 45 | + (void)weixinOAuthWithMessage:(NSDictionary *)message completionHandle:(void (^)(NSDictionary *, NSError *))completionHandler 46 | { 47 | NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; 48 | NSString *appId = [ud objectForKey:kSNSPlatformWeixinIdKey]; 49 | NSString *secret = [ud objectForKey:kSNSPlatformWeixinSecretKey]; 50 | NSString *url = [NSString stringWithFormat:@"https://api.weixin.qq.com/sns/oauth2/access_token?appid=%@&secret=%@&code=%@&grant_type=authorization_code", appId, secret, message[@"code"]]; 51 | [TWSNSRequest get:url completionHandler:^(NSDictionary *data, NSError *error) { 52 | NSString *accessToken = data[@"access_token"]; 53 | NSString *openid = data[@"openid"]; 54 | 55 | NSString *userInfoUrl = [NSString stringWithFormat:@"https://api.weixin.qq.com/sns/userinfo?access_token=%@&openid=%@&lang=zh_CN", accessToken, openid]; 56 | [TWSNSRequest get:userInfoUrl completionHandler:^(NSDictionary *userInfo, NSError *error) { 57 | NSMutableDictionary *dict = userInfo.mutableCopy; 58 | [dict addEntriesFromDictionary:message]; 59 | if (completionHandler) { 60 | completionHandler(dict, error); 61 | } 62 | }]; 63 | }]; 64 | } 65 | 66 | + (void)weiboOAuthWithMessage:(NSDictionary *)message completionHandle:(void (^)(NSDictionary *, NSError *))completionHandler 67 | { 68 | NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; 69 | NSString *url = @"https://api.weibo.com/2/users/show.json"; 70 | NSDictionary *params = @{@"source": [ud objectForKey:kSNSPlatformWeiboIdKey], 71 | @"access_token": message[@"accessToken"], 72 | @"uid": message[@"userID"]}; 73 | [TWSNSRequest get:url params:params completionHandler:^(NSDictionary *data, NSError *error) { 74 | NSMutableDictionary *dict = data.mutableCopy; 75 | [dict addEntriesFromDictionary:message]; 76 | if (completionHandler) { 77 | completionHandler(dict, error); 78 | } 79 | }]; 80 | } 81 | 82 | + (void)qqOAuthWithMessage:(NSDictionary *)message completionHandle:(void (^)(NSDictionary *, NSError *))completionHandler 83 | { 84 | NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; 85 | NSString *url = @"http://openapi.tencentyun.com/v3/user/get_info"; 86 | NSMutableDictionary *params = @{@"appid": [ud objectForKey:kSNSPlatformQQIdKey], 87 | @"openkey": message[@"access_token"], 88 | @"openid": message[@"openid"], 89 | @"pf": @"qzone", 90 | @"format": @"json"}.mutableCopy; 91 | NSMutableString *paramsString = [NSString stringWithFormat:@"GET&%@&", [@"/v3/user/get_info" encodeURL]].mutableCopy; 92 | NSArray *keys = @[@"appid", @"format", @"openid", @"openkey", @"pf"]; 93 | NSMutableString *keyValueString = @"".mutableCopy; 94 | for (NSString *key in keys) { 95 | [keyValueString appendFormat:@"%@=%@&", key, params[key]]; 96 | } 97 | [keyValueString appendString:@"userip="]; 98 | keyValueString = [keyValueString encodeURL].mutableCopy; 99 | [keyValueString appendString:@"10.0.0.1"]; 100 | NSString *signStr = [NSString stringWithFormat:@"%@%@", paramsString, keyValueString]; 101 | NSString *sss = [signStr hmacSha1WithKey:[NSString stringWithFormat:@"%@&", [ud objectForKey:kSNSPlatformQQSecretKey]]]; 102 | NSString *sig = [sss encodeURL]; 103 | params[@"sig"] = sig; 104 | params[@"userip"] = @"10.0.0.1"; 105 | 106 | NSMutableString *urlString = @"?".mutableCopy; 107 | for (NSString *key in params.allKeys) { 108 | [urlString appendFormat:@"%@=%@&", key, params[key]]; 109 | } 110 | NSString *requestUrl = [NSString stringWithFormat:@"%@%@", url, urlString]; 111 | requestUrl = [requestUrl substringToIndex:requestUrl.length - 1]; 112 | 113 | [TWSNSRequest get:requestUrl completionHandler:^(NSDictionary *data, NSError *error) { 114 | NSMutableDictionary *dict = data.mutableCopy; 115 | [dict addEntriesFromDictionary:message]; 116 | if (completionHandler) { 117 | completionHandler(dict, error); 118 | } 119 | }]; 120 | } 121 | 122 | 123 | 124 | 125 | @end 126 | -------------------------------------------------------------------------------- /TWSNSDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 35 | 44 | 53 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Pods/OpenShare/README.md: -------------------------------------------------------------------------------- 1 | ##Welcome to OpenShare. 2 | 3 | ![OpenShare Logo](https://github.com/100apps/openshare/raw/gh-pages/images/slogo.png) 4 | 5 | [![Travis](https://img.shields.io/travis/100apps/openshare.svg)](https://github.com/100apps/openshare) 6 | [![CocoaPods Version](https://img.shields.io/cocoapods/v/OpenShare.svg?style=flat)][cocoadocs] 7 | [![License](https://img.shields.io/cocoapods/l/OpenShare.svg?style=flat)][cocoadocs] 8 | [![Platform](https://img.shields.io/cocoapods/p/OpenShare.svg?style=flat)][cocoadocs] 9 | [cocoadocs]: http://cocoadocs.org/docsets/OpenShare 10 | 11 | ##TODO 12 | 13 | 1. [ ] 没有安装客户端情况下的fallback 14 | 2. [x] [支付宝和微信支付](#update-20150605) 15 | 3. [ ] Facebook和twitter等国外社交平台的支持 16 | 4. [ ] Readme国际化 17 | 18 | ##Introduction 19 | 20 | 注: 为方便书写,如无特殊说明,下文中的「*客户端*」指的是QQ、微信、微博这样的社交软件官方开发的客户端;「*app*」特指我们自己开发的应用。 21 | 22 | 楼主做iOS开发的过程中遇到这样的问题:自己app中的信息需要分享到QQ、微信、微博等社交网络。现在的客户端越做越强大,直接集成了分享功能,比如用户手机上安装了微信,只需要app调起微信,并且给微信传入相应的参数就可以了,完全不需要自己操作REST API。这样如果实现分享, 一般情况下要去官方下载SDK,然后按照官方翔一样的Demo代码和文档来改造自己的程序。这样做不仅增大了代码量(想象一下引入的官方类库,有时候,光这些第三方的SDK都要比我自己的app还大),而且使用还很繁琐(SDK一般没有源代码,想象Apple强制app支持64位的时候)。所以楼主调试了一下各个平台的SDK,研究了各个厂商实现的应用程序间通信的规则,把功能封装成了OpenShare。 23 | 24 | OpenShare的功能就是替代官方的SDK向各个平台的移动客户端(比如QQ)发起请求(分享、OAuth),然后接收返回结果。 25 | 26 | OpenShare非常小,目前支持QQ、微信、微博、人人,只有几百行代码。即使你不在项目中使用OpenShare,也可以clone下来研究一下app和客户端之间的通信机制,所以给个star是值得的。 27 | 28 | ##设计思路 29 | 30 | 比如分享功能,OpenShare有一个 OSMessage类,保存OpenShare向客户端发送的消息。分享的消息基本上有以下几种情况: 31 | 32 | 1. 纯文本 33 | 2. 图片 34 | 3. 链接 35 | 4. 其他格式多媒体(声音、视频、文件等) 36 | 37 | 这样对应OSMessage中的属性: 38 | 39 | ```objc 40 | @property NSString* title; 41 | @property NSString* desc; 42 | @property NSString* link; 43 | @property NSData* image; 44 | @property NSData* thumbnail; 45 | @property OSMultimediaType multimediaType; 46 | //for 微信 47 | @property NSString* extInfo; 48 | @property NSString* mediaDataUrl; 49 | @property NSString* fileExt; 50 | ``` 51 | 52 | 比如一个文本消息,可以只设置title,其他不管;发送一个图片,只需要设置image/thumbnail/title/desc,其他不用设置。对于其他多媒体消息,可以用multimediaType来标示。所以OSMessage可以封装所有app向客户端发的各类分享请求。 53 | 54 | 另外,还需要解决的是,客户端分享完成以后回调app的功能。我们熟悉的是block方法。而不是每个平台都到application:openURL:sourceApplication:annotation:中判断。比如最好是这样的: 55 | 56 | ```objc 57 | OSMessage *msg=[[OSMessage alloc] init]; 58 | msg.title=@"Hello World"; 59 | //分享到微信 60 | [OpenShare shareToWeixinSession:msg Success:^(OSMessage *message) { 61 | ULog(@"微信分享到会话成功:\n%@",message); 62 | } Fail:^(OSMessage *message, NSError *error) { 63 | ULog(@"微信分享到会话失败:\n%@\n%@",error,message); 64 | }]; 65 | //分享到QQ 66 | [OpenShare shareToQQFriends:msg Success:^(OSMessage *message) { 67 | ULog(@"分享到QQ好友成功:%@",msg); 68 | } Fail:^(OSMessage *message, NSError *error) { 69 | ULog(@"分享到QQ好友失败:%@\n%@",msg,error); 70 | }]; 71 | ``` 72 | 73 | 基于以上考虑,楼主用category实现了OpenShare。 74 | 75 | ##Demo 76 | 77 | 把项目clone下来以后,直接`open OpenShareDemo/openshare.xcodeproj`就可以运行了。注意sina微博的key没有通过sina的审核,直接分享会提示错误,可以替换成自己的key。 78 | 79 | ![OpenShare Demo](https://github.com/100apps/openshare/raw/gh-pages/images/demo.gif) 80 | 81 | 82 | ##如何使用 83 | 84 | OpenShare已经支持CocoaPods。所以您可以用: 85 | 86 | pod 'OpenShare', '~> 0.0' 87 | 88 | 引入OpenShare。 89 | 90 | *第零步*: 修改`Info.plist`添加`URLSchemes`,让客户端可以回调app 91 | 92 | ```xml 93 | 94 | CFBundleURLTypes 95 | 96 | 97 | CFBundleURLName 98 | OpenShare 99 | CFBundleURLSchemes 100 | 101 | 102 | wxd930ea5d5a258f4f 103 | 104 | tencent1103194207 105 | tencent1103194207.content 106 | QQ41C1685F 107 | 108 | wb402180334 109 | 110 | renrenshare228525 111 | 112 | fb776442542471056 113 | 114 | 115 | 116 | 117 | ``` 118 | 119 | *第一步*:到`AppDelegate`中的`application:didFinishLaunchingWithOptions:`中全局注册appId/appKey 120 | 121 | ```objc 122 | //全局注册appId,别忘了#import "OpenShareHeader.h" 123 | [OpenShare connectQQWithAppId:@"1103194207"]; 124 | [OpenShare connectWeiboWithAppKey:@"402180334"]; 125 | [OpenShare connectWeixinWithAppId:@"wxd930ea5d5a258f4f"]; 126 | [OpenShare connectRenrenWithAppId:@"228525" AndAppKey:@"1dd8cba4215d4d4ab96a49d3058c1d7f"]; 127 | ``` 128 | 129 | *第二步*:到`AppDelegate中`的`application:openURL:sourceApplication:annotation:`中添加整体回调: 130 | 131 | ```objc 132 | //如果OpenShare能处理这个回调,就调用block中的方法,如果不能处理,就交给其他(比如支付宝)。 133 | if ([OpenShare handleOpenURL:url]) { 134 | return YES; 135 | } 136 | ``` 137 | 138 | *第三步*:在需要分享、OAuth的地方调用: 139 | 140 | ```objc 141 | //比如微信登录,其他登录可以参考文档或者代码,或者让Xcode自动提示。 142 | [OpenShare WeixinAuth:@"snsapi_userinfo" Success:^(NSDictionary *message) { 143 | ULog(@"微信登录成功:\n%@",message); 144 | } Fail:^(NSDictionary *message, NSError *error) { 145 | ULog(@"微信登录失败:\n%@\n%@",message,error); 146 | }]; 147 | //分享纯文本消息到微信朋友圈,其他类型可以参考示例代码 148 | OSMessage *msg=[[OSMessage alloc]init]; 149 | msg.title=@"Hello msg.title"; 150 | [OpenShare shareToWeixinTimeline:msg Success:^(OSMessage *message) { 151 | ULog(@"微信分享到朋友圈成功:\n%@",message); 152 | } Fail:^(OSMessage *message, NSError *error) { 153 | ULog(@"微信分享到朋友圈失败:\n%@\n%@",error,message); 154 | }]; 155 | ``` 156 | 157 | ##扩展支持更多平台 158 | 159 | 现在的社交网络各种各样,如何把这些平台集成到OpenShare中呢?就像插件一样,可以把自己实现的`OpenShare+foobar.h`和`OpenShare+foobar.m`添加进来就可以了。[这里](http://openshare.gfzj.us/#plugins)提供了一个模板工具,只需要输入你想扩展的平台的名称,就会自动生成`.h`和`.m`文件,然后基于这个模板修改即可。 160 | 161 | ##Authors and Contributors 162 | 163 | 由于每个厂商的通信协议都不一样,所以hack的时候还是走了一些弯路,如果想了解整个实现过程,可以看看我的博客: 164 | 165 | 现在行业急需要像OAuth一样的标准,来实现app和客户端之间的分享,登录。这样就不用为每一个客户端实现一遍了。比如这个协议标准就叫做「OpenShare」(大言不惭、捂脸中)。客户端只需要声明支持OpenShare的某个版本,app就能很简单的调用了。如果您对实现OpenShare标准有任何想法,欢迎交流。 166 | 167 | ##Support or Contact 168 | 169 | 在OpenShare使用过程中有任何问题,都可以添加一个[issues](issues),我会及时解决。如果您想贡献代码,欢迎[Pull Requests](pulls)。其他任何问题可以在下面留言,或者通过邮箱联系我。 170 | 171 | ##update 20150605 172 | 173 | 支持支付宝/微信支付 174 | 175 | ![支付gif](https://raw.githubusercontent.com/100apps/openshare/gh-pages/images/pay.gif) 176 | 177 | 对于微信支付,首先要去[申请开通支付能力](https://open.weixin.qq.com)。如果app已经「获得微信支付能力」,那么请去配置`pay.php`。同样对于支付宝,也需要配置,否则demo是无法运行的。 178 | 179 | 我强烈反对把密钥等放在app客户端里面,我相信一般人也不会这么干!所以OpenShare支付只支持服务器端计算签名。`pay.php`是用「世界上最好的语言」写成,当然你可以很方便的把它转化为其他语言实现。 180 | -------------------------------------------------------------------------------- /Pods/OpenShare/openshare/OpenShare+Weibo.m: -------------------------------------------------------------------------------- 1 | // 2 | // OpenShare+Weibo.m 3 | // openshare 4 | // 5 | // Created by LiuLogan on 15/5/18. 6 | // Copyright (c) 2015年 OpenShare . All rights reserved. 7 | // 8 | 9 | #import "OpenShare+Weibo.h" 10 | 11 | @implementation OpenShare (Weibo) 12 | static NSString *schema=@"Weibo"; 13 | +(void)connectWeiboWithAppKey:(NSString *)appKey{ 14 | [self set:schema Keys:@{@"appKey":appKey}]; 15 | } 16 | +(BOOL)isWeiboInstalled{ 17 | return [self canOpen:@"weibosdk://request"]; 18 | } 19 | +(void)shareToWeibo:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail{ 20 | if (![self beginShare:schema Message:msg Success:success Fail:fail]) { 21 | return; 22 | } 23 | NSDictionary *message; 24 | if ([msg isEmpty:@[@"link" ,@"image"] AndNotEmpty:@[@"title"] ]) { 25 | //text类型分享 26 | message= @{ 27 | @"__class" : @"WBMessageObject", 28 | @"text" :msg.title 29 | }; 30 | }else if ([msg isEmpty:@[@"link" ] AndNotEmpty:@[@"title",@"image"] ]) { 31 | //图片类型分享 32 | message=@{ 33 | @"__class" : @"WBMessageObject", 34 | @"imageObject":@{ 35 | @"imageData":msg.image 36 | }, 37 | @"text" : msg.title 38 | }; 39 | 40 | }else if ([msg isEmpty:nil AndNotEmpty:@[@"title",@"link" ,@"image"] ]) { 41 | //链接类型分享 42 | message=@{ 43 | @"__class" : @"WBMessageObject", 44 | @"mediaObject":@{ 45 | @"__class" : @"WBWebpageObject", 46 | @"description": msg.desc?:msg.title, 47 | @"objectID" : @"identifier1", 48 | @"thumbnailData":msg.thumbnail?:msg.image, 49 | @"title": msg.title, 50 | @"webpageUrl":msg.link 51 | } 52 | 53 | }; 54 | } 55 | NSString *uuid=[[NSUUID UUID] UUIDString]; 56 | NSArray *messageData=@[ 57 | @{@"transferObject":[NSKeyedArchiver archivedDataWithRootObject:@{ 58 | @"__class" :@"WBSendMessageToWeiboRequest", 59 | @"message":message, 60 | @"requestID" :uuid, 61 | }]}, 62 | @{@"userInfo":[NSKeyedArchiver archivedDataWithRootObject:@{}]}, 63 | 64 | @{@"app":[NSKeyedArchiver archivedDataWithRootObject:@{ @"appKey" : [self keyFor:schema][@"appKey"],@"bundleID" : [self CFBundleIdentifier]}]} 65 | ]; 66 | [UIPasteboard generalPasteboard].items=messageData; 67 | [self openURL:[NSString stringWithFormat:@"weibosdk://request?id=%@&sdkversion=003013000",uuid]]; 68 | } 69 | 70 | +(void)WeiboAuth:(NSString*)scope redirectURI:(NSString*)redirectURI Success:(authSuccess)success Fail:(authFail)fail{ 71 | if (![self beginAuth:schema Success:success Fail:fail]) { 72 | return; 73 | } 74 | NSString *uuid=[[NSUUID UUID] UUIDString]; 75 | NSArray *authData=@[ 76 | @{@"transferObject":[NSKeyedArchiver archivedDataWithRootObject:@{ 77 | @"__class" :@"WBAuthorizeRequest", 78 | @"redirectURI":redirectURI, 79 | @"requestID" :uuid, 80 | @"scope": scope?:@"all" 81 | }]}, 82 | @{@"userInfo":[NSKeyedArchiver archivedDataWithRootObject:@{ 83 | @"mykey":@"as you like", 84 | @"SSO_From" : @"SendMessageToWeiboViewController" 85 | }] 86 | }, 87 | 88 | @{@"app":[NSKeyedArchiver archivedDataWithRootObject:@{ 89 | @"appKey" :[self keyFor:schema][@"appKey"], 90 | @"bundleID" : [self CFBundleIdentifier], 91 | @"name" :[self CFBundleDisplayName] 92 | }] 93 | } 94 | ]; 95 | [UIPasteboard generalPasteboard].items=authData; 96 | [self openURL:[NSString stringWithFormat:@"weibosdk://request?id=%@&sdkversion=003013000",uuid]]; 97 | } 98 | 99 | +(BOOL)Weibo_handleOpenURL{ 100 | NSURL* url=[self returnedURL]; 101 | if ([url.scheme hasPrefix:@"wb"]) { 102 | NSArray *items=[UIPasteboard generalPasteboard].items; 103 | NSMutableDictionary *ret=[NSMutableDictionary dictionaryWithCapacity:items.count]; 104 | for (NSDictionary *item in items) { 105 | for (NSString *k in item) { 106 | ret[k]=[k isEqualToString:@"sdkVersion"]?item[k]:[NSKeyedUnarchiver unarchiveObjectWithData:item[k]]; 107 | } 108 | } 109 | NSDictionary *transferObject=ret[@"transferObject"]; 110 | if ([transferObject[@"__class"] isEqualToString:@"WBAuthorizeResponse"]) { 111 | //auth 112 | if ([transferObject[@"statusCode"] intValue]==0) { 113 | if ([self authSuccessCallback]) { 114 | [self authSuccessCallback](transferObject); 115 | } 116 | }else{ 117 | if ([self authFailCallback]) { 118 | NSError *err=[NSError errorWithDomain:@"weibo_auth_response" code:[transferObject[@"statusCode"] intValue] userInfo:transferObject]; 119 | [self authFailCallback](transferObject,err); 120 | } 121 | } 122 | }else if ([transferObject[@"__class"] isEqualToString:@"WBSendMessageToWeiboResponse"]) { 123 | //分享回调 124 | if ([transferObject[@"statusCode"] intValue]==0) { 125 | if ([self shareSuccessCallback]) { 126 | [self shareSuccessCallback]([self message]); 127 | } 128 | }else{ 129 | if ([self shareFailCallback]) { 130 | NSError *err=[NSError errorWithDomain:@"weibo_share_response" code:[transferObject[@"statusCode"] intValue] userInfo:transferObject]; 131 | [self shareFailCallback]([self message],err); 132 | } 133 | } 134 | } 135 | return YES; 136 | } else{ 137 | return NO; 138 | } 139 | } 140 | 141 | 142 | @end 143 | -------------------------------------------------------------------------------- /Pods/OpenShare/openshare/OpenShare+Weixin.m: -------------------------------------------------------------------------------- 1 | // 2 | // OpenShare+Weixin.m 3 | // openshare 4 | // 5 | // Created by LiuLogan on 15/5/18. 6 | // Copyright (c) 2015年 OpenShare . All rights reserved. 7 | // 8 | 9 | #import "OpenShare+Weixin.h" 10 | 11 | @implementation OpenShare (Weixin) 12 | static NSString *schema=@"Weixin"; 13 | +(void)connectWeixinWithAppId:(NSString *)appId{ 14 | [self set:schema Keys:@{@"appid":appId}]; 15 | 16 | } 17 | +(BOOL)isWeixinInstalled{ 18 | return [self canOpen:@"weixin://"]; 19 | } 20 | 21 | +(void)shareToWeixinSession:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail{ 22 | if ([self beginShare:schema Message:msg Success:success Fail:fail]) { 23 | [self openURL:[self genWeixinShareUrl:msg to:0]]; 24 | } 25 | } 26 | +(void)shareToWeixinTimeline:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail{ 27 | if ([self beginShare:schema Message:msg Success:success Fail:fail]) { 28 | [self openURL:[self genWeixinShareUrl:msg to:1]]; 29 | } 30 | } 31 | +(void)shareToWeixinFavorite:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail{ 32 | if ([self beginShare:schema Message:msg Success:success Fail:fail]) { 33 | [self openURL:[self genWeixinShareUrl:msg to:2]]; 34 | } 35 | } 36 | 37 | 38 | /** 39 | * 把msg分享到shareTO 40 | * 41 | * @param msg OSmessage 42 | * @param shareTo 0是好友/1是QQ空间。 43 | * 44 | * @return 需要打开的url 45 | */ 46 | +(NSString*)genWeixinShareUrl:(OSMessage*)msg to:(int)shareTo{ 47 | NSMutableDictionary *dic=[[NSMutableDictionary alloc] initWithDictionary:@{@"result":@"1",@"returnFromApp" :@"0",@"scene" : [NSString stringWithFormat:@"%d",shareTo],@"sdkver" : @"1.5",@"command" : @"1010"}]; 48 | if (msg.multimediaType==OSMultimediaTypeNews) { 49 | msg.multimediaType=0; 50 | } 51 | if (!msg.multimediaType) { 52 | //不指定类型 53 | if ([msg isEmpty:@[@"image",@"link"] AndNotEmpty:@[@"title"]]) { 54 | //文本 55 | dic[@"command"]=@"1020"; 56 | dic[@"title"]=msg.title; 57 | }else if([msg isEmpty:@[@"link"] AndNotEmpty:@[@"image"]]){ 58 | //图片 59 | dic[@"fileData"]=msg.image; 60 | dic[@"thumbData"]=msg.thumbnail?:msg.image; 61 | dic[@"objectType"]=@"2"; 62 | }else if([msg isEmpty:nil AndNotEmpty:@[@"link",@"title",@"image"]]){ 63 | //有链接。 64 | dic[@"description"]=msg.desc?:msg.title; 65 | dic[@"mediaUrl"]=msg.link; 66 | dic[@"objectType"]=@"5"; 67 | dic[@"thumbData"]=msg.thumbnail?:msg.image; 68 | dic[@"title"] =msg.title; 69 | } 70 | }else if(msg.multimediaType==OSMultimediaTypeAudio){ 71 | //music 72 | dic[@"description"]=msg.desc?:msg.title; 73 | dic[@"mediaUrl"]=msg.link; 74 | dic[@"mediaDataUrl"]=msg.mediaDataUrl; 75 | dic[@"objectType"]=@"3"; 76 | dic[@"thumbData"]=msg.thumbnail?:msg.image; 77 | dic[@"title"] =msg.title; 78 | }else if(msg.multimediaType==OSMultimediaTypeVideo){ 79 | //video 80 | dic[@"description"]=msg.desc?:msg.title; 81 | dic[@"mediaUrl"]=msg.link; 82 | dic[@"objectType"]=@"4"; 83 | dic[@"thumbData"]=msg.thumbnail?:msg.image; 84 | dic[@"title"] =msg.title; 85 | }else if(msg.multimediaType==OSMultimediaTypeApp){ 86 | //app 87 | dic[@"description"]=msg.desc?:msg.title; 88 | if(msg.extInfo)dic[@"extInfo"]=msg.extInfo; 89 | dic[@"fileData"]=msg.image; 90 | dic[@"mediaUrl"]=msg.link; 91 | dic[@"objectType"]=@"7"; 92 | dic[@"thumbData"]=msg.thumbnail?:msg.image; 93 | dic[@"title"] =msg.title; 94 | }else if(msg.multimediaType==OSMultimediaTypeFile){ 95 | //file 96 | dic[@"description"]=msg.desc?:msg.title; 97 | dic[@"fileData"]=msg.image; 98 | dic[@"objectType"]=@"6"; 99 | dic[@"fileExt"]=msg.fileExt?:@""; 100 | dic[@"thumbData"]=msg.thumbnail?:msg.image; 101 | dic[@"title"] =msg.title; 102 | } 103 | NSData *output=[NSPropertyListSerialization dataWithPropertyList:@{[self keyFor:schema][@"appid"]:dic} format:NSPropertyListBinaryFormat_v1_0 options:0 error:nil]; 104 | [[UIPasteboard generalPasteboard] setData:output forPasteboardType:@"content"]; 105 | return [NSString stringWithFormat:@"weixin://app/%@/sendreq/?",[self keyFor:schema][@"appid"]]; 106 | } 107 | 108 | 109 | /** 110 | * 注意:微信登录权限仅限已获得认证的开发者申请,请先进行开发者认证 111 | * 112 | * @param scope scope 113 | * @param success 登录成功回调 114 | * @param fail 登录失败回调 115 | */ 116 | +(void)WeixinAuth:(NSString*)scope Success:(authSuccess)success Fail:(authFail)fail{ 117 | if ([self beginAuth:schema Success:success Fail:fail]) { 118 | [self openURL:[NSString stringWithFormat:@"weixin://app/%@/auth/?scope=%@&state=Weixinauth",[self keyFor:schema][@"appid"],scope]]; 119 | } 120 | } 121 | /** 122 | * 微信支付,不同于分享和登录,由于参数是服务器生成的,所以不需要connect。 123 | * 124 | * @param link 服务器返回的link,以供直接打开 125 | * @param success 微信支付成功的回调 126 | * @param fail 微信支付失败的回调 127 | */ 128 | +(void)WeixinPay:(NSString*)link Success:(paySuccess)success Fail:(payFail)fail{ 129 | [self setPaySuccessCallback:success]; 130 | [self setPayFailCallback:fail]; 131 | [self openURL:link]; 132 | } 133 | 134 | +(BOOL)Weixin_handleOpenURL{ 135 | NSURL* url=[self returnedURL]; 136 | if ([url.scheme hasPrefix:@"wx"]) { 137 | NSDictionary *retDic=[NSPropertyListSerialization propertyListWithData:[[UIPasteboard generalPasteboard] dataForPasteboardType:@"content"]?:[[NSData alloc] init] options:0 format:0 error:nil][[self keyFor:schema][@"appid"]]; 138 | NSLog(@"retDic\n%@",retDic); 139 | if ([url.absoluteString rangeOfString:@"://oauth"].location != NSNotFound) { 140 | //login succcess 141 | if ([self authSuccessCallback]) { 142 | [self authSuccessCallback]([self parseUrl:url]); 143 | } 144 | }else if([url.absoluteString rangeOfString:@"://pay/"].location != NSNotFound){ 145 | NSDictionary *urlMap=[self parseUrl:url]; 146 | if ([urlMap[@"ret"] intValue]==0) { 147 | if ([self paySuccessCallback]) { 148 | [self paySuccessCallback](urlMap); 149 | } 150 | }else{ 151 | if ([self payFailCallback]) { 152 | [self payFailCallback](urlMap,[NSError errorWithDomain:@"weixin_pay" code:[urlMap[@"ret"] intValue] userInfo:retDic]); 153 | } 154 | } 155 | }else{ 156 | if (retDic[@"state"]&&[retDic[@"state"] isEqualToString:@"Weixinauth"]&&[retDic[@"result"] intValue]!=0) { 157 | //登录失败 158 | if ([self authFailCallback]) { 159 | [self authFailCallback](retDic,[NSError errorWithDomain:@"weixin_auth" code:[retDic[@"result"] intValue] userInfo:retDic]); 160 | } 161 | }else if([retDic[@"result"] intValue]==0){ 162 | //分享成功 163 | if ([self shareSuccessCallback]) { 164 | [self shareSuccessCallback]([self message]); 165 | } 166 | }else{ 167 | //分享失败 168 | if ([self shareFailCallback]) { 169 | [self shareFailCallback]([self message],[NSError errorWithDomain:@"weixin_share" code:[retDic[@"result"] intValue] userInfo:retDic]); 170 | } 171 | } 172 | 173 | } 174 | return YES; 175 | }else{ 176 | return NO; 177 | } 178 | } 179 | @end 180 | -------------------------------------------------------------------------------- /Pods/OpenShare/openshare/OpenShare+QQ.m: -------------------------------------------------------------------------------- 1 | // 2 | // OpenShare+QQ.m 3 | // openshare 4 | // 5 | // Created by LiuLogan on 15/5/15. 6 | // Copyright (c) 2015年 OpenShare . All rights reserved. 7 | // 8 | 9 | #import "OpenShare+QQ.h" 10 | 11 | @implementation OpenShare (QQ) 12 | static NSString* schema=@"QQ"; 13 | enum 14 | { 15 | kQQAPICtrlFlagQZoneShareOnStart = 0x01, 16 | kQQAPICtrlFlagQZoneShareForbid = 0x02, 17 | kQQAPICtrlFlagQQShare = 0x04, 18 | kQQAPICtrlFlagQQShareFavorites = 0x08, //收藏 19 | kQQAPICtrlFlagQQShareDataline = 0x10, //数据线 20 | }; 21 | 22 | +(void)connectQQWithAppId:(NSString *)appId{ 23 | [self set:schema Keys:@{@"appid":appId,@"callback_name":[NSString stringWithFormat:@"QQ%02llx",[appId longLongValue]]}]; 24 | } 25 | +(BOOL)isQQInstalled{ 26 | return [self canOpen:@"mqqapi://"]; 27 | } 28 | +(void)shareToQQFriends:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail{ 29 | if ([self beginShare:schema Message:msg Success:success Fail:fail]) { 30 | [self openURL:[self genShareUrl:msg to:0]]; 31 | } 32 | } 33 | +(void)shareToQQZone:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail{ 34 | if ([self beginShare:schema Message:msg Success:success Fail:fail]) { 35 | [self openURL:[self genShareUrl:msg to:kQQAPICtrlFlagQZoneShareOnStart]]; 36 | } 37 | } 38 | +(void)shareToQQFavorites:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail{ 39 | if ([self beginShare:schema Message:msg Success:success Fail:fail]) { 40 | [self openURL:[self genShareUrl:msg to:kQQAPICtrlFlagQQShareFavorites]]; 41 | } 42 | } 43 | +(void)shareToQQDataline:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail{ 44 | if ([self beginShare:schema Message:msg Success:success Fail:fail]) { 45 | [self openURL:[self genShareUrl:msg to:kQQAPICtrlFlagQQShareDataline]]; 46 | } 47 | } 48 | 49 | +(void)QQAuth:(NSString*)scope Success:(authSuccess)success Fail:(authFail)fail{ 50 | if ([self beginAuth:schema Success:success Fail:fail]) { 51 | NSDictionary *authData=@{@"app_id" : [self keyFor:schema][@"appid"], 52 | @"app_name" : [self CFBundleDisplayName], 53 | //@"bundleid":[self CFBundleIdentifier],//或者有,或者正确(和后台配置一致),建议不填写。 54 | @"client_id" :[self keyFor:schema][@"appid"], 55 | @"response_type" : @"token", 56 | @"scope" : scope,//@"get_user_info,get_simple_userinfo,add_album,add_idol,add_one_blog,add_pic_t,add_share,add_topic,check_page_fans,del_idol,del_t,get_fanslist,get_idollist,get_info,get_other_info,get_repost_list,list_album,upload_pic,get_vip_info,get_vip_rich_info,get_intimate_friends_weibo,match_nick_tips_weibo", 57 | @"sdkp" :@"i", 58 | @"sdkv" : @"2.9", 59 | @"status_machine" : [[UIDevice currentDevice] model], 60 | @"status_os" : [[UIDevice currentDevice] systemVersion], 61 | @"status_version" : [[UIDevice currentDevice] systemVersion] 62 | }; 63 | 64 | [self setGeneralPasteboard:[@"com.tencent.tencent" stringByAppendingString:[self keyFor:schema][@"appid"]] Value:authData encoding:OSPboardEncodingKeyedArchiver]; 65 | [self openURL:[NSString stringWithFormat:@"mqqOpensdkSSoLogin://SSoLogin/tencent%@/com.tencent.tencent%@?generalpastboard=1",[self keyFor:schema][@"appid"],[self keyFor:schema][@"appid"]]]; 66 | } 67 | } 68 | 69 | /** 70 | * 把msg分享到shareTO 71 | * 72 | * @param msg OSmessage 73 | * @param shareTo 0是好友/1是QQ空间。 74 | * 75 | * @return 需要打开的url 76 | */ 77 | +(NSString*)genShareUrl:(OSMessage*)msg to:(int)shareTo{ 78 | NSMutableString *ret=[[NSMutableString alloc] initWithString:@"mqqapi://share/to_fri?thirdAppDisplayName="]; 79 | [ret appendString:[self base64Encode:[self CFBundleDisplayName]]]; 80 | [ret appendString:@"&version=1&cflag="]; 81 | [ret appendFormat:@"%d",shareTo]; 82 | [ret appendString:@"&callback_type=scheme&generalpastboard=1"]; 83 | [ret appendString:@"&callback_name="]; 84 | [ret appendString:[self keyFor:schema][@"callback_name"]]; 85 | [ret appendString:@"&src_type=app&shareType=0&file_type="]; 86 | //修正如果有link,则默认是news分享类型。 87 | if (msg.link&&!msg.multimediaType) { 88 | msg.multimediaType=OSMultimediaTypeNews; 89 | } 90 | if ([msg isEmpty:@[@"image",@"link" ] AndNotEmpty:@[@"title"]]) { 91 | //纯文本分享。 92 | [ret appendString:@"text&file_data="]; 93 | [ret appendString:[self base64AndUrlEncode:msg.title]]; 94 | }else if([msg isEmpty:@[@"link"] AndNotEmpty:@[@"title",@"image",@"desc"]]){ 95 | //图片分享 96 | NSDictionary *data=@{@"file_data":msg.image, 97 | @"previewimagedata":msg.thumbnail?:msg.image 98 | }; 99 | [self setGeneralPasteboard:@"com.tencent.mqq.api.apiLargeData" Value:data encoding: OSPboardEncodingKeyedArchiver]; 100 | [ret appendString:@"img&title="]; 101 | [ret appendString:[self base64Encode:msg.title]]; 102 | [ret appendString:@"&objectlocation=pasteboard&description="]; 103 | [ret appendString:[self base64Encode:msg.desc]]; 104 | }else if ([msg isEmpty:nil AndNotEmpty:@[@"title",@"desc",@"image",@"link",@"multimediaType"]]) { 105 | //新闻/多媒体分享(图片加链接)发送新闻消息 预览图像数据,最大1M字节 URL地址,必填,最长512个字符 via QQApiInterfaceObject.h 106 | NSDictionary *data=@{@"previewimagedata":msg.image}; 107 | [self setGeneralPasteboard:@"com.tencent.mqq.api.apiLargeData" Value:data encoding: OSPboardEncodingKeyedArchiver]; 108 | NSString *msgType=@"news"; 109 | if (msg.multimediaType==OSMultimediaTypeAudio) { 110 | msgType=@"audio"; 111 | }else if(msg.multimediaType==OSMultimediaTypeVideo){ 112 | //QQ没有video类型。客户端会自动判断。 113 | // msgType=@"video"; 114 | } 115 | [ret appendFormat:@"%@&title=%@&url=%@&description=%@&objectlocation=pasteboard",msgType,[self base64AndUrlEncode:msg.title],[self base64AndUrlEncode:msg.link],[self base64AndUrlEncode:msg.desc]]; 116 | } 117 | return ret; 118 | } 119 | +(BOOL)QQ_handleOpenURL{ 120 | NSURL* url=[self returnedURL]; 121 | if ([url.scheme hasPrefix:@"QQ"]) { 122 | //分享 123 | NSDictionary *dic=[self parseUrl:url]; 124 | if (dic[@"error_description"]) { 125 | [dic setValue:[self base64Decode:dic[@"error_description"]] forKey:@"error_description"]; 126 | } 127 | if ([dic[@"error"] intValue]!=0) { 128 | NSError *err=[NSError errorWithDomain:@"response_from_qq" code:[dic[@"error"] intValue] userInfo:dic]; 129 | if ([self shareFailCallback]) { 130 | [self shareFailCallback]([self message],err); 131 | } 132 | }else{ 133 | if ([self shareSuccessCallback]) { 134 | [self shareSuccessCallback]([self message]); 135 | } 136 | } 137 | return YES; 138 | }else if([url.scheme hasPrefix:@"tencent"]){ 139 | //登陆auth 140 | NSDictionary *ret=[self generalPasteboardData:[@"com.tencent.tencent" stringByAppendingString:[self keyFor:schema][@"appid"]] encoding:OSPboardEncodingKeyedArchiver]; 141 | if (ret[@"ret"]&&[ret[@"ret"] intValue]==0) { 142 | if ( [self authSuccessCallback]) { 143 | [self authSuccessCallback](ret); 144 | } 145 | }else{ 146 | NSError *err=[NSError errorWithDomain:@"auth_from_QQ" code:-1 userInfo:ret]; 147 | if ([self authFailCallback]) { 148 | [self authFailCallback](ret,err); 149 | } 150 | } 151 | return YES; 152 | } 153 | else{ 154 | return NO; 155 | } 156 | } 157 | +(void)chatWithQQNumber:(NSString*)qqNumber{ 158 | [self openURL:[NSString stringWithFormat:@"mqqwpa://im/chat?uin=%@&thirdAppDisplayName=%@&callback_name=%@&src_type=app&version=1&chat_type=wpa&callback_type=scheme",qqNumber,[self base64Encode:[self CFBundleDisplayName]],[self keyFor:schema][@"callback_name"]]]; 159 | } 160 | +(void)chatInQQGroup:(NSString*)groupNumber{ 161 | [self openURL:[NSString stringWithFormat:@"mqqwpa://im/chat?uin=%@&thirdAppDisplayName=%@&callback_name=%@&src_type=app&version=1&chat_type=group&callback_type=scheme",groupNumber,[self base64Encode:[self CFBundleDisplayName]],[self keyFor:schema][@"callback_name"]]]; 162 | } 163 | @end 164 | -------------------------------------------------------------------------------- /TWSNS/TWShareView.m: -------------------------------------------------------------------------------- 1 | // 2 | // XTShareView.m 3 | // XTSNS 4 | // 5 | // Created by 何振东 on 15/9/9. 6 | // Copyright © 2015年 LZA. All rights reserved. 7 | // 8 | 9 | #import "TWShareView.h" 10 | #import "TWSNSDefine.h" 11 | #import "TWShare.h" 12 | 13 | 14 | static NSUInteger const kRankNum = 5; 15 | 16 | #define m6Scale self.bounds.size.width/750.0 17 | #define kSpace 43 * m6Scale 18 | #define kWidth ((self.bounds.size.width - kSpace * (kRankNum + 1))/kRankNum) 19 | 20 | 21 | @interface TWShareView () 22 | @property (strong, nonatomic) UIView *contentView; 23 | @property (strong, nonatomic) UILabel *titleLbl; 24 | @property (strong, nonatomic) UIButton *cancelBtn; 25 | 26 | @property (strong, nonatomic) UIView *upLine; 27 | @property (strong, nonatomic) UIView *downLine; 28 | 29 | @property (strong, nonatomic) OSMessage *message; 30 | 31 | @property (nonatomic, copy) void (^shareCompletionHandler) (OSMessage *message, NSError *error); 32 | 33 | @property (nonatomic, strong) NSMutableArray *typeMArr; 34 | 35 | @end 36 | 37 | @implementation TWShareView 38 | 39 | 40 | + (instancetype)shareView 41 | { 42 | return [[TWShareView alloc] initWithFrame:[UIApplication sharedApplication].keyWindow.bounds]; 43 | } 44 | 45 | - (instancetype)initWithFrame:(CGRect)frame 46 | { 47 | self = [super initWithFrame:frame]; 48 | if (self) { 49 | self.backgroundColor = [[UIColor darkTextColor] colorWithAlphaComponent:0.2]; 50 | [self addTarget:self action:@selector(hideSelf:) forControlEvents:UIControlEventTouchUpInside]; 51 | 52 | [self addSubview:self.contentView]; 53 | [self.contentView addSubview:self.titleLbl]; 54 | [self.contentView addSubview:self.cancelBtn]; 55 | [self.contentView addSubview:self.upLine]; 56 | [self.contentView addSubview:self.downLine]; 57 | 58 | NSMutableArray *images = [NSMutableArray array]; 59 | self.typeMArr = [NSMutableArray array]; 60 | if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"wechat://"]]) { 61 | [images addObject:[UIImage imageNamed:@"share-weixin"]]; 62 | [self.typeMArr addObject:@"1"]; 63 | } 64 | if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"weixin://"]]) { 65 | [images addObject:[UIImage imageNamed:@"share-weixin-frends"]]; 66 | [self.typeMArr addObject:@"2"]; 67 | } 68 | if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"mqq://"]]) { 69 | [images addObject:[UIImage imageNamed:@"share-qq"]]; 70 | [images addObject:[UIImage imageNamed:@"share-qqzone"]]; 71 | [self.typeMArr addObject:@"3"]; 72 | [self.typeMArr addObject:@"4"]; 73 | } 74 | if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"sinaweibo://"]]) { 75 | [images addObject:[UIImage imageNamed:@"share-weibo"]]; 76 | [self.typeMArr addObject:@"5"]; 77 | } 78 | 79 | 80 | CGFloat thirdButtonLength = 50; 81 | CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width; 82 | CGFloat buttonInterval = (screenWidth-images.count * thirdButtonLength) /(images.count + 1); 83 | 84 | for (int i = 0; i < images.count; i++) { 85 | NSInteger row = floor(i / kRankNum); 86 | 87 | CGRect rect1 = CGRectMake(buttonInterval * (i + 1) + thirdButtonLength*i, self.upLine.frame.origin.y + kSpace + (kWidth + kSpace) * row, thirdButtonLength, thirdButtonLength); 88 | 89 | UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; 90 | [btn setImage:images[i] forState:UIControlStateNormal]; 91 | btn.frame = rect1; 92 | btn.tag = 1 + i; 93 | [btn addTarget:self action:@selector(shareButtonClickEvent:) forControlEvents:UIControlEventTouchUpInside]; 94 | [self.contentView addSubview:btn]; 95 | } 96 | 97 | if (images.count == 0) { 98 | UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(0, self.upLine.frame.origin.y, self.bounds.size.width, self.downLine.frame.origin.y - self.upLine.frame.origin.y)]; 99 | lbl.text = @"您暂时没有可分享的平台!"; 100 | lbl.textAlignment = NSTextAlignmentCenter; 101 | lbl.textColor = [UIColor whiteColor]; 102 | [self.contentView addSubview:lbl]; 103 | } 104 | } 105 | return self; 106 | } 107 | 108 | - (void)layoutSubviews 109 | { 110 | [super layoutSubviews]; 111 | 112 | } 113 | 114 | - (void)shareButtonClickEvent:(UIButton *)sender 115 | { 116 | TWSNSShareType shareType = [self.typeMArr[sender.tag - 1] integerValue]; 117 | 118 | [TWShare shareMessage:self.message withShareType:shareType completionHandler:self.shareCompletionHandler]; 119 | 120 | [self hideSelf:self]; 121 | } 122 | 123 | - (void)showShareViewWithMessage:(OSMessage *)message completionHandler:(void (^)(OSMessage *message, NSError *error))completionHandler 124 | { 125 | self.message = message; 126 | self.shareCompletionHandler = completionHandler; 127 | 128 | __weak TWShareView *weakSelf = self; 129 | 130 | UIView *window = [[UIApplication sharedApplication].keyWindow.subviews lastObject]; 131 | self.contentView.frame = CGRectMake(0, self.bounds.size.height, self.bounds.size.width, 120); 132 | [window addSubview:self]; 133 | 134 | [UIView animateWithDuration:0.75 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:0.3 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 135 | CGFloat bottom = weakSelf.cancelBtn.frame.size.height + weakSelf.cancelBtn.frame.origin.y; 136 | weakSelf.contentView.frame = CGRectMake(0, weakSelf.bounds.size.height - bottom, weakSelf.bounds.size.width, 400); 137 | } completion:nil]; 138 | } 139 | 140 | - (void)hideSelf:(id)sender 141 | { 142 | __weak TWShareView *weakSelf = self; 143 | [UIView animateWithDuration:0.75 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:0.7 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 144 | weakSelf.contentView.center = CGPointMake(weakSelf.contentView.center.x, weakSelf.bounds.size.height + weakSelf.contentView.bounds.size.height); 145 | weakSelf.alpha = 0; 146 | } completion:^(BOOL finished) { 147 | [weakSelf removeFromSuperview]; 148 | }]; 149 | } 150 | 151 | 152 | #pragma getters && setters 153 | 154 | - (UIView *)contentView 155 | { 156 | if (!_contentView) { 157 | NSInteger version = [[[UIDevice currentDevice] systemVersion] integerValue]; 158 | if (version >= 8) { 159 | _contentView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]]; 160 | } else { 161 | _contentView = [[UIToolbar alloc] init]; 162 | } 163 | _contentView.frame = CGRectMake(0, self.bounds.size.height, self.bounds.size.width, 400); 164 | } 165 | return _contentView; 166 | } 167 | 168 | - (UILabel *)titleLbl 169 | { 170 | if (!_titleLbl) { 171 | CGRect frame = CGRectMake(0, 0, self.contentView.frame.size.width, 62 * m6Scale); 172 | _titleLbl = [[UILabel alloc] initWithFrame:frame]; 173 | _titleLbl.textAlignment = NSTextAlignmentCenter; 174 | _titleLbl.textColor = [UIColor whiteColor]; 175 | _titleLbl.font = [UIFont boldSystemFontOfSize:16]; 176 | _titleLbl.text = @"分享至"; 177 | } 178 | return _titleLbl; 179 | } 180 | 181 | - (UIView *)upLine 182 | { 183 | if (!_upLine) { 184 | CGRect frame = CGRectMake(30 * m6Scale, self.titleLbl.frame.size.height + 20 * m6Scale, self.contentView.frame.size.width - 30 * m6Scale * 2, 0.5); 185 | _upLine = [[UIView alloc] initWithFrame:frame]; 186 | _upLine.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.5]; 187 | _upLine.alpha = 0.5; 188 | } 189 | return _upLine; 190 | } 191 | 192 | - (UIView *)downLine 193 | { 194 | if (!_downLine) { 195 | CGFloat y = self.upLine.frame.origin.y + kSpace * 2 + kWidth; 196 | CGRect frame = CGRectMake(self.upLine.frame.origin.x, y, self.upLine.frame.size.width, 0.5); 197 | _downLine = [[UIView alloc] initWithFrame:frame]; 198 | _downLine.backgroundColor = _upLine.backgroundColor; 199 | _downLine.alpha = _upLine.alpha; 200 | } 201 | return _downLine; 202 | } 203 | 204 | - (UIButton *)cancelBtn 205 | { 206 | if (!_cancelBtn) { 207 | _cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 208 | [_cancelBtn setTitle:@"取消" forState:UIControlStateNormal]; 209 | [_cancelBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 210 | _cancelBtn.titleLabel.font = [UIFont systemFontOfSize:15]; 211 | _cancelBtn.frame = CGRectMake(0, self.downLine.frame.origin.y, self.contentView.frame.size.width, 100 * m6Scale); 212 | [_cancelBtn addTarget:self action:@selector(hideSelf:) forControlEvents:UIControlEventTouchUpInside]; 213 | } 214 | return _cancelBtn; 215 | } 216 | 217 | @end 218 | -------------------------------------------------------------------------------- /Pods/OpenShare/openshare/OpenShare.m: -------------------------------------------------------------------------------- 1 | // 2 | // OpenShare.m 3 | // openshare 4 | // 5 | // Created by LiuLogan on 15/5/13. 6 | // Copyright (c) 2015年 OpenShare. All rights reserved. 7 | // 8 | 9 | #import "OpenShare.h" 10 | 11 | @implementation OpenShare 12 | /** 13 | * 用于保存各个平台的key。每个平台需要的key/appid不一样,所以用dictionary保存。 14 | */ 15 | static NSMutableDictionary *keys; 16 | 17 | +(void)set:(NSString*)platform Keys:(NSDictionary *)key{ 18 | if (!keys) { 19 | keys=[[NSMutableDictionary alloc] init]; 20 | } 21 | keys[platform]=key; 22 | } 23 | +(NSDictionary *)keyFor:(NSString*)platform{ 24 | return [keys valueForKey:platform]?keys[platform]:nil; 25 | } 26 | 27 | +(void)openURL:(NSString*)url{ 28 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; 29 | } 30 | +(BOOL)canOpen:(NSString*)url{ 31 | return [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:url]]; 32 | } 33 | +(BOOL)handleOpenURL:(NSURL*)openUrl{ 34 | returnedURL=openUrl; 35 | for (NSString *key in keys) { 36 | SEL sel=NSSelectorFromString([key stringByAppendingString:@"_handleOpenURL"]); 37 | if ([self respondsToSelector:sel]) { 38 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature: 39 | [self methodSignatureForSelector:sel]]; 40 | [invocation setSelector:sel]; 41 | [invocation setTarget:self]; 42 | [invocation invoke]; 43 | BOOL returnValue; 44 | [invocation getReturnValue:&returnValue]; 45 | if (returnValue) {//如果这个url能处理,就返回YES,否则,交给下一个处理。 46 | return YES; 47 | } 48 | }else{ 49 | NSLog(@"fatal error: %@ is should have a method: %@",key,[key stringByAppendingString:@"_handleOpenURL"]); 50 | } 51 | } 52 | return NO; 53 | } 54 | 55 | #pragma mark 分享/auth以后,应用被调起,回调。 56 | static NSURL* returnedURL; 57 | static NSDictionary *returnedData; 58 | static shareSuccess shareSuccessCallback; 59 | static shareFail shareFailCallback; 60 | 61 | static authSuccess authSuccessCallback; 62 | static authFail authFailCallback; 63 | 64 | static paySuccess paySuccessCallback; 65 | static payFail payFailCallback; 66 | 67 | static OSMessage *message; 68 | +(shareSuccess)shareSuccessCallback{ 69 | return shareSuccessCallback; 70 | } 71 | +(shareFail)shareFailCallback{ 72 | return shareFailCallback; 73 | } 74 | +(void)setShareSuccessCallback:(shareSuccess)suc{ 75 | shareSuccessCallback=suc; 76 | } 77 | +(void)setShareFailCallback:(shareFail)fail{ 78 | shareFailCallback=fail; 79 | } 80 | +(void)setPaySuccessCallback:(paySuccess)suc{ 81 | paySuccessCallback=suc; 82 | } 83 | +(void)setPayFailCallback:(payFail)fail{ 84 | payFailCallback=fail; 85 | } 86 | +(paySuccess)paySuccessCallback{ 87 | return paySuccessCallback; 88 | } 89 | +(payFail)payFailCallback{ 90 | return payFailCallback; 91 | } 92 | +(NSURL*)returnedURL{ 93 | return returnedURL; 94 | } 95 | +(NSDictionary*)returnedData{ 96 | return returnedData; 97 | } 98 | +(void)setReturnedData:(NSDictionary*)retData{ 99 | returnedData=retData; 100 | } 101 | +(void)setMessage:(OSMessage*)msg{ 102 | message=msg; 103 | } 104 | +(OSMessage*)message{ 105 | return message?:[[OSMessage alloc] init]; 106 | } 107 | +(authSuccess)authSuccessCallback{ 108 | return authSuccessCallback; 109 | } 110 | +(authFail)authFailCallback{ 111 | return authFailCallback; 112 | } 113 | +(BOOL)beginShare:(NSString*)platform Message:(OSMessage*)msg Success:(shareSuccess)success Fail:(shareFail)fail{ 114 | if ([self keyFor:platform]) { 115 | message=msg; 116 | shareSuccessCallback=success; 117 | shareFailCallback=fail; 118 | return YES; 119 | }else{ 120 | NSLog(@"place connect%@ before you can share to it!!!",platform); 121 | return NO; 122 | } 123 | } 124 | +(BOOL)beginAuth:(NSString*)platform Success:(authSuccess)success Fail:(authFail)fail{ 125 | if ([self keyFor:platform]) { 126 | authSuccessCallback=success; 127 | authFailCallback=fail; 128 | return YES; 129 | }else{ 130 | NSLog(@"place connect%@ before you can share to it!!!",platform); 131 | return NO; 132 | } 133 | } 134 | 135 | #pragma mark 公共实用方法 136 | +(NSMutableDictionary *)parseUrl:(NSURL*)url{ 137 | NSMutableDictionary *queryStringDictionary = [[NSMutableDictionary alloc] init]; 138 | NSArray *urlComponents = [[url query] componentsSeparatedByString:@"&"]; 139 | 140 | for (NSString *keyValuePair in urlComponents) 141 | { 142 | NSRange range=[keyValuePair rangeOfString:@"="]; 143 | [queryStringDictionary setObject:range.length>0?[keyValuePair substringFromIndex:range.location+1]:@"" forKey:(range.length?[keyValuePair substringToIndex:range.location]:keyValuePair)]; 144 | } 145 | return queryStringDictionary; 146 | } 147 | +(NSString*)base64Encode:(NSString *)input{ 148 | return [[input dataUsingEncoding:NSUTF8StringEncoding] base64EncodedStringWithOptions:0]; 149 | } 150 | +(NSString*)base64Decode:(NSString *)input{ 151 | return [[NSString alloc ] initWithData:[[NSData alloc] initWithBase64EncodedString:input options:0] encoding:NSUTF8StringEncoding]; 152 | } 153 | +(NSString*)CFBundleDisplayName{ 154 | return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"]; 155 | } 156 | +(NSString*)CFBundleIdentifier{ 157 | return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"]; 158 | } 159 | +(void)setGeneralPasteboard:(NSString*)key Value:(NSDictionary*)value encoding:(OSPboardEncoding)encoding{ 160 | if (value&&key) { 161 | NSData *data=nil; 162 | NSError *err; 163 | switch (encoding) { 164 | case OSPboardEncodingKeyedArchiver: 165 | data=[NSKeyedArchiver archivedDataWithRootObject:value]; 166 | break; 167 | case OSPboardEncodingPropertyListSerialization: 168 | data=[NSPropertyListSerialization dataWithPropertyList:value format:NSPropertyListBinaryFormat_v1_0 options:0 error:&err]; 169 | default: 170 | NSLog(@"encoding not implemented"); 171 | break; 172 | } 173 | if (err) { 174 | NSLog(@"error when NSPropertyListSerialization: %@",err); 175 | }else if (data){ 176 | [[UIPasteboard generalPasteboard] setData:data forPasteboardType:key]; 177 | } 178 | } 179 | } 180 | +(NSDictionary*)generalPasteboardData:(NSString*)key encoding:(OSPboardEncoding)encoding{ 181 | NSData *data=[[UIPasteboard generalPasteboard] dataForPasteboardType:key]; 182 | NSDictionary *dic=nil; 183 | if (data) { 184 | NSError *err; 185 | switch (encoding) { 186 | case OSPboardEncodingKeyedArchiver: 187 | dic= [NSKeyedUnarchiver unarchiveObjectWithData:data]; 188 | break; 189 | case OSPboardEncodingPropertyListSerialization: 190 | dic=[NSPropertyListSerialization propertyListWithData:data options:0 format:0 error:&err]; 191 | default: 192 | break; 193 | } 194 | if (err) { 195 | NSLog(@"error when NSPropertyListSerialization: %@",err); 196 | } 197 | } 198 | return dic; 199 | } 200 | +(NSString*)base64AndUrlEncode:(NSString *)string{ 201 | return [[self base64Encode:string] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]]; 202 | } 203 | +(NSString*)urlDecode:(NSString*)input{ 204 | return [[input stringByReplacingOccurrencesOfString:@"+" withString:@" "]stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 205 | } 206 | /** 207 | * 截屏功能。via:http://stackoverflow.com/a/8017292/3825920 208 | * 209 | * @return 对当前窗口截屏。(支付宝可能需要) 210 | */ 211 | + (UIImage *)screenshot 212 | { 213 | CGSize imageSize = CGSizeZero; 214 | 215 | UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; 216 | if (UIInterfaceOrientationIsPortrait(orientation)) { 217 | imageSize = [UIScreen mainScreen].bounds.size; 218 | } else { 219 | imageSize = CGSizeMake([UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width); 220 | } 221 | 222 | UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0); 223 | CGContextRef context = UIGraphicsGetCurrentContext(); 224 | for (UIWindow *window in [[UIApplication sharedApplication] windows]) { 225 | CGContextSaveGState(context); 226 | CGContextTranslateCTM(context, window.center.x, window.center.y); 227 | CGContextConcatCTM(context, window.transform); 228 | CGContextTranslateCTM(context, -window.bounds.size.width * window.layer.anchorPoint.x, -window.bounds.size.height * window.layer.anchorPoint.y); 229 | if (orientation == UIInterfaceOrientationLandscapeLeft) { 230 | CGContextRotateCTM(context, M_PI_2); 231 | CGContextTranslateCTM(context, 0, -imageSize.width); 232 | } else if (orientation == UIInterfaceOrientationLandscapeRight) { 233 | CGContextRotateCTM(context, -M_PI_2); 234 | CGContextTranslateCTM(context, -imageSize.height, 0); 235 | } else if (orientation == UIInterfaceOrientationPortraitUpsideDown) { 236 | CGContextRotateCTM(context, M_PI); 237 | CGContextTranslateCTM(context, -imageSize.width, -imageSize.height); 238 | } 239 | if ([window respondsToSelector:@selector(drawViewHierarchyInRect:afterScreenUpdates:)]) { 240 | [window drawViewHierarchyInRect:window.bounds afterScreenUpdates:YES]; 241 | } else { 242 | [window.layer renderInContext:context]; 243 | } 244 | CGContextRestoreGState(context); 245 | } 246 | 247 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 248 | UIGraphicsEndImageContext(); 249 | return image; 250 | } 251 | @end 252 | 253 | @implementation OSMessage 254 | -(BOOL)isEmpty:(NSArray*)emptyValueForKeys AndNotEmpty:(NSArray*)notEmptyValueForKeys{ 255 | @try { 256 | if (emptyValueForKeys) { 257 | for (NSString *key in emptyValueForKeys) { 258 | if ([self valueForKeyPath:key]) { 259 | return NO; 260 | } 261 | } 262 | } 263 | if (notEmptyValueForKeys) { 264 | for (NSString *key in notEmptyValueForKeys) { 265 | if (![self valueForKey:key]) { 266 | return NO; 267 | } 268 | } 269 | } 270 | return YES; 271 | } 272 | @catch (NSException *exception) { 273 | NSLog(@"isEmpty error:\n %@",exception); 274 | return NO; 275 | } 276 | } 277 | 278 | @end -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 222965E08E40399779DD6CEDBF76F04D /* OpenShare+Renren.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBD296BDD67E450CC27AA5A22579AA9 /* OpenShare+Renren.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; 11 | 40999A195F535D19A77BB7A2DF411D19 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC8C52A8C25BAC9C295A7AE673FD1A39 /* Foundation.framework */; }; 12 | 5E9AB10FEB6E90D0C84D82CE8AC6245B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC8C52A8C25BAC9C295A7AE673FD1A39 /* Foundation.framework */; }; 13 | 5FE50B4BA5F02287B6FAF6097CF9C703 /* OpenShare+Alipay.h in Headers */ = {isa = PBXBuildFile; fileRef = 16D3BDD34998D3165CD5E0582BBCE006 /* OpenShare+Alipay.h */; settings = {ATTRIBUTES = (Public, ); }; }; 14 | 6BF23BF2E37CBEE23667AAAF4E54DB8F /* OpenShare+Weibo.h in Headers */ = {isa = PBXBuildFile; fileRef = CA33600CA790F7A8786B2E349BF19FCB /* OpenShare+Weibo.h */; settings = {ATTRIBUTES = (Public, ); }; }; 15 | 73511BE0AD707C51B276FA0B7A6E47D3 /* OpenShare+Alipay.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DA1AEE2538EE53072B2B6164DFB16EB /* OpenShare+Alipay.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; 16 | 9598916BF82CB0AF0758CC180CAAF36C /* OpenShare+Weixin.m in Sources */ = {isa = PBXBuildFile; fileRef = 57AB1481FAFEFC76B34F8A50715D72EE /* OpenShare+Weixin.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; 17 | A140AD599F7FF512CD3D8DA0D95D4748 /* Pods-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B4C873C44B027A691ECE6F30EB75286 /* Pods-dummy.m */; }; 18 | ADAA429705224B4F42D06499669BDAC5 /* OpenShare.h in Headers */ = {isa = PBXBuildFile; fileRef = A2C73EDBDB7221C4C04B083121BE0EF3 /* OpenShare.h */; settings = {ATTRIBUTES = (Public, ); }; }; 19 | C73CC8640DFB50F08E92C8AC3A571396 /* OpenShare.m in Sources */ = {isa = PBXBuildFile; fileRef = 553ACF0D9719E6705B0A09243F4FD42B /* OpenShare.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; 20 | CB0D9A395FBC242EE687E9FDB7DE0E57 /* OpenShare+Weibo.m in Sources */ = {isa = PBXBuildFile; fileRef = F2616890F78882E0293E8F6356EC738D /* OpenShare+Weibo.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; 21 | D64C40C4B29699ADD2653C43955A2B33 /* OpenShare+Renren.h in Headers */ = {isa = PBXBuildFile; fileRef = 828F1E48EB1253917282BBB5FB60678B /* OpenShare+Renren.h */; settings = {ATTRIBUTES = (Public, ); }; }; 22 | D70CD338D403130D1CAF1BADD7756C6A /* OpenShare+QQ.h in Headers */ = {isa = PBXBuildFile; fileRef = CFD9A336ADBD5CEB397F60B3B268F282 /* OpenShare+QQ.h */; settings = {ATTRIBUTES = (Public, ); }; }; 23 | DC7836037716A262992F407AFFA5969C /* OpenShare+Weixin.h in Headers */ = {isa = PBXBuildFile; fileRef = AA9573380D9661710154EFB2E93C5542 /* OpenShare+Weixin.h */; settings = {ATTRIBUTES = (Public, ); }; }; 24 | F43638DB4F473969552357B99B52B64D /* OpenShare+QQ.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0297995DA054BC1BE7B1969F06D2A4 /* OpenShare+QQ.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; 25 | FD5BF3CC56D4FE8884432C0C225E5D1F /* OpenShareHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 48B57ED18D8ECD13E9EEBB7816F774B7 /* OpenShareHeader.h */; settings = {ATTRIBUTES = (Public, ); }; }; 26 | FE23C180A41AB697A4DD9BA66B3F61BE /* OpenShare-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = AAFA1D5323FE6A3966C8FD2836510DB9 /* OpenShare-dummy.m */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 9C5CED174783A8FF410DC7AC3A9478B3 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 6EB7BBA4823EE93AED27E42911F8803E; 35 | remoteInfo = OpenShare; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 0D9152CB88730DCE6CB8227C5E81FA9F /* libOpenShare.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libOpenShare.a; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 10834806BD7B412BC24F347361FA2C8E /* Pods-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-acknowledgements.plist"; sourceTree = ""; }; 42 | 16D3BDD34998D3165CD5E0582BBCE006 /* OpenShare+Alipay.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "OpenShare+Alipay.h"; path = "openshare/OpenShare+Alipay.h"; sourceTree = ""; }; 43 | 1B4C873C44B027A691ECE6F30EB75286 /* Pods-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-dummy.m"; sourceTree = ""; }; 44 | 3040CE5AC6F2006608942AB78E290618 /* OpenShare-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "OpenShare-prefix.pch"; sourceTree = ""; }; 45 | 37DB56D75062CC75FCB0966E1C6E8A8E /* Pods-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-acknowledgements.markdown"; sourceTree = ""; }; 46 | 3C197B233086E970123A44F814F83B9A /* OpenShare.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = OpenShare.xcconfig; sourceTree = ""; }; 47 | 48B57ED18D8ECD13E9EEBB7816F774B7 /* OpenShareHeader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = OpenShareHeader.h; path = openshare/OpenShareHeader.h; sourceTree = ""; }; 48 | 48D976FF388C44DF4EE1C55910CDE505 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.release.xcconfig; sourceTree = ""; }; 49 | 553ACF0D9719E6705B0A09243F4FD42B /* OpenShare.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = OpenShare.m; path = openshare/OpenShare.m; sourceTree = ""; }; 50 | 55A578B3308E1E609B3F88799AC5F7A2 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.debug.xcconfig; sourceTree = ""; }; 51 | 57AB1481FAFEFC76B34F8A50715D72EE /* OpenShare+Weixin.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "OpenShare+Weixin.m"; path = "openshare/OpenShare+Weixin.m"; sourceTree = ""; }; 52 | 60C6B8927B5CB77BD80FD6B949345370 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 6911BECA35E7518D864239B7E898EEF3 /* Pods-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-frameworks.sh"; sourceTree = ""; }; 54 | 7DA1AEE2538EE53072B2B6164DFB16EB /* OpenShare+Alipay.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "OpenShare+Alipay.m"; path = "openshare/OpenShare+Alipay.m"; sourceTree = ""; }; 55 | 828F1E48EB1253917282BBB5FB60678B /* OpenShare+Renren.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "OpenShare+Renren.h"; path = "openshare/OpenShare+Renren.h"; sourceTree = ""; }; 56 | A1A36D34413696BE466E2CA0AFF194DA /* Pods-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-resources.sh"; sourceTree = ""; }; 57 | A2C73EDBDB7221C4C04B083121BE0EF3 /* OpenShare.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = OpenShare.h; path = openshare/OpenShare.h; sourceTree = ""; }; 58 | AA9573380D9661710154EFB2E93C5542 /* OpenShare+Weixin.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "OpenShare+Weixin.h"; path = "openshare/OpenShare+Weixin.h"; sourceTree = ""; }; 59 | AAFA1D5323FE6A3966C8FD2836510DB9 /* OpenShare-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "OpenShare-dummy.m"; sourceTree = ""; }; 60 | AFBD296BDD67E450CC27AA5A22579AA9 /* OpenShare+Renren.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "OpenShare+Renren.m"; path = "openshare/OpenShare+Renren.m"; sourceTree = ""; }; 61 | BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 62 | BC0297995DA054BC1BE7B1969F06D2A4 /* OpenShare+QQ.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "OpenShare+QQ.m"; path = "openshare/OpenShare+QQ.m"; sourceTree = ""; }; 63 | CA33600CA790F7A8786B2E349BF19FCB /* OpenShare+Weibo.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "OpenShare+Weibo.h"; path = "openshare/OpenShare+Weibo.h"; sourceTree = ""; }; 64 | CFD9A336ADBD5CEB397F60B3B268F282 /* OpenShare+QQ.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "OpenShare+QQ.h"; path = "openshare/OpenShare+QQ.h"; sourceTree = ""; }; 65 | F2616890F78882E0293E8F6356EC738D /* OpenShare+Weibo.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "OpenShare+Weibo.m"; path = "openshare/OpenShare+Weibo.m"; sourceTree = ""; }; 66 | FC8C52A8C25BAC9C295A7AE673FD1A39 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 67 | /* End PBXFileReference section */ 68 | 69 | /* Begin PBXFrameworksBuildPhase section */ 70 | B95A30BA22993AA68F9D9A741B9926A5 /* Frameworks */ = { 71 | isa = PBXFrameworksBuildPhase; 72 | buildActionMask = 2147483647; 73 | files = ( 74 | 5E9AB10FEB6E90D0C84D82CE8AC6245B /* Foundation.framework in Frameworks */, 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | C8BD330E0266046D0D5EC07DA28916C6 /* Frameworks */ = { 79 | isa = PBXFrameworksBuildPhase; 80 | buildActionMask = 2147483647; 81 | files = ( 82 | 40999A195F535D19A77BB7A2DF411D19 /* Foundation.framework in Frameworks */, 83 | ); 84 | runOnlyForDeploymentPostprocessing = 0; 85 | }; 86 | /* End PBXFrameworksBuildPhase section */ 87 | 88 | /* Begin PBXGroup section */ 89 | 037C0CA694176A3C0915F62C9D20B3E6 /* Targets Support Files */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | B3D1D13E0C6553800746CB8FD61CF946 /* Pods */, 93 | ); 94 | name = "Targets Support Files"; 95 | sourceTree = ""; 96 | }; 97 | 2C795B8F29F0523E99FBC872C2BD34E0 /* Pods */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | E60593C933ADBC8B3043809578589CEE /* OpenShare */, 101 | ); 102 | name = Pods; 103 | sourceTree = ""; 104 | }; 105 | 53F661C0CA7190D2CF05023FB33D61E4 /* iOS */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | FC8C52A8C25BAC9C295A7AE673FD1A39 /* Foundation.framework */, 109 | ); 110 | name = iOS; 111 | sourceTree = ""; 112 | }; 113 | 7DB346D0F39D3F0E887471402A8071AB = { 114 | isa = PBXGroup; 115 | children = ( 116 | BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */, 117 | BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */, 118 | 2C795B8F29F0523E99FBC872C2BD34E0 /* Pods */, 119 | 8F667B510A8456EFBC6D435BEB1E445E /* Products */, 120 | 037C0CA694176A3C0915F62C9D20B3E6 /* Targets Support Files */, 121 | ); 122 | sourceTree = ""; 123 | }; 124 | 8F667B510A8456EFBC6D435BEB1E445E /* Products */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 0D9152CB88730DCE6CB8227C5E81FA9F /* libOpenShare.a */, 128 | 60C6B8927B5CB77BD80FD6B949345370 /* libPods.a */, 129 | ); 130 | name = Products; 131 | sourceTree = ""; 132 | }; 133 | B3D1D13E0C6553800746CB8FD61CF946 /* Pods */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 37DB56D75062CC75FCB0966E1C6E8A8E /* Pods-acknowledgements.markdown */, 137 | 10834806BD7B412BC24F347361FA2C8E /* Pods-acknowledgements.plist */, 138 | 1B4C873C44B027A691ECE6F30EB75286 /* Pods-dummy.m */, 139 | 6911BECA35E7518D864239B7E898EEF3 /* Pods-frameworks.sh */, 140 | A1A36D34413696BE466E2CA0AFF194DA /* Pods-resources.sh */, 141 | 55A578B3308E1E609B3F88799AC5F7A2 /* Pods.debug.xcconfig */, 142 | 48D976FF388C44DF4EE1C55910CDE505 /* Pods.release.xcconfig */, 143 | ); 144 | name = Pods; 145 | path = "Target Support Files/Pods"; 146 | sourceTree = ""; 147 | }; 148 | BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | 53F661C0CA7190D2CF05023FB33D61E4 /* iOS */, 152 | ); 153 | name = Frameworks; 154 | sourceTree = ""; 155 | }; 156 | E262B1B575C4213E550242D852F57C71 /* Support Files */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | 3C197B233086E970123A44F814F83B9A /* OpenShare.xcconfig */, 160 | AAFA1D5323FE6A3966C8FD2836510DB9 /* OpenShare-dummy.m */, 161 | 3040CE5AC6F2006608942AB78E290618 /* OpenShare-prefix.pch */, 162 | ); 163 | name = "Support Files"; 164 | path = "../Target Support Files/OpenShare"; 165 | sourceTree = ""; 166 | }; 167 | E60593C933ADBC8B3043809578589CEE /* OpenShare */ = { 168 | isa = PBXGroup; 169 | children = ( 170 | A2C73EDBDB7221C4C04B083121BE0EF3 /* OpenShare.h */, 171 | 553ACF0D9719E6705B0A09243F4FD42B /* OpenShare.m */, 172 | 16D3BDD34998D3165CD5E0582BBCE006 /* OpenShare+Alipay.h */, 173 | 7DA1AEE2538EE53072B2B6164DFB16EB /* OpenShare+Alipay.m */, 174 | CFD9A336ADBD5CEB397F60B3B268F282 /* OpenShare+QQ.h */, 175 | BC0297995DA054BC1BE7B1969F06D2A4 /* OpenShare+QQ.m */, 176 | 828F1E48EB1253917282BBB5FB60678B /* OpenShare+Renren.h */, 177 | AFBD296BDD67E450CC27AA5A22579AA9 /* OpenShare+Renren.m */, 178 | CA33600CA790F7A8786B2E349BF19FCB /* OpenShare+Weibo.h */, 179 | F2616890F78882E0293E8F6356EC738D /* OpenShare+Weibo.m */, 180 | AA9573380D9661710154EFB2E93C5542 /* OpenShare+Weixin.h */, 181 | 57AB1481FAFEFC76B34F8A50715D72EE /* OpenShare+Weixin.m */, 182 | 48B57ED18D8ECD13E9EEBB7816F774B7 /* OpenShareHeader.h */, 183 | E262B1B575C4213E550242D852F57C71 /* Support Files */, 184 | ); 185 | path = OpenShare; 186 | sourceTree = ""; 187 | }; 188 | /* End PBXGroup section */ 189 | 190 | /* Begin PBXHeadersBuildPhase section */ 191 | E13658F57C6A3947E1936ECFDC25A972 /* Headers */ = { 192 | isa = PBXHeadersBuildPhase; 193 | buildActionMask = 2147483647; 194 | files = ( 195 | 5FE50B4BA5F02287B6FAF6097CF9C703 /* OpenShare+Alipay.h in Headers */, 196 | D70CD338D403130D1CAF1BADD7756C6A /* OpenShare+QQ.h in Headers */, 197 | D64C40C4B29699ADD2653C43955A2B33 /* OpenShare+Renren.h in Headers */, 198 | 6BF23BF2E37CBEE23667AAAF4E54DB8F /* OpenShare+Weibo.h in Headers */, 199 | DC7836037716A262992F407AFFA5969C /* OpenShare+Weixin.h in Headers */, 200 | ADAA429705224B4F42D06499669BDAC5 /* OpenShare.h in Headers */, 201 | FD5BF3CC56D4FE8884432C0C225E5D1F /* OpenShareHeader.h in Headers */, 202 | ); 203 | runOnlyForDeploymentPostprocessing = 0; 204 | }; 205 | /* End PBXHeadersBuildPhase section */ 206 | 207 | /* Begin PBXNativeTarget section */ 208 | 6EB7BBA4823EE93AED27E42911F8803E /* OpenShare */ = { 209 | isa = PBXNativeTarget; 210 | buildConfigurationList = 94ECDAFF885AB10E562143BF3B4661C9 /* Build configuration list for PBXNativeTarget "OpenShare" */; 211 | buildPhases = ( 212 | 1B37BB90FEABBCDD29E5532C15DFCBA1 /* Sources */, 213 | C8BD330E0266046D0D5EC07DA28916C6 /* Frameworks */, 214 | E13658F57C6A3947E1936ECFDC25A972 /* Headers */, 215 | ); 216 | buildRules = ( 217 | ); 218 | dependencies = ( 219 | ); 220 | name = OpenShare; 221 | productName = OpenShare; 222 | productReference = 0D9152CB88730DCE6CB8227C5E81FA9F /* libOpenShare.a */; 223 | productType = "com.apple.product-type.library.static"; 224 | }; 225 | FB4FEEBB366D994C57115C550AC4D73E /* Pods */ = { 226 | isa = PBXNativeTarget; 227 | buildConfigurationList = B4A158536705C0DF14A4727DF0F0135D /* Build configuration list for PBXNativeTarget "Pods" */; 228 | buildPhases = ( 229 | 73915F3938494CA94FB6D3A64ED8352D /* Sources */, 230 | B95A30BA22993AA68F9D9A741B9926A5 /* Frameworks */, 231 | ); 232 | buildRules = ( 233 | ); 234 | dependencies = ( 235 | F446E41639A314AA804608D3C6D8F89B /* PBXTargetDependency */, 236 | ); 237 | name = Pods; 238 | productName = Pods; 239 | productReference = 60C6B8927B5CB77BD80FD6B949345370 /* libPods.a */; 240 | productType = "com.apple.product-type.library.static"; 241 | }; 242 | /* End PBXNativeTarget section */ 243 | 244 | /* Begin PBXProject section */ 245 | D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { 246 | isa = PBXProject; 247 | attributes = { 248 | LastSwiftUpdateCheck = 0700; 249 | LastUpgradeCheck = 0700; 250 | }; 251 | buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; 252 | compatibilityVersion = "Xcode 3.2"; 253 | developmentRegion = English; 254 | hasScannedForEncodings = 0; 255 | knownRegions = ( 256 | en, 257 | ); 258 | mainGroup = 7DB346D0F39D3F0E887471402A8071AB; 259 | productRefGroup = 8F667B510A8456EFBC6D435BEB1E445E /* Products */; 260 | projectDirPath = ""; 261 | projectRoot = ""; 262 | targets = ( 263 | 6EB7BBA4823EE93AED27E42911F8803E /* OpenShare */, 264 | FB4FEEBB366D994C57115C550AC4D73E /* Pods */, 265 | ); 266 | }; 267 | /* End PBXProject section */ 268 | 269 | /* Begin PBXSourcesBuildPhase section */ 270 | 1B37BB90FEABBCDD29E5532C15DFCBA1 /* Sources */ = { 271 | isa = PBXSourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | 73511BE0AD707C51B276FA0B7A6E47D3 /* OpenShare+Alipay.m in Sources */, 275 | F43638DB4F473969552357B99B52B64D /* OpenShare+QQ.m in Sources */, 276 | 222965E08E40399779DD6CEDBF76F04D /* OpenShare+Renren.m in Sources */, 277 | CB0D9A395FBC242EE687E9FDB7DE0E57 /* OpenShare+Weibo.m in Sources */, 278 | 9598916BF82CB0AF0758CC180CAAF36C /* OpenShare+Weixin.m in Sources */, 279 | FE23C180A41AB697A4DD9BA66B3F61BE /* OpenShare-dummy.m in Sources */, 280 | C73CC8640DFB50F08E92C8AC3A571396 /* OpenShare.m in Sources */, 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | 73915F3938494CA94FB6D3A64ED8352D /* Sources */ = { 285 | isa = PBXSourcesBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | A140AD599F7FF512CD3D8DA0D95D4748 /* Pods-dummy.m in Sources */, 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | }; 292 | /* End PBXSourcesBuildPhase section */ 293 | 294 | /* Begin PBXTargetDependency section */ 295 | F446E41639A314AA804608D3C6D8F89B /* PBXTargetDependency */ = { 296 | isa = PBXTargetDependency; 297 | name = OpenShare; 298 | target = 6EB7BBA4823EE93AED27E42911F8803E /* OpenShare */; 299 | targetProxy = 9C5CED174783A8FF410DC7AC3A9478B3 /* PBXContainerItemProxy */; 300 | }; 301 | /* End PBXTargetDependency section */ 302 | 303 | /* Begin XCBuildConfiguration section */ 304 | 052A17875CB827423D627183396CEB60 /* Release */ = { 305 | isa = XCBuildConfiguration; 306 | buildSettings = { 307 | ALWAYS_SEARCH_USER_PATHS = NO; 308 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 309 | CLANG_CXX_LIBRARY = "libc++"; 310 | CLANG_ENABLE_MODULES = YES; 311 | CLANG_ENABLE_OBJC_ARC = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_CONSTANT_CONVERSION = YES; 314 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; 315 | CLANG_WARN_EMPTY_BODY = YES; 316 | CLANG_WARN_ENUM_CONVERSION = YES; 317 | CLANG_WARN_INT_CONVERSION = YES; 318 | CLANG_WARN_OBJC_ROOT_CLASS = YES; 319 | CLANG_WARN_UNREACHABLE_CODE = YES; 320 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 321 | COPY_PHASE_STRIP = YES; 322 | ENABLE_NS_ASSERTIONS = NO; 323 | GCC_C_LANGUAGE_STANDARD = gnu99; 324 | GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1"; 325 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 326 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 327 | GCC_WARN_UNDECLARED_SELECTOR = YES; 328 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 329 | GCC_WARN_UNUSED_FUNCTION = YES; 330 | GCC_WARN_UNUSED_VARIABLE = YES; 331 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 332 | STRIP_INSTALLED_PRODUCT = NO; 333 | SYMROOT = "${SRCROOT}/../build"; 334 | VALIDATE_PRODUCT = YES; 335 | }; 336 | name = Release; 337 | }; 338 | 150B42451BE026454D08F4512AE8A5FF /* Release */ = { 339 | isa = XCBuildConfiguration; 340 | baseConfigurationReference = 48D976FF388C44DF4EE1C55910CDE505 /* Pods.release.xcconfig */; 341 | buildSettings = { 342 | ENABLE_STRICT_OBJC_MSGSEND = YES; 343 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 344 | MTL_ENABLE_DEBUG_INFO = NO; 345 | OTHER_LDFLAGS = ""; 346 | OTHER_LIBTOOLFLAGS = ""; 347 | PODS_ROOT = "$(SRCROOT)"; 348 | PRODUCT_NAME = "$(TARGET_NAME)"; 349 | SDKROOT = iphoneos; 350 | SKIP_INSTALL = YES; 351 | }; 352 | name = Release; 353 | }; 354 | 4BDF4F8370EB94A4D618B5C65956AB18 /* Release */ = { 355 | isa = XCBuildConfiguration; 356 | baseConfigurationReference = 3C197B233086E970123A44F814F83B9A /* OpenShare.xcconfig */; 357 | buildSettings = { 358 | ENABLE_STRICT_OBJC_MSGSEND = YES; 359 | GCC_PREFIX_HEADER = "Target Support Files/OpenShare/OpenShare-prefix.pch"; 360 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 361 | MTL_ENABLE_DEBUG_INFO = NO; 362 | OTHER_LDFLAGS = ""; 363 | OTHER_LIBTOOLFLAGS = ""; 364 | PRODUCT_NAME = "$(TARGET_NAME)"; 365 | SDKROOT = iphoneos; 366 | SKIP_INSTALL = YES; 367 | }; 368 | name = Release; 369 | }; 370 | 66392A4C927ED28FCA8866E292F1FB1B /* Debug */ = { 371 | isa = XCBuildConfiguration; 372 | baseConfigurationReference = 3C197B233086E970123A44F814F83B9A /* OpenShare.xcconfig */; 373 | buildSettings = { 374 | ENABLE_STRICT_OBJC_MSGSEND = YES; 375 | GCC_PREFIX_HEADER = "Target Support Files/OpenShare/OpenShare-prefix.pch"; 376 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 377 | MTL_ENABLE_DEBUG_INFO = YES; 378 | ONLY_ACTIVE_ARCH = YES; 379 | OTHER_LDFLAGS = ""; 380 | OTHER_LIBTOOLFLAGS = ""; 381 | PRODUCT_NAME = "$(TARGET_NAME)"; 382 | SDKROOT = iphoneos; 383 | SKIP_INSTALL = YES; 384 | }; 385 | name = Debug; 386 | }; 387 | B37F0F91F85060E28F1DAAB522DC7EC1 /* Debug */ = { 388 | isa = XCBuildConfiguration; 389 | buildSettings = { 390 | ALWAYS_SEARCH_USER_PATHS = NO; 391 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 392 | CLANG_CXX_LIBRARY = "libc++"; 393 | CLANG_ENABLE_MODULES = YES; 394 | CLANG_ENABLE_OBJC_ARC = YES; 395 | CLANG_WARN_BOOL_CONVERSION = YES; 396 | CLANG_WARN_CONSTANT_CONVERSION = YES; 397 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; 398 | CLANG_WARN_EMPTY_BODY = YES; 399 | CLANG_WARN_ENUM_CONVERSION = YES; 400 | CLANG_WARN_INT_CONVERSION = YES; 401 | CLANG_WARN_OBJC_ROOT_CLASS = YES; 402 | CLANG_WARN_UNREACHABLE_CODE = YES; 403 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 404 | COPY_PHASE_STRIP = NO; 405 | GCC_C_LANGUAGE_STANDARD = gnu99; 406 | GCC_DYNAMIC_NO_PIC = NO; 407 | GCC_OPTIMIZATION_LEVEL = 0; 408 | GCC_PREPROCESSOR_DEFINITIONS = ( 409 | "DEBUG=1", 410 | "$(inherited)", 411 | ); 412 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 413 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 414 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 415 | GCC_WARN_UNDECLARED_SELECTOR = YES; 416 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 417 | GCC_WARN_UNUSED_FUNCTION = YES; 418 | GCC_WARN_UNUSED_VARIABLE = YES; 419 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 420 | ONLY_ACTIVE_ARCH = YES; 421 | STRIP_INSTALLED_PRODUCT = NO; 422 | SYMROOT = "${SRCROOT}/../build"; 423 | }; 424 | name = Debug; 425 | }; 426 | F913EA2E9DD43212FF315CC849B97B17 /* Debug */ = { 427 | isa = XCBuildConfiguration; 428 | baseConfigurationReference = 55A578B3308E1E609B3F88799AC5F7A2 /* Pods.debug.xcconfig */; 429 | buildSettings = { 430 | ENABLE_STRICT_OBJC_MSGSEND = YES; 431 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 432 | MTL_ENABLE_DEBUG_INFO = YES; 433 | OTHER_LDFLAGS = ""; 434 | OTHER_LIBTOOLFLAGS = ""; 435 | PODS_ROOT = "$(SRCROOT)"; 436 | PRODUCT_NAME = "$(TARGET_NAME)"; 437 | SDKROOT = iphoneos; 438 | SKIP_INSTALL = YES; 439 | }; 440 | name = Debug; 441 | }; 442 | /* End XCBuildConfiguration section */ 443 | 444 | /* Begin XCConfigurationList section */ 445 | 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { 446 | isa = XCConfigurationList; 447 | buildConfigurations = ( 448 | B37F0F91F85060E28F1DAAB522DC7EC1 /* Debug */, 449 | 052A17875CB827423D627183396CEB60 /* Release */, 450 | ); 451 | defaultConfigurationIsVisible = 0; 452 | defaultConfigurationName = Release; 453 | }; 454 | 94ECDAFF885AB10E562143BF3B4661C9 /* Build configuration list for PBXNativeTarget "OpenShare" */ = { 455 | isa = XCConfigurationList; 456 | buildConfigurations = ( 457 | 66392A4C927ED28FCA8866E292F1FB1B /* Debug */, 458 | 4BDF4F8370EB94A4D618B5C65956AB18 /* Release */, 459 | ); 460 | defaultConfigurationIsVisible = 0; 461 | defaultConfigurationName = Release; 462 | }; 463 | B4A158536705C0DF14A4727DF0F0135D /* Build configuration list for PBXNativeTarget "Pods" */ = { 464 | isa = XCConfigurationList; 465 | buildConfigurations = ( 466 | F913EA2E9DD43212FF315CC849B97B17 /* Debug */, 467 | 150B42451BE026454D08F4512AE8A5FF /* Release */, 468 | ); 469 | defaultConfigurationIsVisible = 0; 470 | defaultConfigurationName = Release; 471 | }; 472 | /* End XCConfigurationList section */ 473 | }; 474 | rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 475 | } 476 | -------------------------------------------------------------------------------- /TWSNSDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1B3195D2BB5A7096390D2E95 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D9D3B8FCB0DE141FD1077B1 /* libPods.a */; }; 11 | 28371DDD1B9ED0100012CEF6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 28371DDC1B9ED0100012CEF6 /* main.m */; }; 12 | 28371DE01B9ED0100012CEF6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 28371DDF1B9ED0100012CEF6 /* AppDelegate.m */; }; 13 | 28371DE31B9ED0100012CEF6 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28371DE21B9ED0100012CEF6 /* ViewController.m */; }; 14 | 28371DE61B9ED0100012CEF6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 28371DE41B9ED0100012CEF6 /* Main.storyboard */; }; 15 | 28371DEB1B9ED0100012CEF6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 28371DE91B9ED0100012CEF6 /* LaunchScreen.storyboard */; }; 16 | 284DBAAE1D5C4D4400AD7DD7 /* a.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 284DBAAD1D5C4D4400AD7DD7 /* a.jpg */; }; 17 | 286AA5C31BABC23900EEA6D1 /* NSString+SNSAddition.m in Sources */ = {isa = PBXBuildFile; fileRef = 286AA5B11BABC23900EEA6D1 /* NSString+SNSAddition.m */; }; 18 | 286AA5C41BABC23900EEA6D1 /* share-qq@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 286AA5B31BABC23900EEA6D1 /* share-qq@3x.png */; }; 19 | 286AA5C51BABC23900EEA6D1 /* share-qqzone@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 286AA5B41BABC23900EEA6D1 /* share-qqzone@3x.png */; }; 20 | 286AA5C61BABC23900EEA6D1 /* share-weibo@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 286AA5B51BABC23900EEA6D1 /* share-weibo@3x.png */; }; 21 | 286AA5C71BABC23900EEA6D1 /* share-weixin-frends@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 286AA5B61BABC23900EEA6D1 /* share-weixin-frends@3x.png */; }; 22 | 286AA5C81BABC23900EEA6D1 /* share-weixin@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 286AA5B71BABC23900EEA6D1 /* share-weixin@3x.png */; }; 23 | 286AA5C91BABC23900EEA6D1 /* TWOAuth.m in Sources */ = {isa = PBXBuildFile; fileRef = 286AA5B91BABC23900EEA6D1 /* TWOAuth.m */; }; 24 | 286AA5CA1BABC23900EEA6D1 /* TWShare.m in Sources */ = {isa = PBXBuildFile; fileRef = 286AA5BB1BABC23900EEA6D1 /* TWShare.m */; }; 25 | 286AA5CB1BABC23900EEA6D1 /* TWShareView.m in Sources */ = {isa = PBXBuildFile; fileRef = 286AA5BD1BABC23900EEA6D1 /* TWShareView.m */; }; 26 | 286AA5CC1BABC23900EEA6D1 /* TWSNS.m in Sources */ = {isa = PBXBuildFile; fileRef = 286AA5BF1BABC23900EEA6D1 /* TWSNS.m */; }; 27 | 286AA5CD1BABC23900EEA6D1 /* TWSNSRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 286AA5C21BABC23900EEA6D1 /* TWSNSRequest.m */; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXContainerItemProxy section */ 31 | 28371DF21B9ED0100012CEF6 /* PBXContainerItemProxy */ = { 32 | isa = PBXContainerItemProxy; 33 | containerPortal = 28371DD01B9ED0100012CEF6 /* Project object */; 34 | proxyType = 1; 35 | remoteGlobalIDString = 28371DD71B9ED0100012CEF6; 36 | remoteInfo = XTSNS; 37 | }; 38 | 28371DFD1B9ED0100012CEF6 /* PBXContainerItemProxy */ = { 39 | isa = PBXContainerItemProxy; 40 | containerPortal = 28371DD01B9ED0100012CEF6 /* Project object */; 41 | proxyType = 1; 42 | remoteGlobalIDString = 28371DD71B9ED0100012CEF6; 43 | remoteInfo = XTSNS; 44 | }; 45 | /* End PBXContainerItemProxy section */ 46 | 47 | /* Begin PBXFileReference section */ 48 | 28371DD81B9ED0100012CEF6 /* TWSNSDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TWSNSDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 28371DDC1B9ED0100012CEF6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 50 | 28371DDE1B9ED0100012CEF6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 51 | 28371DDF1B9ED0100012CEF6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 52 | 28371DE11B9ED0100012CEF6 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 53 | 28371DE21B9ED0100012CEF6 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 54 | 28371DE51B9ED0100012CEF6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 55 | 28371DEA1B9ED0100012CEF6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 56 | 28371DEC1B9ED0100012CEF6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 57 | 28371DF11B9ED0100012CEF6 /* TWSNSDemo.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TWSNSDemo.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | 28371DFC1B9ED0100012CEF6 /* TWSNSDemo.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TWSNSDemo.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | 284DBAAD1D5C4D4400AD7DD7 /* a.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = a.jpg; sourceTree = ""; }; 60 | 286AA5B01BABC23900EEA6D1 /* NSString+SNSAddition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+SNSAddition.h"; sourceTree = ""; }; 61 | 286AA5B11BABC23900EEA6D1 /* NSString+SNSAddition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+SNSAddition.m"; sourceTree = ""; }; 62 | 286AA5B31BABC23900EEA6D1 /* share-qq@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "share-qq@3x.png"; sourceTree = ""; }; 63 | 286AA5B41BABC23900EEA6D1 /* share-qqzone@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "share-qqzone@3x.png"; sourceTree = ""; }; 64 | 286AA5B51BABC23900EEA6D1 /* share-weibo@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "share-weibo@3x.png"; sourceTree = ""; }; 65 | 286AA5B61BABC23900EEA6D1 /* share-weixin-frends@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "share-weixin-frends@3x.png"; sourceTree = ""; }; 66 | 286AA5B71BABC23900EEA6D1 /* share-weixin@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "share-weixin@3x.png"; sourceTree = ""; }; 67 | 286AA5B81BABC23900EEA6D1 /* TWOAuth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWOAuth.h; sourceTree = ""; }; 68 | 286AA5B91BABC23900EEA6D1 /* TWOAuth.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWOAuth.m; sourceTree = ""; }; 69 | 286AA5BA1BABC23900EEA6D1 /* TWShare.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWShare.h; sourceTree = ""; }; 70 | 286AA5BB1BABC23900EEA6D1 /* TWShare.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWShare.m; sourceTree = ""; }; 71 | 286AA5BC1BABC23900EEA6D1 /* TWShareView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWShareView.h; sourceTree = ""; }; 72 | 286AA5BD1BABC23900EEA6D1 /* TWShareView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWShareView.m; sourceTree = ""; }; 73 | 286AA5BE1BABC23900EEA6D1 /* TWSNS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWSNS.h; sourceTree = ""; }; 74 | 286AA5BF1BABC23900EEA6D1 /* TWSNS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWSNS.m; sourceTree = ""; }; 75 | 286AA5C01BABC23900EEA6D1 /* TWSNSDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWSNSDefine.h; sourceTree = ""; }; 76 | 286AA5C11BABC23900EEA6D1 /* TWSNSRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWSNSRequest.h; sourceTree = ""; }; 77 | 286AA5C21BABC23900EEA6D1 /* TWSNSRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWSNSRequest.m; sourceTree = ""; }; 78 | 2D9D3B8FCB0DE141FD1077B1 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 79 | 3AA2F1963C44EE9616719555 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 80 | F3BFB7681AE3954A6F4C9BCC /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; 81 | /* End PBXFileReference section */ 82 | 83 | /* Begin PBXFrameworksBuildPhase section */ 84 | 28371DD51B9ED0100012CEF6 /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | 1B3195D2BB5A7096390D2E95 /* libPods.a in Frameworks */, 89 | ); 90 | runOnlyForDeploymentPostprocessing = 0; 91 | }; 92 | 28371DEE1B9ED0100012CEF6 /* Frameworks */ = { 93 | isa = PBXFrameworksBuildPhase; 94 | buildActionMask = 2147483647; 95 | files = ( 96 | ); 97 | runOnlyForDeploymentPostprocessing = 0; 98 | }; 99 | 28371DF91B9ED0100012CEF6 /* Frameworks */ = { 100 | isa = PBXFrameworksBuildPhase; 101 | buildActionMask = 2147483647; 102 | files = ( 103 | ); 104 | runOnlyForDeploymentPostprocessing = 0; 105 | }; 106 | /* End PBXFrameworksBuildPhase section */ 107 | 108 | /* Begin PBXGroup section */ 109 | 28371DCF1B9ED0100012CEF6 = { 110 | isa = PBXGroup; 111 | children = ( 112 | 286AA5AF1BABC23900EEA6D1 /* TWSNS */, 113 | 28371DDA1B9ED0100012CEF6 /* TWSNSDemo */, 114 | 28371DD91B9ED0100012CEF6 /* Products */, 115 | 3958C5CB25E58C445F566572 /* Pods */, 116 | C33ABBBFF5E6D9D283154A0F /* Frameworks */, 117 | ); 118 | sourceTree = ""; 119 | }; 120 | 28371DD91B9ED0100012CEF6 /* Products */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 28371DD81B9ED0100012CEF6 /* TWSNSDemo.app */, 124 | 28371DF11B9ED0100012CEF6 /* TWSNSDemo.xctest */, 125 | 28371DFC1B9ED0100012CEF6 /* TWSNSDemo.xctest */, 126 | ); 127 | name = Products; 128 | sourceTree = ""; 129 | }; 130 | 28371DDA1B9ED0100012CEF6 /* TWSNSDemo */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 28371DDE1B9ED0100012CEF6 /* AppDelegate.h */, 134 | 28371DDF1B9ED0100012CEF6 /* AppDelegate.m */, 135 | 28371DE11B9ED0100012CEF6 /* ViewController.h */, 136 | 28371DE21B9ED0100012CEF6 /* ViewController.m */, 137 | 28371DE41B9ED0100012CEF6 /* Main.storyboard */, 138 | 28371DE91B9ED0100012CEF6 /* LaunchScreen.storyboard */, 139 | 28371DEC1B9ED0100012CEF6 /* Info.plist */, 140 | 28371DDB1B9ED0100012CEF6 /* Supporting Files */, 141 | ); 142 | path = TWSNSDemo; 143 | sourceTree = ""; 144 | }; 145 | 28371DDB1B9ED0100012CEF6 /* Supporting Files */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | 284DBAAD1D5C4D4400AD7DD7 /* a.jpg */, 149 | 28371DDC1B9ED0100012CEF6 /* main.m */, 150 | ); 151 | name = "Supporting Files"; 152 | sourceTree = ""; 153 | }; 154 | 286AA5AF1BABC23900EEA6D1 /* TWSNS */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | 286AA5B21BABC23900EEA6D1 /* Resources */, 158 | 286AA5B01BABC23900EEA6D1 /* NSString+SNSAddition.h */, 159 | 286AA5B11BABC23900EEA6D1 /* NSString+SNSAddition.m */, 160 | 286AA5B81BABC23900EEA6D1 /* TWOAuth.h */, 161 | 286AA5B91BABC23900EEA6D1 /* TWOAuth.m */, 162 | 286AA5BA1BABC23900EEA6D1 /* TWShare.h */, 163 | 286AA5BB1BABC23900EEA6D1 /* TWShare.m */, 164 | 286AA5BC1BABC23900EEA6D1 /* TWShareView.h */, 165 | 286AA5BD1BABC23900EEA6D1 /* TWShareView.m */, 166 | 286AA5BE1BABC23900EEA6D1 /* TWSNS.h */, 167 | 286AA5BF1BABC23900EEA6D1 /* TWSNS.m */, 168 | 286AA5C01BABC23900EEA6D1 /* TWSNSDefine.h */, 169 | 286AA5C11BABC23900EEA6D1 /* TWSNSRequest.h */, 170 | 286AA5C21BABC23900EEA6D1 /* TWSNSRequest.m */, 171 | ); 172 | path = TWSNS; 173 | sourceTree = ""; 174 | }; 175 | 286AA5B21BABC23900EEA6D1 /* Resources */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | 286AA5B31BABC23900EEA6D1 /* share-qq@3x.png */, 179 | 286AA5B41BABC23900EEA6D1 /* share-qqzone@3x.png */, 180 | 286AA5B51BABC23900EEA6D1 /* share-weibo@3x.png */, 181 | 286AA5B61BABC23900EEA6D1 /* share-weixin-frends@3x.png */, 182 | 286AA5B71BABC23900EEA6D1 /* share-weixin@3x.png */, 183 | ); 184 | path = Resources; 185 | sourceTree = ""; 186 | }; 187 | 3958C5CB25E58C445F566572 /* Pods */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | 3AA2F1963C44EE9616719555 /* Pods.debug.xcconfig */, 191 | F3BFB7681AE3954A6F4C9BCC /* Pods.release.xcconfig */, 192 | ); 193 | name = Pods; 194 | sourceTree = ""; 195 | }; 196 | C33ABBBFF5E6D9D283154A0F /* Frameworks */ = { 197 | isa = PBXGroup; 198 | children = ( 199 | 2D9D3B8FCB0DE141FD1077B1 /* libPods.a */, 200 | ); 201 | name = Frameworks; 202 | sourceTree = ""; 203 | }; 204 | /* End PBXGroup section */ 205 | 206 | /* Begin PBXNativeTarget section */ 207 | 28371DD71B9ED0100012CEF6 /* TWSNSDemo */ = { 208 | isa = PBXNativeTarget; 209 | buildConfigurationList = 28371E051B9ED0100012CEF6 /* Build configuration list for PBXNativeTarget "TWSNSDemo" */; 210 | buildPhases = ( 211 | BC56EAC1C7D8FA3ED4AF53F9 /* Check Pods Manifest.lock */, 212 | 28371DD41B9ED0100012CEF6 /* Sources */, 213 | 28371DD51B9ED0100012CEF6 /* Frameworks */, 214 | 28371DD61B9ED0100012CEF6 /* Resources */, 215 | ECE6B6B30FC33F0CCAD1FA6A /* Copy Pods Resources */, 216 | ); 217 | buildRules = ( 218 | ); 219 | dependencies = ( 220 | ); 221 | name = TWSNSDemo; 222 | productName = XTSNS; 223 | productReference = 28371DD81B9ED0100012CEF6 /* TWSNSDemo.app */; 224 | productType = "com.apple.product-type.application"; 225 | }; 226 | 28371DF01B9ED0100012CEF6 /* TWSNSDemoTests */ = { 227 | isa = PBXNativeTarget; 228 | buildConfigurationList = 28371E081B9ED0100012CEF6 /* Build configuration list for PBXNativeTarget "TWSNSDemoTests" */; 229 | buildPhases = ( 230 | 28371DED1B9ED0100012CEF6 /* Sources */, 231 | 28371DEE1B9ED0100012CEF6 /* Frameworks */, 232 | 28371DEF1B9ED0100012CEF6 /* Resources */, 233 | ); 234 | buildRules = ( 235 | ); 236 | dependencies = ( 237 | 28371DF31B9ED0100012CEF6 /* PBXTargetDependency */, 238 | ); 239 | name = TWSNSDemoTests; 240 | productName = XTSNSTests; 241 | productReference = 28371DF11B9ED0100012CEF6 /* TWSNSDemo.xctest */; 242 | productType = "com.apple.product-type.bundle.unit-test"; 243 | }; 244 | 28371DFB1B9ED0100012CEF6 /* TWSNSDemoUITests */ = { 245 | isa = PBXNativeTarget; 246 | buildConfigurationList = 28371E0B1B9ED0100012CEF6 /* Build configuration list for PBXNativeTarget "TWSNSDemoUITests" */; 247 | buildPhases = ( 248 | 28371DF81B9ED0100012CEF6 /* Sources */, 249 | 28371DF91B9ED0100012CEF6 /* Frameworks */, 250 | 28371DFA1B9ED0100012CEF6 /* Resources */, 251 | ); 252 | buildRules = ( 253 | ); 254 | dependencies = ( 255 | 28371DFE1B9ED0100012CEF6 /* PBXTargetDependency */, 256 | ); 257 | name = TWSNSDemoUITests; 258 | productName = XTSNSUITests; 259 | productReference = 28371DFC1B9ED0100012CEF6 /* TWSNSDemo.xctest */; 260 | productType = "com.apple.product-type.bundle.ui-testing"; 261 | }; 262 | /* End PBXNativeTarget section */ 263 | 264 | /* Begin PBXProject section */ 265 | 28371DD01B9ED0100012CEF6 /* Project object */ = { 266 | isa = PBXProject; 267 | attributes = { 268 | LastUpgradeCheck = 0700; 269 | ORGANIZATIONNAME = LZA; 270 | TargetAttributes = { 271 | 28371DD71B9ED0100012CEF6 = { 272 | CreatedOnToolsVersion = 7.0; 273 | DevelopmentTeam = AK4385EZT4; 274 | }; 275 | 28371DF01B9ED0100012CEF6 = { 276 | CreatedOnToolsVersion = 7.0; 277 | TestTargetID = 28371DD71B9ED0100012CEF6; 278 | }; 279 | 28371DFB1B9ED0100012CEF6 = { 280 | CreatedOnToolsVersion = 7.0; 281 | TestTargetID = 28371DD71B9ED0100012CEF6; 282 | }; 283 | }; 284 | }; 285 | buildConfigurationList = 28371DD31B9ED0100012CEF6 /* Build configuration list for PBXProject "TWSNSDemo" */; 286 | compatibilityVersion = "Xcode 3.2"; 287 | developmentRegion = English; 288 | hasScannedForEncodings = 0; 289 | knownRegions = ( 290 | en, 291 | Base, 292 | ); 293 | mainGroup = 28371DCF1B9ED0100012CEF6; 294 | productRefGroup = 28371DD91B9ED0100012CEF6 /* Products */; 295 | projectDirPath = ""; 296 | projectRoot = ""; 297 | targets = ( 298 | 28371DD71B9ED0100012CEF6 /* TWSNSDemo */, 299 | 28371DF01B9ED0100012CEF6 /* TWSNSDemoTests */, 300 | 28371DFB1B9ED0100012CEF6 /* TWSNSDemoUITests */, 301 | ); 302 | }; 303 | /* End PBXProject section */ 304 | 305 | /* Begin PBXResourcesBuildPhase section */ 306 | 28371DD61B9ED0100012CEF6 /* Resources */ = { 307 | isa = PBXResourcesBuildPhase; 308 | buildActionMask = 2147483647; 309 | files = ( 310 | 286AA5C71BABC23900EEA6D1 /* share-weixin-frends@3x.png in Resources */, 311 | 284DBAAE1D5C4D4400AD7DD7 /* a.jpg in Resources */, 312 | 286AA5C61BABC23900EEA6D1 /* share-weibo@3x.png in Resources */, 313 | 28371DEB1B9ED0100012CEF6 /* LaunchScreen.storyboard in Resources */, 314 | 28371DE61B9ED0100012CEF6 /* Main.storyboard in Resources */, 315 | 286AA5C81BABC23900EEA6D1 /* share-weixin@3x.png in Resources */, 316 | 286AA5C51BABC23900EEA6D1 /* share-qqzone@3x.png in Resources */, 317 | 286AA5C41BABC23900EEA6D1 /* share-qq@3x.png in Resources */, 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | }; 321 | 28371DEF1B9ED0100012CEF6 /* Resources */ = { 322 | isa = PBXResourcesBuildPhase; 323 | buildActionMask = 2147483647; 324 | files = ( 325 | ); 326 | runOnlyForDeploymentPostprocessing = 0; 327 | }; 328 | 28371DFA1B9ED0100012CEF6 /* Resources */ = { 329 | isa = PBXResourcesBuildPhase; 330 | buildActionMask = 2147483647; 331 | files = ( 332 | ); 333 | runOnlyForDeploymentPostprocessing = 0; 334 | }; 335 | /* End PBXResourcesBuildPhase section */ 336 | 337 | /* Begin PBXShellScriptBuildPhase section */ 338 | BC56EAC1C7D8FA3ED4AF53F9 /* Check Pods Manifest.lock */ = { 339 | isa = PBXShellScriptBuildPhase; 340 | buildActionMask = 2147483647; 341 | files = ( 342 | ); 343 | inputPaths = ( 344 | ); 345 | name = "Check Pods Manifest.lock"; 346 | outputPaths = ( 347 | ); 348 | runOnlyForDeploymentPostprocessing = 0; 349 | shellPath = /bin/sh; 350 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 351 | showEnvVarsInLog = 0; 352 | }; 353 | ECE6B6B30FC33F0CCAD1FA6A /* Copy Pods Resources */ = { 354 | isa = PBXShellScriptBuildPhase; 355 | buildActionMask = 2147483647; 356 | files = ( 357 | ); 358 | inputPaths = ( 359 | ); 360 | name = "Copy Pods Resources"; 361 | outputPaths = ( 362 | ); 363 | runOnlyForDeploymentPostprocessing = 0; 364 | shellPath = /bin/sh; 365 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; 366 | showEnvVarsInLog = 0; 367 | }; 368 | /* End PBXShellScriptBuildPhase section */ 369 | 370 | /* Begin PBXSourcesBuildPhase section */ 371 | 28371DD41B9ED0100012CEF6 /* Sources */ = { 372 | isa = PBXSourcesBuildPhase; 373 | buildActionMask = 2147483647; 374 | files = ( 375 | 286AA5C31BABC23900EEA6D1 /* NSString+SNSAddition.m in Sources */, 376 | 286AA5CD1BABC23900EEA6D1 /* TWSNSRequest.m in Sources */, 377 | 286AA5CC1BABC23900EEA6D1 /* TWSNS.m in Sources */, 378 | 28371DE31B9ED0100012CEF6 /* ViewController.m in Sources */, 379 | 28371DE01B9ED0100012CEF6 /* AppDelegate.m in Sources */, 380 | 286AA5CB1BABC23900EEA6D1 /* TWShareView.m in Sources */, 381 | 286AA5C91BABC23900EEA6D1 /* TWOAuth.m in Sources */, 382 | 286AA5CA1BABC23900EEA6D1 /* TWShare.m in Sources */, 383 | 28371DDD1B9ED0100012CEF6 /* main.m in Sources */, 384 | ); 385 | runOnlyForDeploymentPostprocessing = 0; 386 | }; 387 | 28371DED1B9ED0100012CEF6 /* Sources */ = { 388 | isa = PBXSourcesBuildPhase; 389 | buildActionMask = 2147483647; 390 | files = ( 391 | ); 392 | runOnlyForDeploymentPostprocessing = 0; 393 | }; 394 | 28371DF81B9ED0100012CEF6 /* Sources */ = { 395 | isa = PBXSourcesBuildPhase; 396 | buildActionMask = 2147483647; 397 | files = ( 398 | ); 399 | runOnlyForDeploymentPostprocessing = 0; 400 | }; 401 | /* End PBXSourcesBuildPhase section */ 402 | 403 | /* Begin PBXTargetDependency section */ 404 | 28371DF31B9ED0100012CEF6 /* PBXTargetDependency */ = { 405 | isa = PBXTargetDependency; 406 | target = 28371DD71B9ED0100012CEF6 /* TWSNSDemo */; 407 | targetProxy = 28371DF21B9ED0100012CEF6 /* PBXContainerItemProxy */; 408 | }; 409 | 28371DFE1B9ED0100012CEF6 /* PBXTargetDependency */ = { 410 | isa = PBXTargetDependency; 411 | target = 28371DD71B9ED0100012CEF6 /* TWSNSDemo */; 412 | targetProxy = 28371DFD1B9ED0100012CEF6 /* PBXContainerItemProxy */; 413 | }; 414 | /* End PBXTargetDependency section */ 415 | 416 | /* Begin PBXVariantGroup section */ 417 | 28371DE41B9ED0100012CEF6 /* Main.storyboard */ = { 418 | isa = PBXVariantGroup; 419 | children = ( 420 | 28371DE51B9ED0100012CEF6 /* Base */, 421 | ); 422 | name = Main.storyboard; 423 | sourceTree = ""; 424 | }; 425 | 28371DE91B9ED0100012CEF6 /* LaunchScreen.storyboard */ = { 426 | isa = PBXVariantGroup; 427 | children = ( 428 | 28371DEA1B9ED0100012CEF6 /* Base */, 429 | ); 430 | name = LaunchScreen.storyboard; 431 | sourceTree = ""; 432 | }; 433 | /* End PBXVariantGroup section */ 434 | 435 | /* Begin XCBuildConfiguration section */ 436 | 28371E031B9ED0100012CEF6 /* Debug */ = { 437 | isa = XCBuildConfiguration; 438 | buildSettings = { 439 | ALWAYS_SEARCH_USER_PATHS = NO; 440 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 441 | CLANG_CXX_LIBRARY = "libc++"; 442 | CLANG_ENABLE_MODULES = YES; 443 | CLANG_ENABLE_OBJC_ARC = YES; 444 | CLANG_WARN_BOOL_CONVERSION = YES; 445 | CLANG_WARN_CONSTANT_CONVERSION = YES; 446 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 447 | CLANG_WARN_EMPTY_BODY = YES; 448 | CLANG_WARN_ENUM_CONVERSION = YES; 449 | CLANG_WARN_INT_CONVERSION = YES; 450 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 451 | CLANG_WARN_UNREACHABLE_CODE = YES; 452 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 453 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 454 | COPY_PHASE_STRIP = NO; 455 | DEBUG_INFORMATION_FORMAT = dwarf; 456 | ENABLE_STRICT_OBJC_MSGSEND = YES; 457 | ENABLE_TESTABILITY = YES; 458 | GCC_C_LANGUAGE_STANDARD = gnu99; 459 | GCC_DYNAMIC_NO_PIC = NO; 460 | GCC_NO_COMMON_BLOCKS = YES; 461 | GCC_OPTIMIZATION_LEVEL = 0; 462 | GCC_PREPROCESSOR_DEFINITIONS = ( 463 | "DEBUG=1", 464 | "$(inherited)", 465 | ); 466 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 467 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 468 | GCC_WARN_UNDECLARED_SELECTOR = YES; 469 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 470 | GCC_WARN_UNUSED_FUNCTION = YES; 471 | GCC_WARN_UNUSED_VARIABLE = YES; 472 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 473 | MTL_ENABLE_DEBUG_INFO = YES; 474 | ONLY_ACTIVE_ARCH = YES; 475 | SDKROOT = iphoneos; 476 | }; 477 | name = Debug; 478 | }; 479 | 28371E041B9ED0100012CEF6 /* Release */ = { 480 | isa = XCBuildConfiguration; 481 | buildSettings = { 482 | ALWAYS_SEARCH_USER_PATHS = NO; 483 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 484 | CLANG_CXX_LIBRARY = "libc++"; 485 | CLANG_ENABLE_MODULES = YES; 486 | CLANG_ENABLE_OBJC_ARC = YES; 487 | CLANG_WARN_BOOL_CONVERSION = YES; 488 | CLANG_WARN_CONSTANT_CONVERSION = YES; 489 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 490 | CLANG_WARN_EMPTY_BODY = YES; 491 | CLANG_WARN_ENUM_CONVERSION = YES; 492 | CLANG_WARN_INT_CONVERSION = YES; 493 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 494 | CLANG_WARN_UNREACHABLE_CODE = YES; 495 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 496 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 497 | COPY_PHASE_STRIP = NO; 498 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 499 | ENABLE_NS_ASSERTIONS = NO; 500 | ENABLE_STRICT_OBJC_MSGSEND = YES; 501 | GCC_C_LANGUAGE_STANDARD = gnu99; 502 | GCC_NO_COMMON_BLOCKS = YES; 503 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 504 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 505 | GCC_WARN_UNDECLARED_SELECTOR = YES; 506 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 507 | GCC_WARN_UNUSED_FUNCTION = YES; 508 | GCC_WARN_UNUSED_VARIABLE = YES; 509 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 510 | MTL_ENABLE_DEBUG_INFO = NO; 511 | SDKROOT = iphoneos; 512 | VALIDATE_PRODUCT = YES; 513 | }; 514 | name = Release; 515 | }; 516 | 28371E061B9ED0100012CEF6 /* Debug */ = { 517 | isa = XCBuildConfiguration; 518 | baseConfigurationReference = 3AA2F1963C44EE9616719555 /* Pods.debug.xcconfig */; 519 | buildSettings = { 520 | CODE_SIGN_IDENTITY = "iPhone Developer"; 521 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 522 | ENABLE_BITCODE = NO; 523 | INFOPLIST_FILE = "$(SRCROOT)/TWSNSDemo/Info.plist"; 524 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 525 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 526 | LIBRARY_SEARCH_PATHS = ( 527 | "$(inherited)", 528 | "$(SDKROOT)/usr/lib/system", 529 | ); 530 | ONLY_ACTIVE_ARCH = YES; 531 | PRODUCT_BUNDLE_IDENTIFIER = com.shy.chuanqing44; 532 | PRODUCT_NAME = TWSNSDemo; 533 | PROVISIONING_PROFILE = ""; 534 | }; 535 | name = Debug; 536 | }; 537 | 28371E071B9ED0100012CEF6 /* Release */ = { 538 | isa = XCBuildConfiguration; 539 | baseConfigurationReference = F3BFB7681AE3954A6F4C9BCC /* Pods.release.xcconfig */; 540 | buildSettings = { 541 | CODE_SIGN_IDENTITY = "iPhone Developer"; 542 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 543 | ENABLE_BITCODE = NO; 544 | INFOPLIST_FILE = "$(SRCROOT)/TWSNSDemo/Info.plist"; 545 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 546 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 547 | LIBRARY_SEARCH_PATHS = ( 548 | "$(inherited)", 549 | "$(SDKROOT)/usr/lib/system", 550 | ); 551 | ONLY_ACTIVE_ARCH = YES; 552 | PRODUCT_BUNDLE_IDENTIFIER = com.shy.chuanqing44; 553 | PRODUCT_NAME = TWSNSDemo; 554 | PROVISIONING_PROFILE = ""; 555 | }; 556 | name = Release; 557 | }; 558 | 28371E091B9ED0100012CEF6 /* Debug */ = { 559 | isa = XCBuildConfiguration; 560 | buildSettings = { 561 | BUNDLE_LOADER = "$(TEST_HOST)"; 562 | INFOPLIST_FILE = XTSNSTests/Info.plist; 563 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 564 | PRODUCT_BUNDLE_IDENTIFIER = com.lza.XTSNSTests; 565 | PRODUCT_NAME = TWSNSDemo; 566 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TWSNSDemo.app/TWSNSDemo"; 567 | }; 568 | name = Debug; 569 | }; 570 | 28371E0A1B9ED0100012CEF6 /* Release */ = { 571 | isa = XCBuildConfiguration; 572 | buildSettings = { 573 | BUNDLE_LOADER = "$(TEST_HOST)"; 574 | INFOPLIST_FILE = XTSNSTests/Info.plist; 575 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 576 | PRODUCT_BUNDLE_IDENTIFIER = com.lza.XTSNSTests; 577 | PRODUCT_NAME = TWSNSDemo; 578 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TWSNSDemo.app/TWSNSDemo"; 579 | }; 580 | name = Release; 581 | }; 582 | 28371E0C1B9ED0100012CEF6 /* Debug */ = { 583 | isa = XCBuildConfiguration; 584 | buildSettings = { 585 | INFOPLIST_FILE = XTSNSUITests/Info.plist; 586 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 587 | PRODUCT_BUNDLE_IDENTIFIER = com.lza.XTSNSUITests; 588 | PRODUCT_NAME = TWSNSDemo; 589 | TEST_TARGET_NAME = XTSNS; 590 | USES_XCTRUNNER = YES; 591 | }; 592 | name = Debug; 593 | }; 594 | 28371E0D1B9ED0100012CEF6 /* Release */ = { 595 | isa = XCBuildConfiguration; 596 | buildSettings = { 597 | INFOPLIST_FILE = XTSNSUITests/Info.plist; 598 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 599 | PRODUCT_BUNDLE_IDENTIFIER = com.lza.XTSNSUITests; 600 | PRODUCT_NAME = TWSNSDemo; 601 | TEST_TARGET_NAME = XTSNS; 602 | USES_XCTRUNNER = YES; 603 | }; 604 | name = Release; 605 | }; 606 | /* End XCBuildConfiguration section */ 607 | 608 | /* Begin XCConfigurationList section */ 609 | 28371DD31B9ED0100012CEF6 /* Build configuration list for PBXProject "TWSNSDemo" */ = { 610 | isa = XCConfigurationList; 611 | buildConfigurations = ( 612 | 28371E031B9ED0100012CEF6 /* Debug */, 613 | 28371E041B9ED0100012CEF6 /* Release */, 614 | ); 615 | defaultConfigurationIsVisible = 0; 616 | defaultConfigurationName = Release; 617 | }; 618 | 28371E051B9ED0100012CEF6 /* Build configuration list for PBXNativeTarget "TWSNSDemo" */ = { 619 | isa = XCConfigurationList; 620 | buildConfigurations = ( 621 | 28371E061B9ED0100012CEF6 /* Debug */, 622 | 28371E071B9ED0100012CEF6 /* Release */, 623 | ); 624 | defaultConfigurationIsVisible = 0; 625 | defaultConfigurationName = Release; 626 | }; 627 | 28371E081B9ED0100012CEF6 /* Build configuration list for PBXNativeTarget "TWSNSDemoTests" */ = { 628 | isa = XCConfigurationList; 629 | buildConfigurations = ( 630 | 28371E091B9ED0100012CEF6 /* Debug */, 631 | 28371E0A1B9ED0100012CEF6 /* Release */, 632 | ); 633 | defaultConfigurationIsVisible = 0; 634 | defaultConfigurationName = Release; 635 | }; 636 | 28371E0B1B9ED0100012CEF6 /* Build configuration list for PBXNativeTarget "TWSNSDemoUITests" */ = { 637 | isa = XCConfigurationList; 638 | buildConfigurations = ( 639 | 28371E0C1B9ED0100012CEF6 /* Debug */, 640 | 28371E0D1B9ED0100012CEF6 /* Release */, 641 | ); 642 | defaultConfigurationIsVisible = 0; 643 | defaultConfigurationName = Release; 644 | }; 645 | /* End XCConfigurationList section */ 646 | }; 647 | rootObject = 28371DD01B9ED0100012CEF6 /* Project object */; 648 | } 649 | -------------------------------------------------------------------------------- /Pods/OpenShare/LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | 676 | --------------------------------------------------------------------------------