{"id":20770743,"url":"https://github.com/ably/push-example-android","last_synced_at":"2025-04-03T14:16:02.580Z","repository":{"id":46649361,"uuid":"160889551","full_name":"ably/push-example-android","owner":"ably","description":"A minimal example/test application demonstrating use of Android push functionality","archived":false,"fork":false,"pushed_at":"2022-04-19T14:46:29.000Z","size":184,"stargazers_count":1,"open_issues_count":3,"forks_count":4,"subscribers_count":27,"default_branch":"main","last_synced_at":"2025-02-09T03:06:35.355Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ably.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-08T00:35:34.000Z","updated_at":"2025-01-26T11:30:24.000Z","dependencies_parsed_at":"2022-08-29T14:22:48.045Z","dependency_job_id":null,"html_url":"https://github.com/ably/push-example-android","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/ably%2Fpush-example-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ably%2Fpush-example-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ably%2Fpush-example-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ably%2Fpush-example-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ably","download_url":"https://codeload.github.com/ably/push-example-android/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247014520,"owners_count":20869376,"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-17T12:11:43.089Z","updated_at":"2025-04-03T14:16:02.542Z","avatar_url":"https://github.com/ably.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Ably Android push example\n\nThis is a simple interactive app that exercises the use of the Ably push client API in an Android app.\n\n### Dependencies\n\nThis uses the ably-java library, and is configured to use a pre-release of the 1.1 library including push support.\nThis will be updated to a stable 1.1 release once one is available.\n\n### Interactive actions\n\nSeveral operations can be triggered interactively via the menu. The operations are:\n\n- **Activate push**: this triggers activation of the push system, so the device can be the target of push notifications.\n- **Subscribe to channel**: this subscribes to a realtime channel. The channel name is randomly generated on startup.\nMessages received on the channel are logged to the activity and logcat.\n- **Publish to channel**: this publishes a single message to the realtime channel.\n- **Subscribe to push channel**: this subscribes the device to a channel for push messages.\nPush messages received on the channel are logged to the activity and logcat.\n- **Unsubscribe to push channel**: this unsubscribes from the push channel.\n- **Publish data to push channel**: this publishes a message to the realtime channel containing data in `message.extras.push.data`.\n- **Publish notification to push channel**: this publishes a message to the realtime channel containing data in `message.extras.push.notification`.\n- **Publish notification to push channel from background**: this publishes a message to the realtime channel containing data in `message.extras.push.notification`\nafter exiting the activity. The resulting message is expected to be delivered as a UI notification.\n- **Publish data to push device**: this publishes a message direct to the device as a push target containing data in `payload.data`.\n- **Publish notification to push device**: this publishes a message direct to the device as a push target containing data in `payload.notification`.\n- **Publish notification to push device from background**: this publishes a message direct to the device as a push target containing data in `payload.notification`\nafter exiting the activity. The resulting message is expected to be delivered as a UI notification.\n- **Get local device state**: this reads the current persisted `LocalDevice` state\n- **Reset local device state**: this resets the persisted `LocalDevice` state\n- **Get activation state**: this reads the current persisted activation state machine state\n- **Reset activation state**: this resets the persisted activation state machine state\n\n### End-to-end tests\n\nThere is a menu action to run end-to-end push tests which performs the following, in sequence:\n\n- `pushDirectDataTest()`: publish data directly to the device, and verify receipt;\n- `pushDirectNotificationTest()`: publish a notification directly to the device, and verify receipt;\n- `pushPublishDataTest()`: publish data to the channel, and verify receipt as a push message;\n- `pushPublishNotificaionTest()`: publish a notification to the channel, and verify receipt as a push notification;\n\nOutput is to the activity and logcat.\n\n### Using this app yourself\n\nYou can clone and modify this app and use it to build your own push-enabled app, but in order for that to work you will need to:\n\n- change the package id;\n- re-namespace the code to reflect the package namespace;\n- obtain a Firebase account, and register your app's package id with Firebase;\n- download `google-services.json` and add that to the app directory\n- obtain an Ably API key and configure; see the `BuildConfig` fields in `app/build.gradle`\n- configure the app's Firebase server key as the `fcmKey` in the Ably app\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fably%2Fpush-example-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fably%2Fpush-example-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fably%2Fpush-example-android/lists"}