-
Notifications
You must be signed in to change notification settings - Fork 6
Added nocodes functionality and removed automations #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Added nocodes functionality and removed automations #282
Conversation
Runtime/Android/Plugins/com/qonversion/unitywrapper/NoCodesWrapper.java
Outdated
Show resolved
Hide resolved
|
|
||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| { | ||
| if (!(Json.Deserialize(jsonStr) is Dictionary<string, object> screenResult)) | ||
| { | ||
| Debug.LogError("Could not parse NoCodes screen id"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Debug.LogError("Could not parse NoCodes screen id"); | |
| Debug.LogError("Could not parse No-Code Screen id"); |
| case "nocodes_screen_shown": | ||
| case "screen_shown": | ||
| result = NoCodesEventType.ScreenShown; | ||
| break; | ||
| case "nocodes_finished": | ||
| case "finished": | ||
| result = NoCodesEventType.Finished; | ||
| break; | ||
| case "nocodes_action_started": | ||
| case "action_started": | ||
| result = NoCodesEventType.ActionStarted; | ||
| break; | ||
| case "nocodes_action_failed": | ||
| case "action_failed": | ||
| result = NoCodesEventType.ActionFailed; | ||
| break; | ||
| case "nocodes_action_finished": | ||
| case "action_finished": | ||
| result = NoCodesEventType.ActionFinished; | ||
| break; | ||
| case "nocodes_screen_failed_to_load": | ||
| case "screen_failed_to_load": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are keys duplicated? let's syncronize them
| /// <summary> | ||
| /// Event fired when any NoCodes event occurs. | ||
| /// </summary> | ||
| event Action<NoCodesEvent> EventReceived; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it needed, when we have a delegate?
| Task SetScreenPresentationConfig(NoCodesPresentationConfig config, [CanBeNull] string contextKey = null); | ||
|
|
||
| /// <summary> | ||
| /// Shows a NoCodes screen with the specified context key. | ||
| /// </summary> | ||
| /// <param name="contextKey">Context key for the screen to show.</param> | ||
| /// <returns>Task that completes when the screen is shown.</returns> | ||
| Task ShowScreen(string contextKey); | ||
|
|
||
| /// <summary> | ||
| /// Closes the current NoCodes screen. | ||
| /// </summary> | ||
| /// <returns>Task that completes when the screen is closed.</returns> | ||
| Task Close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we use tasks here, not void?
| private const string SdkVersion = "10.0.3"; | ||
| private const string SdkSource = "unity"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like duplication of these constants, let's use the ones from QonversionInternal - either move them somewhere or somehow else
| /// <summary> | ||
| /// Simplified initialization method that only requires a project key. | ||
| /// </summary> | ||
| /// <param name="projectKey">Qonversion project key.</param> | ||
| /// <returns>Initialized instance of the NoCodes SDK.</returns> | ||
| public static INoCodes InitializeWithProjectKey(string projectKey) | ||
| { | ||
| var config = new NoCodesConfig(projectKey); | ||
| return Initialize(config); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need it
| /// <summary> | ||
| /// Builder class for creating NoCodesConfig instances. | ||
| /// </summary> | ||
| public class NoCodesConfigBuilder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is an option to provide a delegate from here?
| /// Sets the delegate for handling NoCodes events. | ||
| /// </summary> | ||
| /// <param name="delegate">Delegate instance for handling NoCodes events.</param> | ||
| public static void SetDelegate(NoCodesDelegate @delegate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There shouldn't be a static method for that; it's set either through initialization via config or using the initialized instance.
| unsigned long len = strlen(unityListener); | ||
| noCodesUnityListenerName = malloc(len + 1); | ||
| strcpy(noCodesUnityListenerName, unityListener); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so strange to see it in 2025 :D
| if (!noCodesSandwich) { | ||
| NSLog(@"Error: NoCodesSandwich not initialized. Call _initializeNoCodes first."); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these checks here and below are extra, as we are responsible for initialization of the sandwich. If it crashes here, we will see the error during the development, but these checks make the code less readable.
…b.com:qonversion/unity-sdk into ssarkisyan/dev-109-unity-add-no-codes-support
No description provided.