SDK下载:
https://developer.umeng.com/sdk/ios
集成文档:
https://developer.umeng.com/docs/66632/detail/66825
1.添加项目配置
在Other Linker Flags加入-ObjC ,注意不要写为-Objc
libsqlite3.tbd
CoreGraphics.framework
SystemConfiguration.framework
CoreTelephony.framework
libsqlite3.tbd
libc++.tbd
libz.tbd
ImageIO.framework
3.第三方平台配置:配置SSO白名单
在plist文件dict里面添加即可.
4.配置URL Scheme
5.<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
6.#import "AppDelegate.h"
import <UMShare/UMShare.h>
[UMSocialManager defaultManager].umSocialAppkey = @"5abc4a49f43e4804f100012a";
[UMSocialManager defaultManager].umSocialAppSecret = @"";
在delegate里面初始化
-
(void)configUSharePlatforms
{
/* 设置微信的appKey和appSecret */
[[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_WechatSession appKey:@"wx0b4719a89844e292" appSecret:@"aab6de1350e0c6292b5b8f93e6c74a5b" redirectURL:@"http://mobile.umeng.com/social"];/* 设置新浪的appKey和appSecret */
[[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_Sina appKey:@"1787580912" appSecret:@"08d9a4082198af51a181089f929c5944" redirectURL:@"https://sns.whalecloud.com/sina2/callback"];[[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_QQ appKey:@"1105453792"/*设置QQ平台的appID*/ appSecret:@"rpFNUkUdNiM8t5zZ" redirectURL:@"http://mobile.umeng.com/social"];
}
在VC里面添加第三方登录即可.
网友评论