国外第三方分享,包括Facebook,twitter,Instagram
1.facebook ,twitter等
通过iphone自带的分享,首先导入Social.framework,然后导入
#import <Social/Social.h>
SLComposeViewController *composeVc = [SLComposeViewController composeViewControllerForServiceType:sharedName];
BOOL success = [composeVc setInitialText:self.sharedContent];//分享内容
BOOL imageSuccess = [composeVc addImage:self.sharedImage];//分享的图片
//回调
SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result){
if (result == SLComposeViewControllerResultCancelled) {
NSLog(@"Cancelled");
}else{
NSLog(@"Post");
}
[composeVc dismissViewControllerAnimated:YES completion:Nil];
};
composeVc.completionHandler = myBlock;
if(success && imageSuccess)
[self presentViewController:composeVc animated:YES completion:nil];
}
- (void)instagramShare:(UIView*)view{
UIImage* image = [UIImage imageNamed:@"csh.jpg"];//分享的图片
CGFloat cropVal = (image.size.height > image.size.width ? image.size.width : image.size.height);
cropVal *= [image scale];
CGRect cropRect = (CGRect){.size.height = cropVal, .size.width = cropVal};
CGImageRef imageRef = CGImageCreateWithImageInRect([image CGImage], cropRect);
NSData *imageData = UIImageJPEGRepresentation([UIImage imageWithCGImage:imageRef], 1.0);
CGImageRelease(imageRef);
NSString *writePath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"instagram.igo"];
if (![imageData writeToFile:writePath atomically:YES]) {
// failure
NSLog(@"image save failed to path %@", writePath);
return;
} else {
// success.
}
// send it to instagram.
NSURL *fileURL = [NSURL fileURLWithPath:writePath];
self.documentController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
self.documentController.delegate = self;
[self.documentController setUTI:@"com.instagram.exclusivegram"];
[self.documentController setAnnotation:@{@"InstagramCaption" : @"My love dyl"}];
CGRect rect = CGRectMake(0 ,0 , 0, 0);
UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIGraphicsEndImageContext();
[self.documentController presentOpenInMenuFromRect:rect inView:view animated:YES];
}
国外第三方分享,包括Facebook,twitter,Instagram相关推荐
- IOS-海外版授权分享推送统计 Google FaceBook Twitter Instagram
目录 备注 Google Google分享 Google推送 FaceBook FaceBook分享 Twitter Twitter分享 Instagram Instagram分享 SDK下载 UIW ...
- 分享google+facebook+twitter(Eclipse)
最近做游戏分享功能,遇到了这3大平台的分享,网上的介绍好多,但也不全,没有做到很详细的分享图片,文字,链接的介绍,所以我结合了一下,自己封装了3大平台的分享. 一,google+分享 不需要申请,直接 ...
- instagram分享_Facebook,Twitter,Instagram,Google等使用的字体和颜色
instagram分享 Social login buttons, links to social media channels - in 2020 this is still a thing in ...
- Web 网站页面的社交分享 (Linkedin, Facebook, Twitter)
公司的web项目中,经常会有社交分享,这里简单说明下,方便后面开发人员理解. 分享的原理 社交分享(linkedin, facebook, twitter)的本质就是请求其一个公开的页面.通过参数告诉 ...
- iOS - ShareSDK第三方分享(图文和视频)和登录
由于近期工作需要自己抽时间搞了一下第三方分享,这里使用的是shareSDK的第三方,在使用的过程中有一些心得和体会,特在此和大家分享一下~ 1.在经过将近一周时间的开发,终于搞定ios分享了. 2.由 ...
- Python分享消息到Twitter、Youtube、Facebook平台
Python分享消息到Twitter.Youtube.Facebook平台 浏览器 概述 第三方登录平台免不了需要登录验证,比起命令行输入账号密码再填充表单,不如直接用浏览器实在 环境配置 运行库 p ...
- 前端开发第三方分享/登录功能备忘(facebook、weibo、QQ、weixin微信好友或者朋友圈)
##前端开发第三方分享[/三方登录]功能备忘(facebook脸书.Whatsapp.weibo.QQ.weixin好友或者朋友圈) 平台 支持域名 备案 切换域名调整 平台名称 注意事项
- 【历史上的今天】9 月 6 日:Facebook 收购 Instagram;华为发布 5G 芯片;惠普并购康柏
整理 | 王启隆 透过「历史上的今天」,从过去看未来,从现在亦可以改变未来. 今天是 2022 年 9 月 6 日,在 23 年前的今天,北京 2008 年奥运会申办委员会成立,使奥运圣火在占世界 1 ...
- 分享到facebook链接原格式_神马?!你还不知道Facebook广告怎么操作?
facebook是当下最受欢迎的社交平台之一,大部分的人都开了facebook账户,分享自己的日常生活和动态. 目前Facebook上有10亿来自亚洲的用户,欧洲有3.85亿Facebook用户. 在 ...
最新文章
- 深入Java泛型(六):Bean强转原理实践
- 企业云存储:为什么中大型企业偏爱自建私有云?
- leetcode —— 59. 螺旋矩阵 II
- 带你掌握不同平台下,探索JDK源码所需的native方法
- GridView中 选中checkbox,在上下页 保存选中的值
- 好程序员Java教程分享使用HttpClient抓取页面内容
- 图书租赁管理系统 图书馆借书还书 计算机毕设项目
- javacv 视频增加水印
- 微信小程序——样式覆盖
- 斯特林公式 (Stirling公式)
- office修复找不到msi_安装Office2007,总是提示找不到OfficeMUI.msi
- 应届生求职面试真的有那么难吗
- 产品经理 - 路漫漫其修远兮 (2)
- 酒水知识(六大基酒之白兰地_Brandy)
- Mybatis面试合集
- abp过滤规则android,撰写 Adblock Plus 过滤规则
- NMEA-GPS协议
- Android 禁止安装没有授权的第三方应用
- mvc中简单从controll传递数据到前台页面(视图)
- linux下用shell脚本删除mysql记录数量比较多的表。