Firebase

Kubemq firebase target Connector

Kubemq gcp-firebase target connector allows services using kubemq server to access google firebase server.

Prerequisites

The following required to run the gcp-firebase target connector:
  • kubemq cluster
  • gcp-firebase set up
  • kubemq-source deployment

Configuration

firebase target connector configuration properties:
Properties Key
Required
Description
Example
project_id
yes
gcp firebase project_id
"/myproject"
credentials
yes
gcp credentials files
"<google json credentials"
db_client
no
initialize db client if true
true/false
db_url
no
gcp db full path
<google db url"
auth_client
no
initialize auth client if true
true/false
messaging_client
no
initialize messaging client
true/false
defaultmsg
no
default Firebase Cloud Messaging
json
defaultmultimsg
no
default Firebase Cloud MulticastMessage
json
defaultmsg - can be used for common message settings defaultmultimsg - can be used for common message settings
Example:
1
bindings:
2
- name: kubemq-query-gcp-firebase
3
source:
4
kind: kubemq.query
5
name: kubemq-query
6
properties:
7
address: "kubemq-cluster:50000"
8
client_id: "kubemq-query-gcp-firebase-connector"
9
auth_token: ""
10
channel: "query.gcp.firebase"
11
group: ""
12
auto_reconnect: "true"
13
reconnect_interval_seconds: "1"
14
max_reconnects: "0"
15
target:
16
kind: gcp.firebase
17
name: gcp-firebase
18
properties:
19
project_id: "project_id"
20
credentials: 'json'
21
db_client: "true"
22
db_url: "db_url"
23
auth_client: "true"
Copied!

Usage

DB:

Get DB

Get DB metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
method type
get_db
ref_path
yes
ref path for the data
valid string
child_ref
no
path for child ref data
valid string
Example:
1
{
2
"metadata": {
3
"method": "get_db",
4
"ref_path": "string"
5
},
6
"data": null
7
}
Copied!

Set DB

Set DB metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
method type
set_db
ref_path
yes
ref path for the data
valid string
child_ref
no
path for child ref data
valid string
Example:
1
{
2
"metadata": {
3
"method": "get_db",
4
"ref_path": "string"
5
},
6
"data": null
7
}
Copied!

Update DB

Update DB metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
method type
update_db
ref_path
yes
ref path for the data
valid string
child_ref
no
path for child ref data
valid string
Example:
1
{
2
"metadata": {
3
"method": "delete_db",
4
"ref_path": "string"
5
},
6
"data": "updated_string"
7
}
Copied!

Delete DB

Kubemq firebase target Connector

Kubemq gcp-firebase target connector allows services using kubemq server to access google firebase server.

Prerequisites

The following required to run the gcp-firebase target connector:
  • kubemq cluster
  • gcp-firebase set up
  • kubemq-source deployment

Configuration

firebase target connector configuration properties:
Properties Key
Required
Description
Example
project_id
yes
gcp firebase project_id
"/myproject"
credentials
yes
gcp credentials files
"<google json credentials"
db_client
no
initialize db client if true
true/false
db_url
no
gcp db full path
<google db url"
auth_client
no
initialize auth client if true
true/false
messaging_client
no
initialize messaging client
true/false
defaultmsg
no
default Firebase Cloud Messaging
json
defaultmultimsg
no
default Firebase Cloud MulticastMessage
json
defaultmsg - can be used for common message settings defaultmultimsg - can be used for common message settings
Example:
1
bindings:
2
- name: kubemq-query-gcp-firebase
3
source:
4
kind: kubemq.query
5
name: kubemq-query
6
properties:
7
address: "kubemq-cluster:50000"
8
client_id: "kubemq-query-gcp-firebase-connector"
9
auth_token: ""
10
channel: "query.gcp.firebase"
11
group: ""
12
auto_reconnect: "true"
13
reconnect_interval_seconds: "1"
14
max_reconnects: "0"
15
target:
16
kind:gcp.firebase
17
name: gcp-firebase
18
properties:
19
project_id: "project_id"
20
credentials: 'json'
21
db_client: "true"
22
db_url: "db_url"
23
auth_client: "true"
Copied!

Usage

DB:

Get DB

Get DB metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
method type
get_db
ref_path
yes
ref path for the data
valid string
child_ref
no
path for child ref data
valid string
Example:
1
{
2
"metadata": {
3
"method": "get_db",
4
"ref_path": "string"
5
},
6
"data": null
7
}
Copied!

Set DB

