Custom OneLink generator for Android and iOS.
Project description
OneLink Generator
A Python package for generating platform-specific URLs for Android and iOS with support for custom parameters and fallback URLs.
Installation
You can install the package via pip from PyPI:
pip install onelink
Usage
1. Basic Setup
To generate OneLink-style URLs for Android and iOS, you need to set the App IDs for each platform and any other parameters you want to include.
2. Creating a Custom Link
from onelink.generator import AppLinkGenerator
# Initialize the generator with your custom domain
gen = AppLinkGenerator(base_url="https://yourdomain.com")
# Set the Android and iOS App IDs
gen.set_android_app_id("com.example.android")
gen.set_ios_app_id("123456789")
# Optionally, set fallback URLs (for when the app is not installed)
gen.set_android_fallback_url("https://play.google.com/store/apps/details?id=com.example.android")
gen.set_ios_fallback_url("https://apps.apple.com/us/app/example/id123456789")
# Add custom UTM parameters or any other tracking info
gen.set_custom_param("utm_source", "email", platform="android")
gen.set_custom_param("utm_campaign", "holiday2025", platform="ios")
# Generate platform-specific links
android_link = gen.generate_android_link()
ios_link = gen.generate_ios_link()
# Output the generated links
print("Android Link:", android_link)
print("iOS Link:", ios_link)
Generated Links
Android Link: https://yourdomain.com/android?app_id=com.example.android&utm_source=email&utm_campaign=holiday2025&fallback_url=https://play.google.com/store/apps/details?id=com.example.android
iOS Link: https://yourdomain.com/ios?app_id=123456789&utm_campaign=holiday2025&fallback_url=https://apps.apple.com/us/app/example/id123456789&utm_source=email
Features
- Customizable URLs: Define your own base URL, parameters, and platform-specific links.
- Fallback URL: If the app is not installed, users will be redirected to the App Store or Play Store.
- Custom Parameters: Pass UTM parameters or other query parameters.
- Simple and Extendable: Built with minimal dependencies and easy to extend.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
onelink-0.1.2.tar.gz
(3.2 kB
view details)
File details
Details for the file onelink-0.1.2.tar.gz.
File metadata
- Download URL: onelink-0.1.2.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e9ee8059ffb2b20607e59f92603ffc1e06b9dd146735f25387417d79b7d3cb3
|
|
| MD5 |
b67f53aa1d19d966f91504bbc32b68b7
|
|
| BLAKE2b-256 |
97bc4a21c6000372ea658a4152f64e5881487a527a48711cf1dcc5a2843a7560
|