Displaying No-Codes

First, you need to initialize the SDK. To do this, use the same project key that you use to initialize the Qonversion SDK.

// You can initialize using only project key
let configuration = NoCodesConfiguration(projectKey: "projectKey")
NoCodes.initialize(with: configuration)
// You can initialize using only project key
val noCodesConfig = NoCodesConfig.Builder(this, "projectKey").build()
NoCodes.initialize(noCodesConfig)
// You can initialize using only project key
final NoCodesConfig noCodesConfig = new NoCodesConfig.Builder(this, "projectKey").build();
NoCodes.initialize(noCodesConfig);
// You can initialize using only project key
const noCodesConfig = new NoCodesConfigBuilder('projectKey')
  .build();
NoCodes.initialize(noCodesConfig);
// You can initialize using only project key
final noCodesConfig = new NoCodesConfigBuilder(projectKey).build();
NoCodes.initialize(noCodesConfig);
// You can initialize using only project key
var noCodesConfig = new NoCodesConfigBuilder("projectKey")
    .Build();
NoCodes.Initialize(noCodesConfig);
// You can initialize using only project key
const noCodesConfig = new Qonversion.NoCodesConfigBuilder('projectKey')
  .build();
Qonversion.NoCodes.initialize(noCodesConfig);
// You can initialize using only project key
const noCodesConfig = new NoCodesConfigBuilder('projectKey')
  .build();
NoCodes.initialize(noCodesConfig);

Then you can set the delegates for handling events and customizing screens as follows - (optional):

// The first delegate is used for main events (e.g., screen opened, button tapped).
NoCodes.shared.set(delegate: self)
// The second is for screen customization (if you want to override default styles).
NoCodes.shared.set(screenCustomizationDelegate: self)

// Delegates can be also passed via the initialization throught the configuration:
let noCodesConfig = NoCodesConfiguration(projectKey: "projectKey", delegate: self, screenCustomizationDelegate: self)
// The first delegate is used for main events (e.g., screen opened, button tapped).
NoCodes.shared.setDelegate(this)
// The second is for screen customization (if you want to override default styles).
NoCodes.shared.setScreenCustomizationDelegate(this)

// Delegates can be also passed via the initialization throught the configuration:
val noCodesConfig = NoCodesConfig.Builder(this, "projectKey")
  .setDelegate(this)
  .setScreenCustomizationDelegate(this)
  .build()
// The first delegate is used for main events (e.g., screen opened, button tapped).
NoCodes.getSharedInstance().setDelegate(this);
// The second is for screen customization (if you want to override default styles).
NoCodes.getSharedInstance().setScreenCustomizationDelegate(this);

// Delegates can be also passed via the initialization throught the configuration:
final NoCodesConfig noCodesConfig = new NoCodesConfig.Builder(this, "projectKey")
  .setDelegate(this)
  .setScreenCustomizationDelegate(this)
  .build();
// Set the listener via the initialization throught the configuration
// It is used for main events (e.g., screen opened, button tapped).
const noCodesConfig = new NoCodesConfigBuilder('projectKey')
  .setNoCodesListener(this)
.build();

// Set presentation style config before showing screen if needed
const screenConfig = new ScreenPresentationConfig(ScreenPresentationStyle.FULL_SCREEN, true);
NoCodes.getSharedInstance().setScreenPresentationConfig(screenConfig, 'yourContextKey');
// Set presentation style config before showing screen if needed
final config = NoCodesPresentationConfig(
    animated: true,
    presentationStyle: NoCodesPresentationStyle.fullScreen,
);

NoCodes.getSharedInstance().setScreenPresentationConfig(config, contextKey: 'yourContextKey');

// Subscribe to separate NoCodes event streams
_screenShownStream = NoCodes.getSharedInstance().screenShownStream.listen((event) {
    // add functionality here
});

_finishedStream = NoCodes.getSharedInstance().finishedStream.listen((event) {
    // add functionality here
});

_actionStartedStream = NoCodes.getSharedInstance().actionStartedStream.listen((event) {
    // add functionality here
});

_actionFailedStream = NoCodes.getSharedInstance().actionFailedStream.listen((event) {
    // add functionality here
});

