IOS 百度社会化分享注意点

发布时间:2016-12-10 1:33:49 编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"IOS 百度社会化分享注意点",主要涉及到IOS 百度社会化分享注意点方面的内容,对于IOS 百度社会化分享注意点感兴趣的同学可以参考一下。

1》包要加整齐 2》app key 3》Other Linker Flags   改为 :-ObjC         (解决:点击不能弹出登入授权页面) 4》Sbjson 可能会冲突 可以删除一个 //初始化社会化分享组件 - (void)initializeBaiduSocialSDK { // decleare the platforms to share NSArray *platforms = [NSArray arrayWithObjects: kBD_SOCIAL_SHARE_PLATFORM_SINAWEIBO,kBD_SOCIAL_SHARE_PLATFORM_QQWEIBO,kBD_SOCIAL_SHARE_PLATFORM_QQZONE,kBD_SOCIAL_SHARE_PLATFORM_RENREN,kBD_SOCIAL_SHARE_PLATFORM_KAIXIN,kBD_SOCIAL_SHARE_PLATFORM_WEIXIN_SESSION,kBD_SOCIAL_SHARE_PLATFORM_WEIXIN_TIMELINE,kBD_SOCIAL_SHARE_PLATFORM_QQFRIEND,kBD_SOCIAL_SHARE_PLATFORM_SMS,kBD_SOCIAL_SHARE_PLATFORM_EMAIL,kBD_SOCIAL_SHARE_PLATFORM_TIEBA, nil]; // initialize baidu share SDK [BDSocialShareSDK registerApiKey:kBD_SOCIAL_SHARE_API_KEY andSupportPlatforms:platforms]; } - (IBAction)onShareOutButtonClicked:(NSNotification *)notify { //截屏 UIGraphicsBeginImageContext(self.view.bounds.size); [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *uiImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); BDSocialEventHandler result = ^(BD_SOCIAL_RESULT requestResult, NSString *shareType, id response, NSError *error) { if (requestResult == BD_SOCIAL_SUCCESS) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:[NSString stringWithFormat:@"[email protected]",@""] delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil]; [alert show]; [alert release]; NSLog(@"[email protected]",shareType); } else if (requestResult == BD_SOCIAL_CANCEL){ NSLog(@"分享取消"); } else if (requestResult == BD_SOCIAL_FAIL){ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"分享失败" message:[NSString stringWithFormat:@"[email protected]\n error code:%d;\n error message:%@",shareType,error.code,[error localizedDescription]] delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil]; [alert show]; [alert release]; NSLog(@"[email protected]\n error code:%d;\n error message:%@",shareType,error.code,[error localizedDescription]); } }; SHARE_MENU_STYLE style = BD_SOCIAL_SHARE_MENU_THEME_STYLE; BDSocialShareContent *content = [BDSocialShareContent shareContentWithDescription:@"消息" url:@"http://aa540933120.host.yzdns.cn" title:@"title"]; [content addImageWithImageSource:uiImage imageUrl:@""]; style = BD_SOCIAL_SHARE_MENU_THEME_STYLE; [BDSocialShareSDK showShareMenuWithShareContent:content menuStyle:style result:result]; }

上一篇:boost库中thread多线程详解3——细说lock_guard
下一篇:

相关文章

相关评论