-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: state-driven in-app messaging (#815)
Co-authored-by: Shahroz Khan <[email protected]>
- Loading branch information
Showing
48 changed files
with
2,854 additions
and
1,330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
import Foundation | ||
|
||
extension Message { | ||
extension Message: CustomStringConvertible { | ||
// Used for getting details about the Message object for sending to logs. | ||
// | ||
// We are logging the Gist campaign id as delivery id because we call it delivery id on our system. | ||
var describeForLogs: String { | ||
"id: \(messageId), queueId: \(queueId ?? "none"), deliveryId: \(gistProperties.campaignId ?? "none")" | ||
} | ||
|
||
// Provides string representation of Message object with all its properties for debugging purposes. | ||
public var description: String { | ||
"Message(messageId=\(messageId), instanceId=\(instanceId), priority=\(String(describing: priority)), queueId=\(String(describing: queueId)), properties=\(gistProperties))" | ||
} | ||
} | ||
|
||
extension GistProperties: CustomStringConvertible { | ||
// Provides string representation of GistProperties object with all its properties for debugging purposes. | ||
public var description: String { | ||
"GistProperties(routeRule=\(String(describing: routeRule)), elementId=\(String(describing: elementId)), deliveryId=\(String(describing: campaignId)), position=\(position), persistent=\(String(describing: persistent)))" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import CioInternalCommon | ||
import Foundation | ||
|
||
extension Logger { | ||
/// Logs a message with the `[InApp]` tag, appending it to the log message. | ||
/// This method is specific to the In-App module, where all log messages will be prefixed with `[InApp]`. | ||
/// | ||
/// - Parameters: | ||
/// - message: The log message to be displayed. | ||
/// - level: The log level (e.g., `.info`, `.debug`, `.error`). | ||
func logWithModuleTag(_ message: String, level: CioLogLevel) { | ||
let formattedMessage = "[InApp] \(message)" | ||
switch level { | ||
case .info: | ||
info(formattedMessage) | ||
case .debug: | ||
debug(formattedMessage) | ||
case .error: | ||
error(formattedMessage) | ||
case .none: | ||
break | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.