             let escapedImageURLString = imageURLString
                 .addingPercentEncoding(withAllowedCharacters: NSCharacterSet.urlQueryAllowed),
             var imageURLComponents = URLComponents(string: escapedImageURLString) else {
-            Logger.error(message: "invalid notification image url")
-            return nil
+                Logger.error(message: "invalid notification image url")
+                return nil
         }
 
         if type == InAppType.Takeover.rawValue {

    let body: String
    let callToAction: String
    let callToActionURL: URL?
}

extension String {
    func appendSuffixBeforeExtension(suffix: String) -> String {
        var newString = suffix
        do {
            let regex = try NSRegularExpression(pattern: "(\\.\\w+$)", options: [])
            newString = regex.stringByReplacingMatches(in: self,
                                                       options: [],
                                                       range: NSRange(location: 0,
                                                                      length: self.characters.count),
                                                       withTemplate: "\(suffix)$1")
        } catch {
            Logger.error(message: "cannot add suffix to URL string")
        }
        return newString
    }
}

extension InAppNotification {
    init?(JSONObject: [String: Any]?) {
        guard let object = JSONObject else {
            Logger.error(message: "notification json object should not be nil")

            return nil
        }

        self.ID                 = ID
        self.messageID          = messageID
        self.type               = type
        self.style              = style
        self.imageURL           = imageURLParsed
        self.title              = title
        self.body               = body
        self.callToAction       = callToAction
        self.callToActionURL    = callToActionURL
    }
}

extension String {
    func appendSuffixBeforeExtension(suffix: String) -> String {
        var newString = suffix
        do {
            let regex = try NSRegularExpression(pattern: "(\\.\\w+$)", options: [])
            newString = regex.stringByReplacingMatches(in: self,
                                                       options: [],
                                                       range: NSRange(location: 0,
                                                                      length: self.characters.count),
                                                       withTemplate: "\(suffix)$1")
        } catch {
            Logger.error(message: "cannot add suffix to URL string")
        }
        return newString
    }
}
