首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何打开Pinterest并链接iOS应用程序来共享一些东西?

如何打开Pinterest并链接iOS应用程序来共享一些东西?
EN

Stack Overflow用户
提问于 2015-08-22 05:54:57
回答 2查看 1.6K关注 0票数 1

我编写了一个iOS应用程序,它需要和LinkedIn来共享一些东西。(如果用户没有安装它,它将是开放的safari和共享发布的东西)。

我试着用一些计划,但没成功。也许无论如何都要做这个。

我发现了一些与Pinterest应用程序共享的URL方案。对我来说很管用:

代码语言:javascript
运行
复制
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。

谢谢,抱歉我的英语不太好。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-08-22 06:01:49

打开Pinterest用户配置文件

代码语言:javascript
运行
复制
- (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!");
        }
    }
}

成立一个利息委员会

代码语言:javascript
运行
复制
- (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

代码语言:javascript
运行
复制
- (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

引脚法

代码语言:javascript
运行
复制
- (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

1https://github.com/pinterest/ios-pdk

PinterestSDK for iOS将允许您使用Pinterest对帐户进行身份验证,并代表经过身份验证的用户提出请求。有关支持的端点的详细信息,访问Pinterest API

票数 2
EN

Stack Overflow用户

发布于 2015-08-24 22:26:24

类似于上面提到的Pinterest SDK的答案,LinkedIn提供了一个本地的iOS SDK,它将促进通过以下方式共享内容。

您可以在这里下载:https://developer.linkedin.com/downloads

这里有更多的文档:https://developer.linkedin.com/docs/share-on-linkedin

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32152865

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档