_actionFinishedStream = NoCodes.getSharedInstance().actionFinishedStream.listen((event) {
    // add functionality here
});

_screenFailedToLoadStream = NoCodes.getSharedInstance().screenFailedToLoadStream.listen((event) {
    // add functionality here
});
// Set the delegate via the initialization through the configuration
// It is used for main events (e.g., screen opened, button tapped).
var noCodesConfig = new NoCodesConfigBuilder("projectKey")
    .SetNoCodesDelegate(this)
    .Build();
NoCodes.Initialize(noCodesConfig);

// Set presentation style config before showing screen if needed
var screenConfig = new ScreenPresentationConfig(ScreenPresentationStyle.FullScreen, true);
NoCodes.GetSharedInstance().SetScreenPresentationConfig(screenConfig, "yourContextKey");
// Set the listener via the initialization throught the configuration
// It is used for main events (e.g., screen opened, button tapped).
const noCodesConfig = new Qonversion.NoCodesConfigBuilder('projectKey')
  .setNoCodesListener(this)
.build();

// Set presentation style config before showing screen if needed
const screenConfig = new Qonversion.ScreenPresentationConfig(Qonversion.ScreenPresentationStyle.FULL_SCREEN, true);
Qonversion.NoCodes.getSharedInstance().setScreenPresentationConfig(screenConfig, 'yourContextKey');
// Set the listener via the initialization throught the configuration
// It is used for main events (e.g., screen opened, button tapped).
const noCodesConfig = new NoCodesConfigBuilder('projectKey')
  .setNoCodesListener(this)
.build();

// Set presentation style config before showing screen if needed
const screenConfig = new ScreenPresentationConfig(ScreenPresentationStyle.FULL_SCREEN, true);
NoCodes.getSharedInstance().setScreenPresentationConfig(screenConfig, 'yourContextKey');

After initializing the SDK, you can move forward and display the No-Codes screen:

NoCodes.shared.showScreen(withContextKey: "yourContextKey")
NoCodes.shared.showScreen("yourContextKey")
NoCodes.getSharedInstance().showScreen("yourContextKey");
NoCodes.getSharedInstance().showScreen('yourContextKey');
NoCodes.getSharedInstance().showScreen('yourContextKey');
NoCodes.GetSharedInstance().ShowScreen("yourContextKey");
Qonversion.NoCodes.getSharedInstance().showScreen('yourContextKey');
NoCodes.getSharedInstance().showScreen('yourContextKey');
📘

If you want to use Qonversion No-Codes with your own purchase infrastructure, see how you can do it in two simple steps.

Delegates

Earlier, we discussed how to set delegates. Now, let's explore their purpose.

Main delegate

The main delegate is needed so that you can receive messages about what is happening during the execution of No-Codes, as well as to provide us with the screen from which to start navigation and display the No-Codes screen. Let's go through this step by step.

🚧

Unity Warning

On Android, when a No-Codes screen is displayed, Unity's game loop is paused because the No-Codes screen runs as a separate Activity on top of Unity's Activity. This means that all delegate events will be delivered with a delay - they will only be received after the No-Codes screen is closed and Unity resumes.

controllerForNavigation (iOS only)
func controllerForNavigation() -> UIViewController?

In this function, you must return a UIViewController from which we will start displaying the No-Codes flow. If you do not provide one, we will take the topmost screen in the current stack.

Screen shown event
func noCodesHasShownScreen(id: String)
fun onScreenShown(screenId: String)
void onScreenShown(String screenId)
onScreenShown: (id: string) => {}
_screenShownStream = NoCodes.getSharedInstance().screenShownStream.listen((event) {
    // add functionality here
});
void OnScreenShown(string contextKey)
onScreenShown: (id: string) => {}
onScreenShown: (id: string) => {}

This function notifies about the display of a screen with a specific identifier

Action execution start event

func noCodesStartsExecuting(action: NoCodesAction)
fun onActionStartedExecuting(action: QAction)
void onActionStartedExecuting(QAction action)
onActionStartedExecuting: (action: NoCodesAction) => {}
_actionStartedStream = NoCodes.getSharedInstance().actionStartedStream.listen((event) {
    // add functionality here
});
void OnActionStarted(NoCodesAction action)
onActionStartedExecuting: (action: Qonversion.NoCodesAction) => {}
onActionStartedExecuting: (action: NoCodesAction) => {}

