FAQ

Frequently asked questions

This page contains frequently asked questions to help you troubleshoot the most common issues.

How to use async methods

Some of our SDK methods leverage the new async/await feature from the Swift language.

You might run into this error in Xcode when using them:

'async' call in a function that does not support concurrency

This error occurs when you’ve tried to call an async function from a synchronous function, which is not allowed in Swift – asynchronous functions must be able to suspend themselves and their callers, and synchronous functions simply don’t know how to do that.

The solution usually is to wrap such calls inside a Task:

Task {
    do {
        try await NablaMessagingClient.shared.retrySending(
          itemWithId: myMessage.id,
          inConversationWithId: conversationId
        )
        print("Message successfully sent")
    } catch {
        print("Error \(error)")
    }
}

For more information, please visit the Swift documentation.

The language used by UI components is not the correct one

Our UI components are using the app's language, if it has been defined by the user in the app's settings of the iOS Settings app, or the device's language, but there are some gotchas:

  • Your app needs to declare the language as supported in the Xcode project
  • You need to make sure the app is configured with the right language on your device

📘

For now, our SDK only supports English and French so if your language isn't one of those it will default to English. Contact us if you have needs for more languages.

Supporting a language in your Xcode project

First, you need to make sure the language you want to display is declared in your project. Follow Apple's documentation to add it.

⚠️

You need to add a file (even empty) in your resources for that language, otherwise Xcode won't take it into account.

Configure your device and app in the correct language

Since iOS 13, you can select a different language on a per application basis so you want to make sure the language for your app is the correct one.

Before doing that, make sure your device is set up to support the language you want:

  • Open the Settings app
  • Scroll down and select General > Language & Region > Add Language.
  • Tap the language to add it.
  • You'll have to choose if you want to change your iPhone to the new language or keep using your current one.

Now that your device is set up correctly, you need to select the right language for your app:

  • Open the Settings app.
  • Scroll down and select the app you want to change.
  • Tap Language.
  • Select the language you want to use.