Beispiel #1
0
from src import push_admin
import json
from src.push_admin import messaging
from examples import push_env

notification = messaging.Notification(title='sample title',
                                      body='sample message body')

android_notification = messaging.AndroidNotification(
    icon='/raw/ic_launcher2',
    color='#AACCDD',
    sound='/raw/shake',
    default_sound=True,
    tag='tagBoom',
    click_action=messaging.AndroidClickAction(action_type=2,
                                              url="https://www.huawei.com"),
    body_loc_key='M.String.body',
    body_loc_args=('boy', 'dog'),
    title_loc_key='M.String.title',
    title_loc_args=["Girl", "Cat"],
    channel_id='Your Channel ID',
    notify_summary='some summary',
    multi_lang_key={
        "title_key": {
            "en": "value1"
        },
        "body_key": {
            "en": "value2"
        }
    },
    style=1,
from src.push_admin import messaging


notification = messaging.Notification(
    title='sample title',
    body='sample message body'
)

android_notification = messaging.AndroidNotification(
    icon='/raw/ic_launcher2',
    color='#AACCDD',
    sound='/raw/shake',
    default_sound=True,
    tag='tagBoom',
    click_action=messaging.AndroidClickAction(
        action_type=1,
        intent="intent://com.huawei.codelabpush/deeplink?#Intent;scheme=pushscheme;launchFlags=0x4000000;i.age=180;S.name=abc;end"),
    body_loc_key='M.String.body',
    body_loc_args=('boy', 'dog'),
    title_loc_key='M.String.title',
    title_loc_args=["Girl", "Cat"],
    channel_id='Your Channel ID',
    notify_summary='some summary',
    multi_lang_key={"title_key": {"en": "value1"}, "body_key": {"en": "value2"}},
    style=1,
    big_title='Big Boom Title',
    big_body='Big Boom Body',
    auto_clear=86400000,
    notify_id=486,
    group='Group1',
    importance=messaging.AndroidNotification.PRIORITY_HIGH,