I just ran pod update for my app, and now it won't compile, giving these issues from LinkShareContent.swift in FacebookShare.
Cannot assign to property: 'contentDescription' is a get-only property
Cannot assign to property: 'contentTitle' is a get-only property
Cannot assign to property: 'imageURL' is a get-only property
These were the Facebook-related lines in my pod update:
Installing FBSDKCoreKit 4.23.0 (was 4.22.0)
Installing FBSDKLoginKit 4.23.0 (was 4.22.0)
Installing FBSDKShareKit 4.23.0 (was 4.22.0)
Using FacebookCore (0.2.0)
Using FacebookLogin (0.2.0)
Using FacebookShare (0.2.0)
Does anyone know about this problem? Did I do something wrong?
Regarding docs of FBSDKShareLinkContent these properties have been deprecated:
@deprecated
contentDescriptionis deprecated from Graph API 2.9. For more information, see https://developers.facebook.com/docs/apps/changelog#v2_9_deprecations.@deprecated
contentTitleis deprecated from Graph API 2.9. For more information, see https://developers.facebook.com/docs/apps/changelog#v2_9_deprecations@deprecated
imageURLis 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'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With