Skip to main content

Longleding Push Service SDK

Project description

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_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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for longleding-push-service-sdk, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size longleding_push_service_sdk-0.2.1-py3-none-any.whl (27.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size longleding-push-service-sdk-0.2.1.tar.gz (6.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page