From 7bb37e3f17542a708a2f4abc5486513a762396d4 Mon Sep 17 00:00:00 2001 From: "tilak.gondi" <115203844+GondiTilak@users.noreply.github.com> Date: Wed, 12 Jul 2023 12:18:31 +0900 Subject: [PATCH 1/2] [MINI-6213] Unable to see alert message when info sent to the host tab (#509) * [MINI-6213] [iOS Demo app] [Universal bridge] Unable to see alert message when info sent to the host tab Fixed the issue - No alert message with the all data is being displayed **LINK** [MINI-6213](https://jira.rakuten-it.com/jira/browse/MINI-6213) * [MINI-6213] [iOS Demo app] [Universal bridge] Unable to see alert message when info sent to the host tab Fixed the issue - swiftlint lint issues. **LINK** [MINI-6213](https://jira.rakuten-it.com/jira/browse/MINI-6213) --- .../SwiftUI/Features/Terms/MiniAppWithTermsView.swift | 4 +++- .../SwiftUI/Features/Terms/MiniAppWithTermsViewModel.swift | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Example/Controllers/SwiftUI/Features/Terms/MiniAppWithTermsView.swift b/Example/Controllers/SwiftUI/Features/Terms/MiniAppWithTermsView.swift index 9007b849..a662be19 100644 --- a/Example/Controllers/SwiftUI/Features/Terms/MiniAppWithTermsView.swift +++ b/Example/Controllers/SwiftUI/Features/Terms/MiniAppWithTermsView.swift @@ -51,13 +51,15 @@ struct MiniAppWithTermsView: View { default: print("No Handler to passs") } - }.alert(Text(viewModel.showJsonString != nil ? "Universal Bridge" : "Info"), isPresented: $showMessageAlert) { + }.alert(Text((viewModel.showJsonString != nil || viewModel.showInfoValue != nil) ? "Universal Bridge" : "Info"), isPresented: $showMessageAlert) { Button("OK") { viewModel.showMessageAlert.send(false) } } message: { if let message = viewModel.showJsonString { Text(message) + } else if let message = viewModel.showInfoValue { + Text("Key: \(message.key ?? "")\nValue: \(message.value ?? "")\nDescription: \(message.description ?? "")") } else { Text("Message sent!") } diff --git a/Example/Controllers/SwiftUI/Features/Terms/MiniAppWithTermsViewModel.swift b/Example/Controllers/SwiftUI/Features/Terms/MiniAppWithTermsViewModel.swift index ef084d1e..a6e9aef2 100644 --- a/Example/Controllers/SwiftUI/Features/Terms/MiniAppWithTermsViewModel.swift +++ b/Example/Controllers/SwiftUI/Features/Terms/MiniAppWithTermsViewModel.swift @@ -58,13 +58,16 @@ class MiniAppWithTermsViewModel: ObservableObject { delegator.onSendMessage = { self.showMessageAlert.send(true) self.showJsonString = nil + self.showInfoValue = nil } delegator.onSendJsonToHostApp = { string in self.showMessageAlert.send(true) self.showJsonString = string + self.showInfoValue = nil } delegator.onSendInfoToHostApp = { info in self.showMessageAlert.send(true) + self.showJsonString = nil self.showInfoValue = info } delegator.onShoudCloseMiniApp = { confirmation in From 658daf54a3a7181159b4ab74b31db516f52901df Mon Sep 17 00:00:00 2001 From: "tilak.gondi" <115203844+GondiTilak@users.noreply.github.com> Date: Wed, 12 Jul 2023 13:07:41 +0900 Subject: [PATCH 2/2] [MINI-6213] [iOS Demo app] [Universal bridge] Unable to see alert message when info sent to the host tab (#510) Fixed the issue - Build failing due to compile time errors. Due to the UniversalBridgeInfoParameters model object parameters being internal. **LINK** [MINI-6213](https://jira.rakuten-it.com/jira/browse/MINI-6213) --- .../Classes/core/Models/MiniAppJavaScriptMessageInfo.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Classes/core/Models/MiniAppJavaScriptMessageInfo.swift b/Sources/Classes/core/Models/MiniAppJavaScriptMessageInfo.swift index 1b771859..a757b2d1 100644 --- a/Sources/Classes/core/Models/MiniAppJavaScriptMessageInfo.swift +++ b/Sources/Classes/core/Models/MiniAppJavaScriptMessageInfo.swift @@ -42,9 +42,9 @@ struct JsonStringInfoParameters: Codable { } public struct UniversalBridgeInfoParameters: Codable { - var key: String? - var value: String? - var description: String? + public var key: String? + public var value: String? + public var description: String? } struct MiniAppCustomPermissionsRequest: Decodable {