Python client for Firebase Dynamic Links API
Project description
firebase-dynamic-link-generator
Simple python client to generate Firebase Dynamic Links. It allows to use a custom domain and fields for generate links for android and ios.
Requirements
- Python >= 3.8
- PIP
- API Key from Firebase console Settings page.
Installation
pip3 install firebase-dynamic-link-generator
Usage
from firebase_dynamic_link_generator import GenerateFirebaseDynamicLink
SERVICE_FILE = 'YOUR_SERVICE_ACCOUNT_JSON_FILE_PATH'
DOMAIN = 'example.page.link' ## need to setup in firebase dynamic link
NAME = "NAME_OF_LINK" ## name of the link
fdl = GenerateFirebaseDynamicLink(DOMAIN, SERVICE_FILE, NAME)
linkinfo_params = {
"androidInfo": {
"androidPackageName": 'PACKAGE_NAME',
"androidFallbackLink": 'FALL_BACK_LINK',
"androidMinPackageVersionCode": '1'
},
}
## for short link
short_link = fdl.generate_dynamic_link('http://google.com', linkinfo_params) #https://example.page.link/h77c
## custom short link
suffix_params = {
"option": "CUSTOM", ## SHORT or UNGUESSABLE
"customSuffix": "CT2213" ## for custom suffix valye
}
short_link = fdl.generate_dynamic_link('http://google.com', linkinfo_params, suffix_params) #https://example.page.link/CT2213
api_key: Key from firebase consoledomain: Domain uri prefix created in firebase console - Dynamic Link. For exampleexample.page.linkor your custom domain.linkinfo_params: Dictionary of optional params. For example:
{
"domainUriPrefix": string,
"link": string,
"androidInfo": {
"androidPackageName": string,
"androidFallbackLink": string,
"androidMinPackageVersionCode": string
},
"iosInfo": {
"iosBundleId": string,
"iosFallbackLink": string,
"iosCustomScheme": string,
"iosIpadFallbackLink": string,
"iosIpadBundleId": string,
"iosAppStoreId": string
},
"navigationInfo": {
"enableForcedRedirect": boolean,
},
"analyticsInfo": {
"googlePlayAnalytics": {
"utmSource": string,
"utmMedium": string,
"utmCampaign": string,
"utmTerm": string,
"utmContent": string
},
"itunesConnectAnalytics": {
"at": string,
"ct": string,
"mt": string,
"pt": string
}
},
"socialMetaTagInfo": {
"socialTitle": string,
"socialDescription": string,
"socialImageLink": string
}
}
suffix_params: Dictionary of optional params. For example:
{
"option": "SHORT" or "UNGUESSABLE" or "CUSTOM",
"customSuffix": string,
}
Reference
https://firebase.google.com/docs/dynamic-links/rest
https://firebase.google.com/docs/reference/dynamic-links/link-shortener
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file firebase_dynamic_link_generator-1.0.1.tar.gz.
File metadata
- Download URL: firebase_dynamic_link_generator-1.0.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d720572bc198f41e5afde82fd2161619007acefec4cd223311cc383bb2c49bfb
|
|
| MD5 |
5062d650b2b928dc8651201b1506d60b
|
|
| BLAKE2b-256 |
a0fdf23e0b2b12bf1db6b7a2727e7461e73003cfd21752db074e39f1e20a9ad0
|