Skip to content

Commit

Permalink
Updating spec for android push notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
cnu1439 committed Jun 18, 2023
1 parent 252a003 commit 4757146
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ cp -r destination-webhook your-awesome-connector
# Make necessary changes and build the connector
cd your-awesome-connector
make build_docker
make build_docker version=latest
# Add new connector information to "valmi-app-backend/init_db/connector_def.json"
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ def discover(self, logger: AirbyteLogger, config: json) -> ValmiDestinationCatal

def check(self, logger: AirbyteLogger, config: Mapping[str, Any]) -> AirbyteConnectionStatus:
try:
service_ac_credentials = config["credentials"].get("service_account", {})
service_ac_credentials_str = config["service_account"]
service_ac_credentials = json.loads(service_ac_credentials_str)
creds = credentials.Certificate(service_ac_credentials)
firebase_admin.initialize_app(creds)
return AirbyteConnectionStatus(status=Status.SUCCEEDED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from firebase_admin.exceptions import FirebaseError, RESOURCE_EXHAUSTED, UNAVAILABLE
from airbyte_cdk.models import AirbyteMessage
import time
import json

MAX_CHUNK_SIZE = 500

Expand Down Expand Up @@ -49,7 +50,8 @@ class FCMUtils:
logger = AirbyteLogger()

def __init__(self, config: Mapping[str, Any], run_time_args: RunTimeArgs, *args, **kwargs):
service_ac_credentials = config["credentials"].get("service_account", {})
service_ac_credentials_str = config["service_account"]
service_ac_credentials = json.loads(service_ac_credentials_str)
creds = credentials.Certificate(service_ac_credentials)
self.app = firebase_admin.initialize_app(creds)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
{
{
"documentationUrl": "https://docs.valmi.io/integrations/destinations/android-push-notifications",
"connectionSpecification": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Destination Android Push Notifications",
"type": "object",
"required": ["credentials"],
"additionalProperties": true,
"properties": {
"credentials": {
"type": "object",
"required": ["service_account"],
"additionalProperties": false,
"properties": {
"service_account": {
"title": "Service account",
"type": "string",
"description": "The Service Account of your android application.",
"required": ["service_account"],
"properties": {
"service_account": {
"title": "Service account",
"type": "object",
"description": "The Service Account of your android application.",
"airbyte_secret": false
}
}
"airbyte_secret": false
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"credentials": {
"service_account": {}
}
"service_account": ""
}

0 comments on commit 4757146

Please sign in to comment.