From 0d97f26b4ec2d036042658a2c51178ee4cb739e4 Mon Sep 17 00:00:00 2001 From: bschmalb-ksta Date: Tue, 11 Aug 2026 09:45:48 +0200 Subject: [PATCH] docs: mark onNativeMessageReady as not invoked since 7.12.0 `SpClient.onNativeMessageReady` is still declared, still documented in NATIVEMESSAGE_GUIDE.md and still described as current on docs.sourcepoint.com, but nothing in the library has invoked it since 7.12.0. Disassembling the published cmplibrary-7.15.10.aar with `javap -p -c` shows exactly eight SpClient callbacks invoked anywhere in the artifact: onSpFinished, onConsentReady, onUIReady, onUIFinished, onNoIntentActivitiesFound, onMessageInactivityTimeout, onError and onAction. onNativeMessageReady is not among them; it survives only as the interface declaration and a Kotlin default-implementation bridge with an empty body. NativeMessageController.sendConsent ships with no implementations. 7.15.13 is identical. In the repository, call sites under cmplibrary/src/main number three at v7.11.2 and zero at v7.12.0 and every tag since, when c6c977ec deleted SpConsentLibImpl.kt as part of the mobile-core integration. Configuration does not reach it either: MessageType has no native variant and fromMessageSubCategory maps NoticeNative to MOBILE, so a property configured for a native message is rendered by SPConsentWebView with no callback and no error. This adds a deprecation notice matching the wording already used on the neighbouring onMessageReady callback, and a note at the top of the guide. It changes no behaviour. --- NATIVEMESSAGE_GUIDE.md | 14 ++++++++++++++ .../java/com/sourcepoint/cmplibrary/SpClient.kt | 7 ++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/NATIVEMESSAGE_GUIDE.md b/NATIVEMESSAGE_GUIDE.md index 32097925c..16408065c 100644 --- a/NATIVEMESSAGE_GUIDE.md +++ b/NATIVEMESSAGE_GUIDE.md @@ -1,4 +1,18 @@ # The Nativemessage + +> **Note: this feature is currently not functional on Android.** +> +> Since **7.12.0**, when the SDK's internals moved to `mobile-core`, nothing in the library +> invokes `SpClient.onNativeMessageReady`. `SpConsentLibImpl` — the only class that called it — +> was removed, and `SpConsentLibMobileCore` renders every message through `SPConsentWebView`. +> `MessageType` has no native variant, so a property configured with a native message is +> rendered as a web message instead, with no callback and no error. +> +> The last release in which the callback was invoked is **7.11.2**. The equivalent iOS API, +> `onSPNativeMessageReady`, is unaffected. +> +> The rest of this guide is kept for reference and for anyone on 7.11.2 or earlier. + ## Table of Contents - [Intro](#intro) - [Configure a property to use with the Nativemessage](#configure-a-property-to-use-with-the-nativemessage) diff --git a/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/SpClient.kt b/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/SpClient.kt index 8b92ee40e..98587f8cb 100644 --- a/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/SpClient.kt +++ b/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/SpClient.kt @@ -14,8 +14,13 @@ interface SpClient { fun onUIReady(view: View) /** - * It is invoked when the message is available to the client App + * It is invoked when the message is available to the client App. + * + * Currently this callback is disabled. Since 7.12.0 every message is rendered through + * `SPConsentWebView`, and no code path in the library reaches this callback. See + * NATIVEMESSAGE_GUIDE.md. */ + @Deprecated("Currently this callback is disabled. Since 7.12.0 the SDK renders every message through SPConsentWebView and no code path reaches this callback. See NATIVEMESSAGE_GUIDE.md.") fun onNativeMessageReady(message: MessageStructure, messageController: NativeMessageController) {} @Deprecated("onMessageReady callback will be removed in favor of onMessageReady(message: MessageStructure, messageController: NativeMessageController). Currently this callback is disabled.")