Set DB metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
method type
set_db
ref_path
yes
ref path for the data
valid string
child_ref
no
path for child ref data
valid string
Example:
1
{
2
"metadata": {
3
"method": "get_db",
4
"ref_path": "string"
5
},
6
"data": null
7
}
Copied!

Update DB

Update DB metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
method type
update_db
ref_path
yes
ref path for the data
valid string
child_ref
no
path for child ref data
valid string
Example:
1
{
2
"metadata": {
3
"method": "update_db",
4
"ref_path": "string"
5
},
6
"data": "dXBkYXRlIGRiIHN0cmluZw=="
7
}
Copied!

Delete DB

Delete DB metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
method type
delete_db
ref_path
yes
ref path for the data
valid string
child_ref
no
path for child ref data
valid string
Example:
1
{
2
"metadata": {
3
"method": "delete_db",
4
"ref_path": "string"
5
},
6
"data": null
7
}
Copied!

User:

Create User

Create User metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
method type
create_user
Example:
1
{
2
"metadata": {
3
"method": "create_user"
4
},
5
"data": "eyJlbWFpbCI6IkpvaG5AZHVlLmNvbSIsICJwYXNzd29yZCI6MzAsICJkaXNwbGF5X25hbWUiOiJKb2huIn0="
6
}
Copied!

Retrieve User

Retrieve User metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
method type
retrieve_user
retrieve_by
yes
type of retrieval
by_email ,by_uid,by_phone
uid
no
valid unique string
string
phone
no
valid phone number
string
email
no
valid email
string
Example:
1
{
2
"metadata": {
3
"method": "retrieve_user",
4
"retrieve_by": "uid",
5
"uid": "1223131"
6
},
7
"data": null
8
}
Copied!

Delete User

Delete User metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
method type
delete_user
uid
yes
valid unique string
string
Example:
1
{
2
"metadata": {
3
"method": "delete_user",
4
"uid": "1223131"
5
},
6
"data": null
7
}
Copied!

Delete Multiple Users

Delete Multiple Users metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
method type
delete_multiple_users
Example:
1
{
2
"metadata": {
3
"method": "delete_multiple_users"
4
},
5
"data": "WyAidXNlcjEiLCAidXNlcjIiLCAidXNlcjMiIF0="
6
}
Copied!

Update User

Update User metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
method type
update_user
uid
yes
valid unique string
string
Example:
1
{
2
"metadata": {
3
"method": "update_user",
4
"uid": "1223131"
5
},
6
"data": "eyJlbWFpbCI6IkpvaG5AZHVlLmNvbSIsICJwYXNzd29yZCI6MzAsICJkaXNwbGF5X25hbWUiOiJKb2huIn0="
7
}
Copied!

List Users

List User metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
method type
list_users
Example:
1
{
2
"metadata": {
3
"method": "list_users"
4
},
5
"data": null
6
}
Copied!

Token:

Custom Token

Custom Token metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
method type
custom_token
uid
yes
valid unique string
string
Example:
1
{
2
"metadata": {
3
"method": "custom_token",
4
"token_id": "some-uid"
5
},
6
"data": null
7
}
Copied!

Verify Token

Verify Token metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
method type
verify_token
uid
yes
valid unique string
string
Example:
1
{
2
"metadata": {
3
"method": "verify_token",
4
"token_id": "some-uid"
5
},
6
"data": null
7
}
Copied!

Messaging:

Firebase messaging will send a FCM message or send the message to multiple devices.

Send Message

Create User metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
method type
send_message/send_multi
Example: send_message
1
{
2
"metadata": {
3
"method": "send_message"
4
},
5
"data": "ewoiVG9waWMiOiJ0ZXN0IiwKImRhdGEiOiB7ImtleTEiOiJ2YWx1ZTEifQp9"
6
}
7
8
* data value is base64 {
9
"Topic":"test",
10
"data": {"key1":"value1"}
11
}
Copied!
Example: send_multi
1
{
2
"metadata": {
3
"method": "send_multi"
4
},
5
"data": "ewogICAgInRvcGljIjoiYXBwIHRvcGljIiwKICAgICAiZGF0YSI6eyJUb2tlbnMiOlsiMTIzIiwiNDU2Il0sIkRhdGEiOnsia2V5IjoidmFsIn0sIk5vdGlmaWNhdGlvbiI6eyJ0aXRsZSI6InRpdGxlIn19CiB9"
6
}
7
8
* data value is base64 {
9
"topic":"app_topic",
10
"data":{"Tokens":["123","456"],"Data":{"key":"val"},"Notification":{"title":"title"}}
11
}
Copied!
Last modified 11mo ago