Skip to content

Service Notify Mobile Actions: What is the data structure? #602

Answered by ALERTua
ALEXTHENINJA007 asked this question in Q&A
Discussion options

You must be logged in to vote

your first variant is right, but you messed up the syntax. my advice is to use dictionaries with keywords instead of strings
in Python these are equal

{'key': 'value', 'key2': 'value2'}

dict(key='value', key2='value2')

but the second variant is more easily readable and comes with less typos
the signature of notify.x method is

def mobile_XXXXXXX(message: str, title: str = '', target=None, data=None):

so your answer is (with my advice in mind)

notify.mobile_XXXXXXXX(
    message="actiontest", 
    data=dict(
        actions=[
            dict(action="Test", title="sometitle")
        ]
    )
)

or without the spacing

notify.mobile_XXXXXXXX(message="actiontest", data=dict(actions=[dict(action=

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@stevius10
Comment options

Answer selected by ALEXTHENINJA007
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants