-
Notifications
You must be signed in to change notification settings - Fork 11
DIA-5947 implement dismissMessage
#867
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,9 @@ import com.sourcepoint.cmplibrary.exception.UnableToDownloadRenderingApp | |
| import com.sourcepoint.cmplibrary.exception.UnableToLoadRenderingApp | ||
| import com.sourcepoint.cmplibrary.launch | ||
| import com.sourcepoint.cmplibrary.model.ConsentAction | ||
| import com.sourcepoint.cmplibrary.model.exposed.ActionType | ||
| import com.sourcepoint.cmplibrary.model.exposed.ActionType.SHOW_OPTIONS | ||
| import com.sourcepoint.cmplibrary.model.exposed.ActionType.MSG_CANCEL | ||
| import com.sourcepoint.cmplibrary.model.exposed.ActionType.PM_DISMISS | ||
| import com.sourcepoint.cmplibrary.model.exposed.MessageType | ||
| import com.sourcepoint.cmplibrary.model.exposed.MessageType.LEGACY_OTT | ||
| import com.sourcepoint.cmplibrary.model.exposed.MessageType.OTT | ||
|
|
@@ -64,6 +66,8 @@ interface SPMessageUI { | |
| campaignType: CampaignType, | ||
| userData: SPUserData | ||
| ) | ||
|
|
||
| fun dismiss() | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -166,7 +170,7 @@ class SPConsentWebView( | |
| onAction( | ||
| view = this, | ||
| action = SPConsentAction( | ||
| actionType = if (isFirstLayer) ActionType.MSG_CANCEL else ActionType.PM_DISMISS, | ||
| actionType = if (isFirstLayer) MSG_CANCEL else PM_DISMISS, | ||
| campaignType = campaignType, | ||
| messageId = "" | ||
| ) | ||
|
|
@@ -248,8 +252,8 @@ class SPConsentWebView( | |
| override fun onAction(view: View, action: ConsentAction) = runOnMain { | ||
| messageUIClient.onAction(view, action) | ||
| when (action.actionType) { | ||
| ActionType.SHOW_OPTIONS -> loadPrivacyManagerFrom(action) | ||
| ActionType.PM_DISMISS -> returnToFirstLayer() | ||
| SHOW_OPTIONS -> loadPrivacyManagerFrom(action) | ||
| PM_DISMISS -> returnToFirstLayer() | ||
| else -> { | ||
| finished(view) | ||
| } | ||
|
|
@@ -295,6 +299,17 @@ class SPConsentWebView( | |
| null | ||
| ) | ||
|
|
||
| override fun dismiss() { | ||
| onAction( | ||
| view = this, | ||
| action = SPConsentAction( | ||
| actionType = MSG_CANCEL, | ||
| campaignType = campaignType, | ||
| messageId = "" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @andresilveirah isn't the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a typo. We don't have that information easily available. Since the dismiss doesn't make any network request, it's okay to set it as empty string. |
||
| ) | ||
| ) | ||
| } | ||
|
|
||
| override fun loaded(view: View) = runOnMain { | ||
| evaluateJavascript("""window.spLegislation="${campaignType.name}"""", null) | ||
| if (!isPresenting) { | ||
|
|
||
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.
@andresilveirah why don't we remove it altogether?
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 it's less intrusive if we simply trigger a
dismissaction. The SDK will callonSPUIFinishedand the app should already be prepared to remove the view on that callback. But if we get feedback it's better to remove the view all together, we can do that too.