Skip to main content

Troubleshooting

Known Issues

Camera Permission for Attachment Flows

The attachment features of SDK X conversations opens the attachment menu. This is Safari's native menu with 3 options as of now, one of which is “Take Photo or Video”. This option requires your app to declare the camera permissions in the Xcode project's Info.plist file generated from Unity. If you don't declare it, and if the user selects this option, your app may crash. This option cannot be hidden as of now. We have it in our roadmap to add the ability to disable this option, though.

To avoid this crash, you need to add the following keys in your Xcode project's Info.plist file.

  • NSPhotoLibraryUsageDescription

  • NSCameraUsageDescription

If your use-case allows you to not ask users to send attachments, you should disable the user attachments configuration on your app's App Settings page on the Admin Dashboard. This will hide the attachment icon altogether from the conversation, and you will not need to add the above-mentioned permissions to Info.plist file. Along with disabling the user attachments configuration, you should also not use the request attachment feature for the Agents.

Note

Attachment features: These features let users send an attachment during a conversation — attachment icon in the reply box and request attachment message by agent.

Unsupported Architectures Found While Submitting App to App Store

Since Unity doesn't support xcframework packaging, we ship our SDK with framework packaging. This requires us to strip non-valid architectures (x86_64 and i386) while creating an archive. We achieve this by adding a Run Script phase named as HS Strip Simulator Slices. It executes strip_frameworks.sh script and removes non-valid architectures (x86_64 and i386) while creating an archive.

Now while submitting the app to App Store if you ran into an issue which states something like - "Unsupported Architectures. The executable for XYZ.app/Frameworks/HelpshiftX.framework contains unsupported architectures '[x86_64/i386]'". This probably means strip_frameworks.sh was not executed or didn't get executed as expected.

  1. First make sure strip_frameworks.sh has executable permission. To find this script, go to directory where Xcode project is created from Unity. Under that directory you will find script under this path Frameworks/Plugins/iOS/HelpshiftX.framework/. You can give executable permission by running command chmod +x strip_framework.sh. Now, archive project and check again, if the issue persists then go to next step.

  2. Replace the contents of strip_frameworks.sh with following -

################################################################################
#
# Copyright 2015 Realm Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

# This script strips all non-valid architectures from dynamic libraries in
# the application's `Frameworks` directory.
#
# The following environment variables are required:
#
# BUILT_PRODUCTS_DIR
# FRAMEWORKS_FOLDER_PATH
# EXPANDED_CODE_SIGN_IDENTITY


# Signs a framework with the provided identity
code_sign() {
# Use the current code_sign_identitiy
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1"
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
}

# Set working directory to product’s embedded frameworks
cd "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}"

if [ "$ACTION" = "install" ]; then
echo "Copy .bcsymbolmap files to .xcarchive"
find . -name '*.bcsymbolmap' -type f -exec mv {} "${CONFIGURATION_BUILD_DIR}" \;
else
# Delete *.bcsymbolmap files from framework bundle unless archiving
find . -name '*.bcsymbolmap' -type f -exec rm -rf "{}" +\;
fi

echo "Stripping frameworks"

declare -a INVALID_ARCHS=("x86_64" "i386")
echo "Invalid archs: ${INVALID_ARCHS[@]}"

for file in $(find . -type f); do
# Skip non-dynamic libraries
if ! [[ "$(file "$file")" == *"dynamically linked shared library"* ]]; then
continue
fi
# Get architectures for current file
archs="$(lipo -info "${file}" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $archs; do
if [[ "(${INVALID_ARCHS[@]})" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$file" "$file" || exit 1
stripped="$stripped $arch"
fi
done
if [[ "$stripped" != "" ]]; then
echo "Stripped $file of architectures:$stripped"
if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then
code_sign "${file}"
fi
fi
done

Now, archive project and check again. This should ideally resolve your issue. We will be updating our script in Helpshift unitypackage with the above changes soon.