Get Started 🏁
- Android
- iOS
- React Native
For Android, we currently support Gradle as a dependency manager.
- Add our maven repository to the repositories (where exactly might vary on build configuration language and version).
maven {
url "https://s3-us-west-2.amazonaws.com/si-mobile-sdks/dxa/android"
}
- Add Qualtrics DXA dependency implementation.
dependencies {
implementation "com.qualtrics:dxa:0.+"
...
}
- Sync Gradle either via
Sync NoworFile -> Sync Project with Gradle Files.
Troubleshooting
- In case of any problems with adding a repository or implementation, please refer to the official Android Developer documentation or Gradle documentation.
For iOS, we currently support Swift Package Manager and CocoaPods as dependency managers.
Swift Package Manager
- Open your project with
XCode. Go toFile->Add Packages.... - Search for the package repository url
https://github.com/qualtrics/qualtrics-dxa-ios. - Add
QualtricsDXAto the project.
or add as a package dependency:
- In your
Package.swiftfile, add QualtricsDXA as a dependency:
You can check the latest available version in the Release Notes
dependencies: [
.package(url: "https://github.com/qualtrics/qualtrics-dxa-ios.git", .upToNextMinor(from: "{packageVersion}"))
]
Use .upToNextMinor to take advantage of bug fixes and new features that are non-breaking, ensuring stability as the package progresses.
- Add QualtricsDXA as a dependency to target that depends on the SDK:
targets: [
.target(name: "YourTarget", dependencies: [
.product(name: "QualtricsDXA", package: "qualtrics-dxa-ios")
])
]
For a more detailed installation guide, please refer to the process outlined in the README.
CocoaPods
- Add Qualtrics DXA package to your project.
target 'MyApp' do
pod 'QualtricsDXA'
...
- Install Qualtrics DXA package.
pod install
For React Native, we currently distribute to the npm registry and support both npm and Yarn as dependency managers.
We are using a native platform solution, therefore, it is necessary to perform steps specific to Android and iOS.
- Add Qualtrics DXA package to your project.
npm install dxa-react-native
yarn add dxa-react-native
Android
No additional steps are needed.
iOS
- Ensure you have the correct iOS version (see troubleshooting).
- Update Pods by running the following command in the
ios/folder:
pod install
Expo
For Expo projects, we recommend using development builds with Continuous Native Generation (CNG):
- Install the package and expo build properties plugin:
npm install dxa-react-native
npx expo install expo-build-properties
- Configure the Maven repository in your
app.json:
{
"expo": {
// Disable New Architecture as it's not supported yet
"newArchEnabled": false,
"plugins": [
[
"expo-build-properties",
{
"android": {
"extraMavenRepos": ["https://s3-us-west-2.amazonaws.com/si-mobile-sdks/dxa/android"]
}
}
]
]
}
}
- Run prebuild to generate native directories:
npx expo prebuild
Troubleshooting
If you experience issues with React Native, refer to the platform-specific documentation below for guidance.
Android
-
For older versions of React Native, such as
0.68, additional setup steps might be required to ensure DXA, SDK, and dependency versions are compatible. See the guide below for details.[Open Guide]
-
In your project-level
android/build.gradlefile, make sure you have:buildscript {
ext {
// Have at least these versions.
buildToolsVersion = "34.0.0"
minSdkVersion = 24
compileSdkVersion = 34
targetSdkVersion = 34
kotlin_version = "1.9.0"
// ...
}
dependencies {
// Add this dependency.
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
// ...
}
}
allprojects {
repositories {
// Add this configuration.
configurations.all {
resolutionStrategy {
force("com.squareup.retrofit2:retrofit:2.9.0")
force("com.squareup.retrofit2:converter-gson:2.9.0")
}
}
// ...
}
} -
In your app-level
android/app/build.gradlefile, ensure you include:repositories {
// Add this repository.
maven {
url "https://s3-us-west-2.amazonaws.com/si-mobile-sdks/dxa/android"
}
// ...
}
dependencies {
// Add these dependencies.
implementation ("org.jetbrains:annotations:16.0.2")
implementation ("androidx.fragment:fragment:1.5.+") {
force = true
}
// ...
} -
Add the following code to
MainApplication.java.// ...
// Add these imports.
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import androidx.annotation.Nullable;
class MainApplication {
// Override this method.
@Override
public Intent registerReceiver(@Nullable BroadcastReceiver receiver, IntentFilter filter) {
if (Build.VERSION.SDK_INT >= 34 && getApplicationInfo().targetSdkVersion >= 34) {
return super.registerReceiver(receiver, filter, Context.RECEIVER_EXPORTED);
} else {
return super.registerReceiver(receiver, filter);
}
}
// ...
}
-
-
If you encounter problems with cached dependencies, try running the following command inside the
android/folder:./gradlew build --refresh-dependencies
iOS
-
Qualtrics DXA supports
iOS 13.0and later. If you're targeting earlier versions, update your iOS version to13.0in the project settings by opening theios/folder in Xcode and modifying<YourProject>.xcodeproj, then update theios/Podfileto:platform :ios, '13.0' -
To ensure you're using the latest version of our Native iOS SDK dependency, run the following command in the
ios/folder:pod updateAfterward, update the Pods by running this command in the same folder:
pod install -
For older versions of React Native you might need to add
QualtricsDXAdependency to theios/Podfile:pod 'QualtricsDXA', '~> 0.4.0'