This function notifies you that executing the action you set up through our dashboard has begun.

Action execution fail event

func noCodesFailedToExecute(action: NoCodesAction, error: Error?)
fun onActionFailedToExecute(action: QAction) {
  // For details look at the `error` property of the action
}
void onActionFailedToExecute(QAction action) {
  // For details look at the `error` property of the action
}
onActionFailedToExecute: (action: NoCodesAction) => {}
_actionFailedStream = NoCodes.getSharedInstance().actionFailedStream.listen((event) {
    // add functionality here
});
void OnActionFailed(NoCodesAction action)
onActionFailedToExecute: (action: Qonversion.NoCodesAction) => {}
onActionFailedToExecute: (action: NoCodesAction) => {}

This function notifies you that executing the action you set up through our dashboard has failed.

Action execution finish event

func noCodesFinishedExecuting(action: NoCodesAction)
fun onActionFinishedExecuting(action: QAction)
void onActionFinishedExecuting(QAction action)
onActionFinishedExecuting: (action: NoCodesAction) => {}
_actionFinishedStream = NoCodes.getSharedInstance().actionFinishedStream.listen((event) {
    // add functionality here
});
void OnActionFinished(NoCodesAction action)
onActionFinishedExecuting: (action: Qonversion.NoCodesAction) => {}
onActionFinishedExecuting: (action: NoCodesAction) => {}

This function notifies you that the action you set up through our dashboard has been executed.

Screen finished event

func noCodesFinished()
fun onFinished()
void onFinished()
onFinished: () => {}
_finishedStream = NoCodes.getSharedInstance().finishedStream.listen((event) {
    // add functionality here
});
void OnFinished(string contextKey)
onFinished: () => {}
onFinished: () => {}

This function notifies that the No-Codes flow has been completed and No-Codes has been finished.

Screen loading failed

func noCodesFailedToLoadScreen(error: Error?)
fun onScreenFailedToLoad(error: NoCodesError)
void onScreenFailedToLoad(NoCodesError error)
onScreenFailedToLoad: (error: NoCodesError) => {}
_screenFailedToLoadStream = NoCodes.getSharedInstance().screenFailedToLoadStream.listen((event) {
    // add functionality here
});
void OnScreenFailedToLoad(NoCodesError error)
onScreenFailedToLoad: (error: Qonversion.NoCodesError) => {}
onScreenFailedToLoad: (error: NoCodesError) => {}

This function is called when No-Codes screen loading has failed.

Localization

By default, No-Code screens automatically detect the device's system language and display the appropriate localization if available. You can override this behavior by setting a custom locale, which takes priority over the automatic system language detection.

The locale should be in standard format (e.g., "en", "en-US", "de", "de-DE"). Pass nil/null to reset to the system default locale.

Setting locale during initialization:

var config = NoCodesConfiguration(
    projectKey: "your_project_key",
    locale: "de-DE"
)
NoCodes.initialize(with: config)
val config = NoCodesConfig.Builder(context, "your_project_key")
    .setLocale("de-DE")
    .build()
NoCodes.initialize(config)
NoCodesConfig config = new NoCodesConfig.Builder(context, "your_project_key")
    .setLocale("de-DE")
    .build();
NoCodes.initialize(config);
const noCodesConfig = new NoCodesConfigBuilder("projectKey")
    .setLocale("de-DE")
    .build();
NoCodes.initialize(noCodesConfig);
final noCodesConfig = NoCodesConfigBuilder("projectKey")
    .setLocale("de-DE")
    .build();
NoCodes.initialize(noCodesConfig);
var noCodesConfig = new NoCodesConfigBuilder("projectKey")
    .SetLocale("de-DE")
    .Build();
NoCodes.Initialize(noCodesConfig);
const noCodesConfig = new Qonversion.NoCodesConfigBuilder("projectKey")
    .setLocale("de-DE")
    .build();
