How to use the jpush.tag function in jpush

To help you get started, we’ve selected a few jpush examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jpush / jpush-api-python-client / tests / push / test_audience.py View on Github external
def test_audience(self):
        _jpush = jpush.JPush(app_key, master_secret)

        push = _jpush.create_push()
        push.audience = jpush.audience(
            jpush.tag("tag1", "tag2"),
            jpush.alias("alias1", "alias2")
        )
        push.notification = jpush.notification(alert="Hello world with audience!")
        push.platform = jpush.all_
        try:
            response = push.send()
            print response.status_code
            self.assertEqual(response.status_code, 200)
        except common.Unauthorized, e:
            self.assertFalse(isinstance(e, common.Unauthorized))
            raise common.Unauthorized("Unauthorized")
        except common.APIConnectionException, e:
            self.assertFalse(isinstance(e, common.APIConnectionException))
            raise common.APIConnectionException("conn")
        except common.JPushFailure, e:
            self.assertFalse(isinstance(e, common.JPushFailure))
github jpush / jpush-api-python-client / examples / push_example.py View on Github external
def alias():
    push = _jpush.create_push()
    alias=["alias1", "alias2"]
    alias1={"alias": alias}
    print(alias1)
    push.audience = jpush.audience(
        jpush.tag("tag1", "tag2"),
        alias1
    )

    push.notification = jpush.notification(alert="Hello world with audience!")
    push.platform = jpush.all_
    print (push.payload)
    push.send()
github jpush / jpush-api-python-client / examples / push_examples / example_alias.py View on Github external
import jpush as jpush
from conf import app_key, master_secret
_jpush = jpush.JPush(app_key, master_secret)
_jpush.set_logging("DEBUG")
push = _jpush.create_push()
alias=["alias1", "alias2"]
alias1={"alias": alias}
print alias1
push.audience = jpush.audience(
    jpush.tag("tag1", "tag2"),
    alias1
)

push.notification = jpush.notification(alert="Hello world with audience!")
push.platform = jpush.all_
print (push.payload)
push.send()
github jpush / jpush-api-python-client / examples / push_examples / example_audience.py View on Github external
import jpush as jpush
from conf import app_key, master_secret
_jpush = jpush.JPush(app_key, master_secret)
_jpush.set_logging("DEBUG")
push = _jpush.create_push()

push.audience = jpush.audience(
            jpush.tag("tag1", "tag2"),
            jpush.alias("alias1", "alias2")
        )


push.notification = jpush.notification(alert="Hello world with audience!")
push.platform = jpush.all_
print (push.payload)
push.send()
github jpush / jpush-api-python-client / examples / push_example.py View on Github external
def audience():
    push = _jpush.create_push()

    push.audience = jpush.audience(
                jpush.tag("tag1", "tag2"),
                jpush.alias("alias1", "alias2")
            )


    push.notification = jpush.notification(alert="Hello world with audience!")
    push.platform = jpush.all_
    print (push.payload)
    push.send()