-
Notifications
You must be signed in to change notification settings - Fork 13
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
chore: Implement clickable image through CustomJson (RMCCX-7223) #328
Changes from all commits
aae1aec
fc25245
52bf0af
a08c1a4
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ internal protocol FullViewPresenterType: BaseViewPresenterType { | |
func loadButtons() | ||
func didClickAction(sender: ActionButton) | ||
func didClickExitButton() | ||
func didClickCampaignImage() | ||
} | ||
|
||
internal class FullViewPresenter: BaseViewPresenter, FullViewPresenterType, ErrorReportable { | ||
|
@@ -114,6 +115,18 @@ internal class FullViewPresenter: BaseViewPresenter, FullViewPresenterType, Erro | |
|
||
view?.dismiss() | ||
} | ||
|
||
func didClickCampaignImage() { | ||
guard !campaign.isPushPrimer else { return } | ||
guard let clickImageData = campaign.data.customJson?.clickableImage, | ||
let uriToOpen = URL(string: clickImageData.url ?? "") else { | ||
return | ||
} | ||
logImpression(type: .clickContent) | ||
sendImpressions() | ||
UIApplication.shared.open(uriToOpen) | ||
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. what will happen if uriToOpen is empty string ? 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. Expected behaviour is to do nothing on tap. It will behave as a normal campaign. |
||
view?.dismiss() | ||
} | ||
|
||
// MARK: - Private | ||
|
||
|
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 are making isUserInteractionEnabled = false
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.
By default its false. Its only enabled for RMC-IAM. Rest of the validation is in didClickCampaignImage()