Skip to content

Instantly share code, notes, and snippets.

@bibscy
Last active July 5, 2019 17:02
Show Gist options
  • Select an option

  • Save bibscy/cda5a674861de6a31a55aa420ccd217a to your computer and use it in GitHub Desktop.

Select an option

Save bibscy/cda5a674861de6a31a55aa420ccd217a to your computer and use it in GitHub Desktop.
extension ChatViewController {
struct NotificationInfoChat {
let title: String
let body: String
let chatUID: String
let unreadMessagesCount: Int
let fcmToken: String
let isDevelopment: Bool
func toDictionary() -> [String : Any] {
var someDict = [String : Any]()
someDict["title"] = title
someDict["body"] = body
someDict["chatUID"] = chatUID
someDict["sound"] = "default"
someDict["badge"] = "1"
someDict["unreadMessagesCount"] = unreadMessagesCount
someDict["fcmToken"] = fcmToken
someDict["type"] = "chat"
someDict["createdAt"] = Int(Date().timeIntervalSince1970)
someDict["isDevelopment"] = isDevelopment
return someDict
}
}
}//end extension
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment