Skip to main content

Longleding Push Service SDK

Supported Python Versions

Python >= 3.6

Installation

longleding-push-service-sdk is available for Linux, macOS, and Windows.

$ pip install longleding-push-service-sdk

Basic Usage

# -*- coding: utf-8 -*-
from sdk import push_service

push_service_endpoint = "localhost:80"
source_name = "demo"

push_service.init_service(endpoint=push_service_endpoint, source=source_name)


def send_sms_register_code():
    push_service.send_sms_register_code("xxxxxxxxxxx", "xxxxxx")


def send_sms_login_code():
    push_service.send_sms_login_code("xxxxxxxxxxx", "xxxxxx")


def send_sms_change_password_code():
    push_service.send_sms_change_password_code("xxxxxxxxxxx", "xxxxxx")


def send_sms_follow_up_login_code():
    push_service.send_sms_follow_up_login_code("xxxxxxxxxxx", "xxxxxx")


def send_sms_follow_up_login_notification():
    push_service.send_sms_follow_up_login_notification("xxxxxxxxxxx", "xxx", "xxx", "xxxxxxx")


def send_sms_follow_up_login_notification_wechat():
    push_service.send_sms_follow_up_login_notification_wechat("xxxxxxxxxxx", "xxx", "xxx", "xxxxxxx", "xxxxxxx")


def send_sms_general_verification_code():
    push_service.send_sms_general_verification_code("xxxxxxxxxxx", "xxxxxx")


def send_email_register_code():
    push_service.send_email_register_code("xxxxxxxxxxx", "xxxxxx")


def send_email_login_code():
    push_service.send_email_login_code("xxxxxxxxxxx", "xxxxxx")


def send_email_change_password_code():
    push_service.send_email_change_password_code("xxxxxxxxxxx", "xxxxxx")


def send_email_general_verification_code():
    push_service.send_email_general_verification_code("xxxxxxxxxxx", "xxxxxx")


if __name__ == '__main__':
    send_sms_register_code()

Troubleshoot

If you encounter error messages similar to the following:

...
TypeError: Couldn't build proto file into descriptor pool!
Invalid proto descriptor for file "common.proto":
  common.proto: A file with this name is already in the pool.

Setting an environment variable the following before running:

export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION='python'

See also

Release files for longleding-push-service-sdk 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for longleding-push-service-sdk 0.2.2
File Size Uploaded
longleding-push-service-sdk-0.2.2.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for longleding-push-service-sdk 0.2.2
File Interpreter ABI Platform
longleding_push_service_sdk-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 28.2 kB

Release files / longleding-push-service-sdk-0.2.2.tar.gz

Download URL longleding-push-service-sdk-0.2.2.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
155f9d785ee7e044a6e3990cd8cdb8bc2c5f903d4116ea850982b8800e4ddefe
BLAKE2b-256 checksum
How to use checksums
96feb9b781c77297aa4630b6603f6793e2a2bcbdf2286c8e583ac81133a4ec6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.0

Release files / longleding_push_service_sdk-0.2.2-py3-none-any.whl

Download URL longleding_push_service_sdk-0.2.2-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ae047667bf0807ee1192415aea29e73cde897f301a28a7a8ecbbb08a19b3f20
BLAKE2b-256 checksum
How to use checksums
fdc87d8df2fd7499ce8de19a0171b58dbbd3a5928e4c862e48454c53f30e9ff0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.0

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page