Available for the following Plan types:
Fullstory Enterprise*
Fullstory Advanced*
Fullstory Business*
Fullstory Free
*with the following add-on:
Fullstory for Mobile Apps
Available to the following User roles:
Admin
Architect
Standard
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
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
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.53.0, as shown here, then click the Add Package button.
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.
Configure Fullstory in your app’s Info.plist file by following the steps here.
DO NOT skip the next step or you will see broken assets such as images and fonts in your Session Replays
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):
if [ -d "${BUILD_DIR%Build/*}/SourcePackages/artifacts/FullStory/" ]
then
# XCode 13.2 and older
"${BUILD_DIR%Build/*}/SourcePackages/artifacts/FullStory/tools/FullStoryCommandLine" "${CONFIGURATION_BUILD_DIR}/${WRAPPER_NAME}"
elif [ -d "${BUILD_DIR%Build/*}/SourcePackages/artifacts/fullstory-swift-package-ios/fullstory/tools/" ]
then
# XCode 14.3+
"${BUILD_DIR%Build/*}/SourcePackages/artifacts/fullstory-swift-package-ios/fullstory/tools/FullStoryCommandLine" "${CONFIGURATION_BUILD_DIR}/${WRAPPER_NAME}"
elif [ -d "${BUILD_DIR%Build/*}/SourcePackages/artifacts/fullstory-swift-package-ios/" ]
then
# XCode 13.3 - 14.2
"${BUILD_DIR%Build/*}/SourcePackages/artifacts/fullstory-swift-package-ios/tools/FullStoryCommandLine" "${CONFIGURATION_BUILD_DIR}/${WRAPPER_NAME}"
else
echo "Error: Unable to find FullStoryCommandLine. Please contact support@fullstory.com for assistance."
exit 127
fi
The result should look like the following:
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.
Next Steps
After you’ve completed this setup, return to Getting Started with iOS Capture to configure Fullstory, review advanced features, and more.