From 04248dee7cfacffc456f4afe974dd88ae9887baf Mon Sep 17 00:00:00 2001 From: Syed Ahmed Jamil - Local Date: Fri, 2 Feb 2024 15:15:44 +0500 Subject: [PATCH] updated readme --- .github/workflows/dev-push.yml | 38 +------------------ README.md | 31 +++++++++++++++ app/build.gradle.kts | 1 + ...curl.bat => payload_sample_using_curl.bat} | 2 +- 4 files changed, 34 insertions(+), 38 deletions(-) rename extras/{payload sample using curl.bat => payload_sample_using_curl.bat} (83%) diff --git a/.github/workflows/dev-push.yml b/.github/workflows/dev-push.yml index f845953..056d47e 100644 --- a/.github/workflows/dev-push.yml +++ b/.github/workflows/dev-push.yml @@ -5,6 +5,7 @@ on: paths-ignore: - '.github/**' - 'README.md' + - 'extras/**' branches: [ "dev" ] workflow_dispatch: @@ -27,25 +28,6 @@ jobs: with: cache-read-only: false - - name: AVD cache - uses: actions/cache@v3 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-29 - - - name: create AVD and generate snapshot for caching - if: steps.avd-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: 29 - force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: false - script: echo "Generated AVD snapshot for caching." - - name: Get Google Services Json env: CERTIFICATE_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON }} @@ -78,15 +60,6 @@ jobs: uses: ./.github/actions/setup-jdk-gradle with: cache-read-only: true - - - name: AVD cache - uses: actions/cache/restore@v3 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-29 - name: Get Google Services Json env: @@ -126,15 +99,6 @@ jobs: uses: ./.github/actions/setup-jdk-gradle with: cache-read-only: true - - - name: AVD cache - uses: actions/cache/restore@v3 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-29 - name: Get Google Services Json env: diff --git a/README.md b/README.md index f54bd72..70e6f0e 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,37 @@ Project contains: # Note This is an updated version of the old app. To see the old version, navigate to this [commit](https://github.com/syedahmedjamil/pushier/commit/ea7f30f8890fba63ff5571d64c3dffbe08dd9bfd) and click on "Browse Files". +# Before building the app +1. configure fcm https://pusher.com/docs/beams/getting-started/android/configure-fcm/?ref=docs-index#open-firebase-console +2. make sure when creating app in firebase the **"Android package name"** is same as you set in **build.grade** `applicationId` +3. paste your fcm server key in your pusher beams instance "Settings" page under "Google FCM Integration" field +4. download and store your `google-services.json` file in the app folder + +# Payload Sample +> NOTE: your interest name has to be present in the `interests` array as well as in `fcm.data.interest` as shown below for it to work properly. +```json +{ + "interests": [ + "reddit" + ], + "fcm": { + "data": { + "interest": "reddit", + "category": "Important", + "date": "1/1/2022", + "title": "How to optimise text size on lower dpi devices", + "body": "In XML, is there any other way than defining new layouts files for different dpi devices just to handle text sizes as it completely messes up the entire layout if not handled properly?", + "subtext": "r/androiddev", + "link": "https://www.reddit.com/r/androiddev/comments/13a3p1c/how_to_optimise_text_size_on_lower_dpi_devices", + "image": "https://media.glassdoor.com/sql/796358/reddit-squarelogo-1490630845152.png" + } + } +} +``` +Sample using `curl` is located under `extras/payload_sample_using_curl.bat` + +To use this sample you will need `PUSHER-BEAMS-INSTANCE-PRIMARY-KEY` and `PUSHER-BEAMS-INSTANCE-ID` both of which can be found by going to the "Keys" page of your pusher beams instance. + # Demo (new) ![](https://github.com/syedahmedjamil/pushier/blob/main/extras/demo_new.gif) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9b5aa57..10d1d04 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -79,6 +79,7 @@ android { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } + kotlinOptions { jvmTarget = "1.8" } diff --git a/extras/payload sample using curl.bat b/extras/payload_sample_using_curl.bat similarity index 83% rename from extras/payload sample using curl.bat rename to extras/payload_sample_using_curl.bat index 4a7871e..8cb220c 100644 --- a/extras/payload sample using curl.bat +++ b/extras/payload_sample_using_curl.bat @@ -1,4 +1,4 @@ curl -H "Content-Type: application/json" ^ -H "Authorization: Bearer "^ - -X POST "https://".pushnotifications.pusher.com/publish_api/v1/instances//publishes" ^ + -X POST "https://.pushnotifications.pusher.com/publish_api/v1/instances//publishes" ^ -d "{\"interests\":[\"reddit\"],\"fcm\":{\"data\":{\"interest\":\"reddit\", \"category\":\"Important\", \"date\":\"1/1/2022\", \"title\":\"How to optimise text size on lower dpi devices\", \"body\":\"In XML, is there any other way than defining new layouts files for different dpi devices just to handle text sizes as it completely messes up the entire layout if not handled properly?\", \"subtext\":\"r/androiddev\", \"link\":\"https://www.reddit.com/r/androiddev/comments/13a3p1c/how_to_optimise_text_size_on_lower_dpi_devices\", \"image\":\"https://media.glassdoor.com/sql/796358/reddit-squarelogo-1490630845152.png\"}}}"