我编写了一个iOS应用程序,它需要和LinkedIn来共享一些东西。(如果用户没有安装它,它将是开放的safari和共享发布的东西)。
我试着用一些计划,但没成功。也许无论如何都要做这个。
我发现了一些与Pinterest应用程序共享的URL方案。对我来说很管用:
NSString *sharingURL = [[NSString stringWithFormat:@"pinterestsdk.v1://pinit/?client_id=%@&source_url=%@&image_url=%@&app_name=%@&suggested_board_name=%@&description=%@",@"xxxxxxx", @"shareurl.com", @"shareurl.com/shareMedia.png", @"Your_App_Name", @"Board_Name", @"Your_Description"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
if([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:sharingURL]])
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:sharingURL]];
}使用LinkedIn,我研究一个最好的解决方案。
哦,也许可以和LinkedIn应用分享,当你在Safari浏览上按下share时,它可以选择LinkedIn,而且它可以在没有登录的情况下工作(safari以前没有在LinkedIn中签名,只有LinkedIn应用程序)。但是LinkedIn的SDK只支持REST。
谢谢,抱歉我的英语不太好。
发布于 2015-08-22 06:01:49
打开Pinterest用户配置文件
- (IBAction)openPinterestUser:(id)sender {
// open the Pinterest App if available
if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"pinterest://user/juliav1"]]) {
// opening the app didn't work - let's open Safari
if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.pinterest.com/versluis2000/"]]) {
// nothing works - perhaps we're not online
NSLog(@"Dang!");
}
}
}成立一个利息委员会
- (IBAction)openPinterestBoard:(id)sender {
// open the Pinterest App if available
if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"pinterest://board/versluis2000/ios-projects"]]) {
// opening the app didn't work - let's open Safari
if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.pinterest.com/versluis2000/ios-projects/"]]) {
// nothing works - perhaps we're not online
NSLog(@"Dang!");
}
}
}打开Pinterest Pin
- (IBAction)openPinterestPin:(id)sender {
// open the Pinterest App if available
if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"pinterest://pin/76279787413881109"]]) {
// opening the app didn't work - let's open Safari
if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.pinterest.com/pin/76279787413881109/"]]) {
// nothing works - perhaps we're not online
NSLog(@"Dang!");
}
}
}使用Pintrest SDK
引脚法
- (void)getPinWithIdentifier:(NSString *)pinId
fields:(NSSet *)fields
withSuccess:(PDKClientSuccess)successBlock
andFailure:(PDKClientFailure)failureBlock;
- (void)createPinWithImageURL:(NSURL *)imageURL
link:(NSURL *)link
onBoard:(NSString *)boardId
description:(NSString *)pinDescription
withSuccess:(PDKClientSuccess)successBlock
andFailure:(PDKClientFailure)failureBlock;
- (void)createPinWithImage:(UIImage *)image
link:(NSURL *)link
onBoard:(NSString *)boardId
description:(NSString *)pinDescription
progress:(PDKPinUploadProgress)progressBlock
withSuccess:(PDKClientSuccess)successBlock
andFailure:(PDKClientFailure)failureBlock;下面是Pintrest IOS SDK链接pinterest/ios-pdk
PinterestSDK for iOS将允许您使用Pinterest对帐户进行身份验证,并代表经过身份验证的用户提出请求。有关支持的端点的详细信息,访问Pinterest API。
发布于 2015-08-24 22:26:24
类似于上面提到的Pinterest SDK的答案,LinkedIn提供了一个本地的iOS SDK,它将促进通过以下方式共享内容。
您可以在这里下载:https://developer.linkedin.com/downloads
这里有更多的文档:https://developer.linkedin.com/docs/share-on-linkedin
https://stackoverflow.com/questions/32152865
复制相似问题