Qonversion.NoCodes.initialize(noCodesConfig);
const noCodesConfig = new NoCodesConfigBuilder("projectKey")
    .setLocale("de-DE")
    .build();
NoCodes.initialize(noCodesConfig);

Setting locale after initialization:

NoCodes.shared.setLocale("fr-FR")
NoCodes.shared.showScreen(withContextKey: "your_context_key")

// Reset to system default
NoCodes.shared.setLocale(nil)
NoCodes.shared.setLocale("fr-FR")
NoCodes.shared.showScreen("your_context_key")

// Reset to system default
NoCodes.shared.setLocale(null)
NoCodes.getSharedInstance().setLocale("fr-FR");
NoCodes.getSharedInstance().showScreen("your_context_key");

// Reset to system default
NoCodes.getSharedInstance().setLocale(null);
NoCodes.getSharedInstance().setLocale("fr-FR");
NoCodes.getSharedInstance().showScreen("yourContextKey");

// Reset to system default
NoCodes.getSharedInstance().setLocale(null);
NoCodes.getSharedInstance().setLocale("fr-FR");
NoCodes.getSharedInstance().showScreen("yourContextKey");

// Reset to system default
NoCodes.getSharedInstance().setLocale(null);
NoCodes.GetSharedInstance().SetLocale("fr-FR");
NoCodes.GetSharedInstance().ShowScreen("yourContextKey");

// Reset to system default
NoCodes.GetSharedInstance().SetLocale(null);
Qonversion.NoCodes.getSharedInstance().setLocale("fr-FR");
Qonversion.NoCodes.getSharedInstance().showScreen("yourContextKey");

// Reset to system default
Qonversion.NoCodes.getSharedInstance().setLocale(null);
NoCodes.getSharedInstance().setLocale("fr-FR");
NoCodes.getSharedInstance().showScreen("yourContextKey");

// Reset to system default
NoCodes.getSharedInstance().setLocale(null);

Screen customization

Use the screen customization delegate to customize the screen opening animation. For example, to enable or disable the animation (iOS only), specify the type of opening: push/popover (iOS only)/full screen. You can also pass a statusBarHidden flag that determines whether to show or hide the status bar when displaying the screen (iOS only).

For example:

func presentationConfigurationForScreen(contextKey: String) -> NoCodesPresentationConfiguration {
  return NoCodesPresentationConfiguration(animated: true, presentationStyle: .push)
}
override fun getPresentationConfigurationForScreen(contextKey: String): QScreenPresentationConfig {
  return QScreenPresentationConfig(QScreenPresentationStyle.Push)
}
@NonNull
@Override
public QScreenPresentationConfig getPresentationConfigurationForScreen(@NonNull String contextKey) {
  return new QScreenPresentationConfig(QScreenPresentationStyle.Push);
}
// Set presentation style config before showing screen if needed
const screenConfig = new ScreenPresentationConfig(ScreenPresentationStyle.FULL_SCREEN, true);

NoCodes.getSharedInstance().setScreenPresentationConfig(screenConfig, 'yourContextKey');
// Set presentation style config before showing screen if needed
final config = NoCodesPresentationConfig(
    animated: true,
    presentationStyle: NoCodesPresentationStyle.fullScreen,
);

NoCodes.getSharedInstance().setScreenPresentationConfig(config, contextKey: 'yourContextKey');
// Set presentation style config before showing screen if needed
var screenConfig = new ScreenPresentationConfig(ScreenPresentationStyle.FullScreen, true);

NoCodes.GetSharedInstance().SetScreenPresentationConfig(screenConfig, "yourContextKey");
// Set presentation style config before showing screen if needed
const screenConfig = new Qonversion.ScreenPresentationConfig(Qonversion.ScreenPresentationStyle.FULL_SCREEN, true);

Qonversion.NoCodes.getSharedInstance().setScreenPresentationConfig(screenConfig, 'yourContextKey');
// Set presentation style config before showing screen if needed
const screenConfig = new ScreenPresentationConfig(ScreenPresentationStyle.FULL_SCREEN, true);

NoCodes.getSharedInstance().setScreenPresentationConfig(screenConfig, 'yourContextKey');