It's important to upgrade your projects to use the latest version of the Facebook SDK. This topic provides the steps to do so.
Before you upgrade to a new version of the Facebook SDK, you should review the Changelog on GitHub. This will help you understand any changes that you will need to make in your code as the result of an upgrade.
Note: If you are upgrading to version 9.0.0 or later, the
autoInitEnabledoption has been removed from the SDK. You must initialize the SDK explicitly with the
initializeSDKmethod or implicitly by calling it in
applicationDidFinishLaunching. For more information, see the 9.0.0 section of the Changelog.
If your app is using SPM to integrate with the Facebook SDK for iOS, follow these steps.
Note that the quickstart in the preceding link instructs you to select Up to Next Major Version for the Version option, meaning the tool will not automatically update past the major version you specified. (if you select 8.x.x, it won’t upgrade to a major version 9.x.x). This helps prevent an update to a version that is incompatible with the current package you are using.
If the version update is incremental (minor or patch version is incremented)
In Xcode, click File > Swift Packages > Update to Latest Package Versions.
The following image shows an example:
Before you upgrade the major version, make sure and check the changelogs. If the version update is a major version change, you may need to change the package settings.
If your app integrates with the Facebook SDK for iOS using Cocoapods, follow these steps.
Check if pods are out of date. The following command will list the pods that are out of date.
Update the pods that are out of date with the following command.
pod update [PODNAME]
Note that CocoaPods will try to find an updated version of the pod specified by [PODNAME], and it will update the pod to the latest version possible following any version restrictions in your Podfile. If you have version restrictions, you may need to modify those to upgrade between major versions.
When you have finished upgrading the target SDKs, recompile and fix any resulting issues. Typically you should only see issues when you upgrade to a new major version.
Make sure and consult the Changelog on GitHub to understand any compile issues you might encounter.
If you want to upgrade to a new version of Graph API, you can use the Upgrade Tool to assess the changes you will need to make to your app. You can also review the Graph API Changelog.