在ios中与Pintrest分享时崩溃

时间:2016-06-24 07:21:53

标签: ios objective-c xcode pinterest

我想在Pintrest上分享一篇文章(即想从我的应用程序中固定)。我使用Cocoa Pod使用了它的SDK。我有时可以固定(共享),但有时固定应用程序会随机崩溃并在崩溃日志中得不到任何内容。

谁能告诉我出了什么问题?我添加了我使用过的代码片段...我使用此链接安装SDK并按照此链接进行操作。 https://github.com/pinterest/ios-pdk

-(IBAction)pintrestButtonTapped
{
    @try
    {
        [PDKClient configureSharedInstanceWithAppId:@"4841203782190640720"];
        [[PDKClient sharedInstance] authenticateWithPermissions:@[PDKClientReadPublicPermissions,
                                                                  PDKClientWritePublicPermissions,
                                                                  PDKClientReadPrivatePermissions,
                                                                  PDKClientWritePrivatePermissions,
                                                                  PDKClientReadRelationshipsPermissions,
                                                                  PDKClientWriteRelationshipsPermissions]
                                                    withSuccess:^(PDKResponseObject *responseObject)
         {

             [PDKPin pinWithImageURL:[NSURL URLWithString:@"https://www.respectnetwork.com/wp-content/uploads/cynja-app_store_share.jpg"]
                                link:[NSURL URLWithString:@"https://itunes.apple.com/us/app/cynjaspace/id1050628761?ls=1&mt=8/"]
                  suggestedBoardName:@"CynzaSpace"
                                note:kSocialMediaSharingText
                         withSuccess:^
              {
                  NSLog(@"Successfully Pinned Up!!");
              }
                          andFailure:^(NSError *error)
              {
                  NSLog(@"UnSuccessfull");
              }];

         }
                                                     andFailure:^(NSError *error)
         {
             NSLog(@"authentication failed: %@", error);
         }];

    }
    @catch (NSException *exception)
    {
        // Print exception information
        NSLog( @"NSException caught" );
        NSLog( @"Name: %@", exception.name);
        NSLog( @"Reason: %@", exception.reason );
        return;
    }
}

0 个答案:

没有答案