FacebookShare causing compiler error after update

。_饼干妹妹 提交于 2019-12-03 01:08:02
Ilya Ilin

Regarding docs of FBSDKShareLinkContent these properties have been deprecated:

@deprecated contentDescription is deprecated from Graph API 2.9. For more information, see https://developers.facebook.com/docs/apps/changelog#v2_9_deprecations.

@deprecated contentTitle is deprecated from Graph API 2.9. For more information, see https://developers.facebook.com/docs/apps/changelog#v2_9_deprecations

@deprecated imageURL is deprecated from Graph API 2.9. For more information, see https://developers.facebook.com/docs/apps/changelog#v2_9_deprecations

You should probably use quote and contentURL instead of them.

As a temporary solution, you can unblock the file LinkShareContent.swift and directly remove above lines until Facebook releases any update.

I do not think referencing Github user 1amageek's repo with

pod 'FacebookShare', :git => 'https://github.com/1amageek/facebook-sdk-swift'

is a good idea, 1amageek could be the most awesome developer in the world and still delete his/her fork of the Facebook Swift SDKs

Until fixed you should change your Podfile to

pod 'FacebookCore', '~> 0.2'
pod 'FacebookLogin', '~> 0.2'
pod 'FacebookShare', '~> 0.2'
pod 'FBSDKCoreKit', '~> 4.22.1'
pod 'FBSDKLoginKit', '~> 4.22.1'
pod 'FBSDKShareKit', '~> 4.22.1'

And run pod update again.

Note that this code is not adding "duplicate" pods (older FBSDK[Core etc] + newer Facebook[Core etc]), the code is just being completely explicit about the Pods you are installing. If you were to list only pods FacebookCore, FacebookLogin, and FacebookShare, the FBSDKs will be installed by Cocoapods as dependencies anyways.

Reference: https://github.com/facebook/facebook-sdk-swift/issues/157  

Replace your Podfile content with this:

pod 'FacebookCore'
pod 'FacebookLogin'
pod 'FacebookShare', :git => 'https://github.com/1amageek/facebook-sdk-swift'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!