Commit 125a1f71 authored by mei's avatar mei

cocoapods集成友盟分享 SDK 及应用信息配置 待真机调试

parent f29f974b
......@@ -62,19 +62,42 @@
switch (sender.tag) {
case 101:
{
{//默认分享样式
[UMSocialData defaultData].extConfig.wechatSessionData.title = @"标题";// 微信title
[UMSocialData defaultData].extConfig.wechatTimelineData.title = @"标题";// 微信朋友圈title
[UMSocialData defaultData].extConfig.qqData.title = @"标题";// QQ分享title
[UMSocialData defaultData].extConfig.qzoneData.title = @"标题";// Qzone分享title
//注意: 1. 支持分享编辑页和授权页面横屏,必须要在出现列表页面前设置:
[UMSocialConfig setSupportedInterfaceOrientations:UIInterfaceOrientationMaskLandscape];
// 显示分享界面
[UMSocialSnsService presentSnsIconSheetView:self appKey:@"57425f2467e58e645f00210a" shareText:@"友盟社会化分享让您快速实现分享等社会化功能,http://umeng.com/social"
shareImage:[UIImage imageNamed:@"icon"] shareToSnsNames:@[UMShareToWechatSession,UMShareToWechatTimeline,UMShareToQQ,UMShareToQzone]
delegate:self];
}
break;
case 102:
{
[UMSocialData defaultData].extConfig.title = @"分享的title";
[UMSocialData defaultData].extConfig.qqData.url = @"http://baidu.com";
[UMSocialSnsService presentSnsIconSheetView:self
appKey:@"57425f2467e58e645f00210a"
shareText:@"友盟社会化分享让您快速实现分享等社会化功能,http://umeng.com/social"
shareImage:[UIImage imageNamed:@"icon"]
shareToSnsNames:@[UMShareToWechatSession,UMShareToWechatTimeline,UMShareToQQ,UMShareToQzone]
delegate:self];
}
break;
case 103:
{
// 自定义分享样式
//需要自定义面板样式的开发者需要自己绘制UI,在对应的分享按钮中调用此接口
//使用UMShareToWechatSession,UMShareToWechatTimeline,UMShareToWechatFavorite分别代表微信好友、微信朋友圈、微信收藏
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToSina] content:@"分享内嵌文字" image:nil location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *response){
if (response.responseCode == UMSResponseCodeSuccess) {
NSLog(@"分享成功!");
}
}];
}
break;
......@@ -84,7 +107,16 @@
}
}
//实现回调方法:
-(void)didFinishGetUMSocialDataInViewController:(UMSocialResponseEntity *)response
{
//根据`responseCode`得到发送结果,如果分享成功
if(response.responseCode == UMSResponseCodeSuccess)
{
//得到分享到的微博平台名
NSLog(@"share to sns name is %@",[[response.data allKeys] objectAtIndex:0]);
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
......
......@@ -10,6 +10,13 @@
041636BE1CF377F4008CE961 /* CameraView.m in Sources */ = {isa = PBXBuildFile; fileRef = 041636BD1CF377F4008CE961 /* CameraView.m */; };
041636C21CF395B7008CE961 /* NSObject+UIImagePickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 041636C11CF395B7008CE961 /* NSObject+UIImagePickerController.m */; };
041636C51CF3986F008CE961 /* CustomUIImagePickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 041636C41CF3986F008CE961 /* CustomUIImagePickerController.m */; };
041843DC1CF773490081B694 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 041843DB1CF773490081B694 /* Security.framework */; };
041843DE1CF773530081B694 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 041843DD1CF773530081B694 /* libiconv.tbd */; };
041843DF1CF7735C0081B694 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04F9EE1F1CF27AF900BD729F /* SystemConfiguration.framework */; };
041843E11CF773710081B694 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 041843E01CF773710081B694 /* CoreGraphics.framework */; };
041843E31CF7737E0081B694 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 041843E21CF7737E0081B694 /* libsqlite3.tbd */; };
041843E51CF773990081B694 /* libstdc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 041843E41CF773990081B694 /* libstdc++.tbd */; };
041843E71CF773A00081B694 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 041843E61CF773A00081B694 /* libz.tbd */; };
0447085E1CD7C06B00555827 /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0447085D1CD7C06B00555827 /* LoginViewController.m */; };
044708611CD7C1E800555827 /* MainSetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 044708601CD7C1E800555827 /* MainSetViewController.m */; };
044CD6EE1CEB771C0004A715 /* SeceneCollectionPictureCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 044CD6ED1CEB771C0004A715 /* SeceneCollectionPictureCell.m */; };
......@@ -143,6 +150,12 @@
041636C11CF395B7008CE961 /* NSObject+UIImagePickerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+UIImagePickerController.m"; sourceTree = "<group>"; };
041636C31CF3986F008CE961 /* CustomUIImagePickerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomUIImagePickerController.h; sourceTree = "<group>"; };
041636C41CF3986F008CE961 /* CustomUIImagePickerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomUIImagePickerController.m; sourceTree = "<group>"; };
041843DB1CF773490081B694 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
041843DD1CF773530081B694 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = usr/lib/libiconv.tbd; sourceTree = SDKROOT; };
041843E01CF773710081B694 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
041843E21CF7737E0081B694 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; };
041843E41CF773990081B694 /* libstdc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libstdc++.tbd"; path = "usr/lib/libstdc++.tbd"; sourceTree = SDKROOT; };
041843E61CF773A00081B694 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
0447085C1CD7C06B00555827 /* LoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginViewController.h; sourceTree = "<group>"; };
0447085D1CD7C06B00555827 /* LoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginViewController.m; sourceTree = "<group>"; };
0447085F1CD7C1E800555827 /* MainSetViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainSetViewController.h; sourceTree = "<group>"; };
......@@ -377,7 +390,14 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
041843E71CF773A00081B694 /* libz.tbd in Frameworks */,
041843E51CF773990081B694 /* libstdc++.tbd in Frameworks */,
04F9EE221CF27B1D00BD729F /* CoreTelephony.framework in Frameworks */,
041843E31CF7737E0081B694 /* libsqlite3.tbd in Frameworks */,
041843E11CF773710081B694 /* CoreGraphics.framework in Frameworks */,
041843DF1CF7735C0081B694 /* SystemConfiguration.framework in Frameworks */,
041843DE1CF773530081B694 /* libiconv.tbd in Frameworks */,
041843DC1CF773490081B694 /* Security.framework in Frameworks */,
BF53D4B7E2EE4CFF549FF699 /* libPods.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -1256,6 +1276,12 @@
4333C4B25549A396FC0CD944 /* Frameworks */ = {
isa = PBXGroup;
children = (
041843E61CF773A00081B694 /* libz.tbd */,
041843E41CF773990081B694 /* libstdc++.tbd */,
041843E21CF7737E0081B694 /* libsqlite3.tbd */,
041843E01CF773710081B694 /* CoreGraphics.framework */,
041843DD1CF773530081B694 /* libiconv.tbd */,
041843DB1CF773490081B694 /* Security.framework */,
04F9EE211CF27B1D00BD729F /* CoreTelephony.framework */,
04F9EE1F1CF27AF900BD729F /* SystemConfiguration.framework */,
2DB768A1F2B4AFFF8B89F1D1 /* libPods.a */,
......
......@@ -8,6 +8,10 @@
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
#import "UMSocial.h"
#import "UMSocialWechatHandler.h"
#import "UMSocialSinaSSOHandler.h"
#import "UMSocialQQHandler.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate>
......
......@@ -22,6 +22,7 @@
[self SetIQKeyboardManager];
[self RootViewcontroller];
[self detectionNetwork];
[self setUMShare];
return YES;
}
......@@ -42,6 +43,15 @@
}
}
//分享回调
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
BOOL result = [UMSocialSnsService handleOpenURL:url];
if (result == FALSE) {
//调用其他SDK,例如支付宝SDK等
}
return result;
}
#pragma mark -设置根视图
- (void)RootViewcontroller
{
......@@ -97,7 +107,22 @@
}];
}
-(void)setUMShare
{
// 友盟分享初始化
[UMSocialData setAppKey:@"57425f2467e58e645f00210a"];
// 设置微信AppId、appSecret,分享url
[UMSocialWechatHandler setWXAppId:@"wxab385878d9441f23" appSecret:@"58b85af13973bdf597fa807208ac0dff " url:@"http://www.umeng.com/social"];
// 设置微博的AppKey、appSecret,分享url
[UMSocialSinaSSOHandler openNewSinaSSOWithAppKey:@"1111393286"secret:@"5d011c05122b5539ec9592372f944d3c"
RedirectURL:@"http://sns.whalecloud.com/sina2/callback"];
// // 设置QQAppId、appSecret,分享url
// [UMSocialQQHandler setQQWithAppId:@"AppId" appKey:@"appSecret" url:@"url链接"];
}
- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
......
......@@ -25,6 +25,20 @@
<string>Editor</string>
<key>CFBundleURLName</key>
<string>weixin</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wxab385878d9441f23</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>weibo</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wb1111393286</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment