Adding FullStory as a Swift Package

FullStory for Mobile Apps is available as an add-on for FullStory Business and Enterprise plans. As a result, this add-on is not available on FullStory Free or the FullStory Business trial. Please contact your Account Executive or reach out to our Support team here to learn more.

About this article

This article provides setup steps for adding FullStory as a Swift package.

Swift Installation: adding the FullStory package

Follow these steps to add FullStory to an iOS app using the Swift package:

From the Xcode menu, select File > Add Packages

Swift Add Packages.png

In the dialog that appears, click in the search filed with the text Search of Enter Package URL and type: https://github.com/fullstorydev/fullstory-swift-package-ios

Swift Search.png

The fullstory-swift-package-ios package should then show up in the list of packages. In the input field immediately to the right of the drop-down showing Up to Next Major Version, type the FullStory plugin version number, 1.21.0, as shown here, then click the Add Package button.

Swift Add Package.png

Another dialog will appear titled Choose Package Products for fullstory-swift-package-ios. Ensure that the FullStory entry is checked, and the target under Add to Target is the target within your Xcode project to which you want FullStory added. Click the Add Package button.

Swift Add Package .png

Configure FullStory in your app’s Info.plist file by following the steps here.

Add a build phase for FullStory's asset uploader:

  • In the project navigator, select your app's project.
  • In the editor panel, select your app's target.
  • Choose the Build Phases tab.
  • Chose Editor → Add Build Phase → Add Run Script Build Phase
  • On the new Run Script phase, double-click on the Run Script label and rename to Run FullStory Asset Uploader
  • If it’s not already, re-order the build phase so it’s the last step.
  • Click the disclosure triangle next to the build phase to expand it.
  • Replace the body of the script with the code below (it should all be on one line):
"${BUILD_DIR%Build/*}/SourcePackages/artifacts/FullStory/tools/FullStoryCommandLine" "${CONFIGURATION_BUILD_DIR}/${WRAPPER_NAME}"

The result should look like the following:

Swift Algorithms.png

Troubleshooting

Sometimes, Xcode can get confused about Swift Packages that contain binary artifacts (including FullStory). This is a known issue in Xcode that also appears to affect other major frameworks. A common symptom of this confusion is Xcode producing an error like:

artifact of binary target FullStory failed extraction: The operation couldn’t be completed.  (TSCBasic.StringError error 1.)

If this happens, try some or all of the following steps:

  • Restart Xcode.
  • In Xcode, select File > Swift Packages > Reset Package Caches.  (This option may not be available if you have not already successfully added at least one Swift Package to your project.)
  • Exit Xcode, delete the contents of your project’s DerivedData folder, and restart Xcode.  (You can find the DerivedData folder by selecting Xcode > Preferences..., then selecting Locations and clicking the arrow icon next to the path in "Derived Data.")

Updating to the latest version of the FullStory plugin

Xcode pins package dependencies to specific versions in your project. When you would like to update your app to the latest version of the FullStory plugin, locate the FullStory entry in the Package Dependencies section of the project navigator. Right-click the entry and select Update Package as shown below.

Screen Shot 2021-11-01 at 11.00.38 AM.png

Next Steps

After you’ve completed this setup, return to Getting Started with iOS Recording to configure FullStory, review advanced features, and more.

Need to get in touch with us?

The FullStory Team awaits your every question.

Contact us