Skip to content

Android app to send personalized push notifications, using GCP

Notifications You must be signed in to change notification settings

TurquoiseSpace/notification-box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Notification Box

Visit Count

Description

notification-box is available for android, and published exclusively on github

send custom push notifications to yourself

can be used to send and receive push notfications of events / appointments / reminders / alerts, or for any other purpose you can think of

Releases

  • Stable

notification-box-0.0.3

  • Tag / Tree

0.0.3

Repository

  • Browse

https://github.com/TurquoiseSpace/notification-box

  • Download ZIP

https://github.com/TurquoiseSpace/notification-box/archive/refs/heads/master.zip

Clone

  • HTTPS

    git clone https://github.com/TurquoiseSpace/notification-box.git

  • SSH

    git clone [email protected]:TurquoiseSpace/notification-box.git

  • GitHub CLI

    gh repo clone TurquoiseSpace/notification-box

Usage Instructions

Notification Box - Android App - Initial / One Time Setup

  1. download the apk, directly onto your mobile device, or, onto your laptop / desktop, then copy it onto your mobile device

  2. in your android mobile device, go to settings and enable allow installing apps from external sources

  3. install the apk, in your mobile device

Notification Box - Android - App Icon

  1. open the app with name Firebase Cloud Messaging, having a green Android bot icon

Notification Box - Android - App Home / Main Screen

  1. click on the "LOG TOKEN" button, it will generate the FCM Registration Token, this is a client specific token, which would be used to send the push notifications to this particular android device client app, and is supposed to look something like this

    cuo0-PvyQkO-lL5XsqHDAk:APA91bEmCznZGGnD-huqBrbNBhzyzUgkvMyFQoVJSDf4zYbuUGrghUT0DMSz3eVV2I7tINGJWw88qqS3Mx0rGVzVnRQpqqKbDqKvmEnN9z3aSRPUK4f1JTNoZ7JZ2rA_AFTCSjUhmRhn

indeed it will, be different / unique for you

Notification Box - Android - Log / Generate Token

  1. click on the "COPY TOKEN" button

Notification Box - Android - Copy Token

  1. from your mobile, open an email client whichever you use, like gmail or any other email service, in app or browser, and send yourself this token, on email, so you can access / use it later, from your laptop or desktop

Gmail - Android - Compose / Send Email

Sending Push Notification - Postman

  1. on your desktop or laptop, open your email, in which you had shared your FCM Registration Token, and copy that token

Gmail - Web Browser

  1. open Postman, and paste this FCM registration token in the raw JSON Request Body, as the value of to attribute, the request body would look something like this

    {
    	"to" : "cuo0-PvyQkO-lL5XsqHDAk:APA91bEmCznZGGnD-huqBrbNBhzyzUgkvMyFQoVJSDf4zYbuUGrghUT0DMSz3eVV2I7tINGJWw88qqS3Mx0rGVzVnRQpqqKbDqKvmEnN9z3aSRPUK4f1JTNoZ7JZ2rA_AFTCSjUhmRhn",
    	"data" : {
    		"title" : "testing",
    		"message" : "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
    		"json_key" : "json_value",
    		"array" : [
    			"hola",
    			"amigos",
    			"and",
    			"senoritas"
    		],
    		"object" : {
    			"inner_json_key" : "inner_json_value"
    		}
    	}
    }
    

Postman - Client - Request Body

  1. in the request url, copy paste the below

    https://fcm.googleapis.com/fcm/send

  2. set the HTTP Method as

    POST

  3. in the Request Headers, copy paste the following header

    Authorization:key=AAAAucpu21Y:APA91bEYxJ6XGquZzAxqJnyUYeSwi7ocOWO4iJwi676vXnRXrDn-TazsJmESzQHHv5Dx2OO3HFOk5moxzpvEPCMCv3UA5ZopDnVFBK6lOeE1qWQugDVabmN229DAXd3G7tdul7mmlYpF

Postman - Client - Request Header - Key Value Pair

where the header name is Authorization and the header value is key=AAAAucpu21Y:APA91bEYxJ6XGquZzAxqJnyUYeSwi7ocOWO4iJwi676vXnRXrDn-TazsJmESzQHHv5Dx2OO3HFOk5moxzpvEPCMCv3UA5ZopDnVFBK6lOeE1qWQugDVabmN229DAXd3G7tdul7mmlYpF

the value of this header contains the API Access Key of this project which is registered with the Google Cloud Platform

Postman - Client - Request Header - Bulk Edit

  1. click on Send button, check the response status, must be 200 OK, also check the response body for success count as 1

Postman - Client - Response Status and Body

  1. Voila ! You should have received the Push Notification in your Android Client

Receiving Push Notification - Notification Box - Android App

  1. actual push notification

Notification Box - Android - Push Notification

  1. view the current and all the pervious push notifications, which are persisted, from the android client database, by clicking on a push notification which has arrived, or, by clicking on the bell icon on the home / main screen of the notification-box app

Notification Box - Android - Current and Previous Notifications

when no push notifications are persent in the app database client

Notification Box - Android - No Previous Notifications

Reference Links

https://console.cloud.google.com/

https://guides.github.com/features/mastering-markdown/

Git Commands

  • List All Tags (Local)

    git show-ref --tags

  • List All Tags (Remote)

    git ls-remote --tags origin

  • Delete Tag (Local)

    git tag -d <actual_tag>

    git tag -d 0.0.9

  • Delete Tag (Remote)

    git push origin :<actual_tag>

    git push origin :0.0.9

  • Create Tag (Local)

    git tag <actual_tag>

    git tag 0.0.9

  • Create Tag (Remote)

    git push origin <actual_tag>

    git push origin 0.0.9

Contact Info

[email protected]

Feel free to drop us an email