Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated readme #41

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 1 addition & 37 deletions .github/workflows/dev-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths-ignore:
- '.github/**'
- 'README.md'
- 'extras/**'
branches: [ "dev" ]

workflow_dispatch:
Expand All @@ -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 }}
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ android {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
curl -H "Content-Type: application/json" ^
-H "Authorization: Bearer <PUSHER-BEAMS-INSTANCE-PRIMARY-KEY>"^
-X POST "https://<PUSHER-BEAMS-INSTANCE-ID>".pushnotifications.pusher.com/publish_api/v1/instances/<PUSHER-BEAMS-INSTANCE-ID>/publishes" ^
-X POST "https://<PUSHER-BEAMS-INSTANCE-ID>.pushnotifications.pusher.com/publish_api/v1/instances/<PUSHER-BEAMS-INSTANCE-ID>/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\"}}}"
Loading