{"id":18806653,"url":"https://github.com/cdivita/oci-fn-push-notification","last_synced_at":"2026-01-08T17:30:15.557Z","repository":{"id":157096003,"uuid":"578541352","full_name":"cdivita/oci-fn-push-notification","owner":"cdivita","description":"An OCI function for sending mobile push notifications","archived":false,"fork":false,"pushed_at":"2023-04-27T07:31:31.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T21:26:51.259Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdivita.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":"2022-12-15T09:53:59.000Z","updated_at":"2022-12-15T10:27:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"5d894c7a-0c6b-4319-bbda-66b502fdbae5","html_url":"https://github.com/cdivita/oci-fn-push-notification","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/cdivita%2Foci-fn-push-notification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdivita%2Foci-fn-push-notification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdivita%2Foci-fn-push-notification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdivita%2Foci-fn-push-notification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdivita","download_url":"https://codeload.github.com/cdivita/oci-fn-push-notification/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239742416,"owners_count":19689309,"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":[],"created_at":"2024-11-07T22:49:15.167Z","updated_at":"2026-01-08T17:30:15.520Z","avatar_url":"https://github.com/cdivita.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fn-push-notifications\nA [Fn Project](https://fnproject.io/) function for sending mobile push notifications through third party integrations.\n\nCurrently, push notifications can be sent to Androind and iOS devices using [Firebase Cloud Messaging (FCM)](https://firebase.google.com/docs/cloud-messaging).\n\n# Requirements\nFor sending push notifications, a [Firebase Admin SDK service account](https://firebase.google.com/docs/admin/setup#set-up-project-and-service-account) is required.\n\nOf course, also an OCI tenancy where deploy the function is required.\n\n# Constraints\nCurrently the most recent [Firebase Admin Go SDK](https://pkg.go.dev/firebase.google.com/go/v4) supported version is [`4.9.0`](https://pkg.go.dev/firebase.google.com/go/v4@v4.9.0), because [Go Fn FDK](https://github.com/fnproject/docs/tree/master/fdks/fdk-go) doesn't support `go` versions `\u003e1.15`.\n\n# Configuration\nThe function supports the following [configuration variables](https://github.com/fnproject/docs/blob/master/fn/develop/configs.md):\n\n|Variable                                    | Description                                                                                                    | Required                                                       | Notes                                                                                                                      |\n|:---                                        |:---                                                                                                            |:---                                                            |:---                                                                                                                        |\n| `GOOGLE_APPLICATION_CREDENTIALS`           | The Firebase Admin SDK service account private key file, in JSON format. The variable should be base64 encoded | If `GOOGLE_APPLICATION_CREDENTIALS_SECRET_ID` is not specified | Configuration variables are stored in plain text, please consider using `GOOGLE_APPLICATION_CREDENTIALS_SECRET_ID` instead |\n| `GOOGLE_APPLICATION_CREDENTIALS_SECRET_ID` | The OCID of the secret that contains the Firebase Admin SDK service account private key file, in JSON format   | If `GOOGLE_APPLICATION_CREDENTIALS` is not specified           |\n\n# The function invocation payload\nThe function payload is a JSON with the following attributes:\n\n|Name             | Description                                             | Notes                                              |\n|:---             |:---                                                     |:---                                                |\n| `recipients`    | The registration tokens of push notification recipients |                                                    |\n| `data`          | A custom set of key-value pairs                         | Only strings are allowed, both for keys and values |\n| `message`       | The message to push to recipients                       |                                                    |\n| `message.title` | The title of the message                                |                                                    |\n| `message.body`  | The body of the message                                 |                                                    |\n\nAn example of function's payload is the following:\n```json\n{\n    \"recipients\": [\n        \"00000000\"\n    ],\n    \"data\": {\n        \"description\": \"Use the data element for sending custom key-value pairs\",\n        \"note\": \"Only strings are allowed, both for keys and values\"\n    },\n    \"message\": {\n        \"title\": \"Hello\",\n        \"body\": \"A message for you !!!\"\n    }\n}\n```\n\n# Running the function\n\n## Prerequisites\n1. Configure [your tenancy](https://docs.cloud.oracle.com/en-us/iaas/Content/Functions/Tasks/functionsconfiguringtenancies.htm) and your [development environment](https://docs.cloud.oracle.com/en-us/iaas/Content/Functions/Tasks/functionsconfiguringclient.htm) to use OCI Functions\n2. A [Firebase Admin SDK service account](https://firebase.google.com/docs/admin/setup#set-up-project-and-service-account)\n\n## Deployment\nFor deploying the function:\n1. Clone the oci-fn-push-notification repo\n   - `git clone https://github.com/cdivita/oci-fn-push-notification.git`\n2. Create the application in OCI Functions\n   - `fn create app \u003capp-name\u003e --annotation oracle.com/oci/subnetIds='[\"\u003csubnet-ocid\u003e\"]'`\n3. Deploy the function\n   - `fn -v deploy --app \u003capp-name\u003e --no-bump`\n4. Configure the function\n   - `fn config function \u003capp-name\u003e fn-push-notification GOOGLE_APPLICATION_CREDENTIALS \u003cFirebase Admin SDK service account private key\u003e`\n\nIf you stored the Google Application Credentials [OCI Vault](https://docs.cloud.oracle.com/en-us/iaas/Content/KeyManagement/Tasks/managingsecrets.htm), the configuration activities are slightly different:\n1. Use `GOOGLE_APPLICATION_CREDENTIALS_SECRET_ID` rather than `GOOGLE_APPLICATION_CREDENTIALS` as configuration variable\n   - `fn config function \u003capp-name\u003e fn-push-notification GOOGLE_APPLICATION_CREDENTIALS_SECRET_ID \u003cThe OCID of your Twilio Auth Token secret\u003e`\n2. Create a dynamic group that includes your function resources. A matching rule that can be used is: `all {resource.type = 'fnfunc'}`\n3. Create a policy for such dynamic group that allows the access to keys resources\n   -  `allow dynamic-group \u003cdynamic-group-name\u003e to read secret-bundles in compartment \u003ckeys-compartment\u003e`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdivita%2Foci-fn-push-notification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdivita%2Foci-fn-push-notification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdivita%2Foci-fn-push-notification/lists"}