{"id":21899360,"url":"https://github.com/satishbabariya/chatter","last_synced_at":"2025-04-15T19:04:07.976Z","repository":{"id":99301728,"uuid":"107779329","full_name":"satishbabariya/Chatter","owner":"satishbabariya","description":"Real time chat app written in Swift 4 using Firebase","archived":false,"fork":false,"pushed_at":"2020-05-23T04:43:34.000Z","size":63695,"stargazers_count":30,"open_issues_count":2,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T19:03:10.595Z","etag":null,"topics":["chat","firebase","firebase-auth","firebase-authentication","firebase-cloud-messaging","firebase-database","firebase-functions","firebase-realtime-database","firebase-storage","ios","swift4"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/satishbabariya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-21T12:46:17.000Z","updated_at":"2022-10-15T21:34:29.000Z","dependencies_parsed_at":"2023-03-22T15:50:19.839Z","dependency_job_id":null,"html_url":"https://github.com/satishbabariya/Chatter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satishbabariya%2FChatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satishbabariya%2FChatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satishbabariya%2FChatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satishbabariya%2FChatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/satishbabariya","download_url":"https://codeload.github.com/satishbabariya/Chatter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249135816,"owners_count":21218365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chat","firebase","firebase-auth","firebase-authentication","firebase-cloud-messaging","firebase-database","firebase-functions","firebase-realtime-database","firebase-storage","ios","swift4"],"created_at":"2024-11-28T14:42:08.883Z","updated_at":"2025-04-15T19:04:07.937Z","avatar_url":"https://github.com/satishbabariya.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chatter\nReal time chat app written in Swift 4 using Firebase\n\n# Push Notifications using Cloud Functions\n\n``` js\n\n// The Cloud Functions for Firebase SDK to create Cloud Functions and setup triggers.\nconst functions = require('firebase-functions');\n\n// The Firebase Admin SDK to access the Firebase Realtime Database.\nconst admin = require('firebase-admin');\nadmin.initializeApp();\n\n\nexports.notification = functions.database\n\t.ref('conversations/{conversationsID}/{messageID}')\n\t.onCreate((snapshot, context) =\u003e {\n\t\tvar sender = snapshot.val().sender;\n\t\tvar receiver = snapshot.val().receiver;\n\t\tvar content = '';\n\n\t\tif (snapshot.val().data.text) {\n\t\t\tcontent = snapshot.val().data.text;\n\t\t}\n\n\t\tconst conversationsID = context.params.conversationsID;\n\t\tconst messageID = context.params.messageID;\n\n\t\tvar topic = receiver.id;\n\n\t\t// Notification details and Payload.\n\t\tconst payload = {\n\t\t\tnotification: {\n\t\t\t\ttitle: sender.displayName,\n\t\t\t\tbody: content,\n\t\t\t\tsound: 'default'\n\t\t\t},\n\t\t\tdata: {\n\t\t\t\tstatusCode: '101',\n\t\t\t\tsenderID: sender.id,\n\t\t\t\tsenderName: sender.displayName,\n\t\t\t\treceiverID: receiver.id,\n\t\t\t\treceiverName: receiver.displayName,\n\t\t\t\tconversationsID: conversationsID,\n\t\t\t\tmessageID: messageID,\n\t\t\t\tcontent: content,\n\t\t\t\tsenderImage: sender.image,\n\t\t\t\treceiverImage: receiver.image,\n\t\t\t\ttype: 'SINGLE'\n\t\t\t}\n\t\t};\n\n\t\tif (snapshot.val().data.photo) {\n\t\t\tpayload.data['image-url'] = snapshot.val().data.photo;\n\t\t\tpayload.data['mediaUrl'] = snapshot.val().data.photo;\n\t\t}\n\n\t\tconst options = {\n\t\t\tpriority: 'high',\n\t\t\ttimeToLive: 60 * 60 * 24\n\t\t};\n\n\t\tif (snapshot.val().data.photo) {\n\t\t\toptions['content_available'] = true;\n\t\t\toptions['mutable_content'] = true;\n\t\t}\n\n\t\treturn admin.messaging().sendToTopic(topic, payload, options);\n\t});\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsatishbabariya%2Fchatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsatishbabariya%2Fchatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsatishbabariya%2Fchatter/lists"}