def example_tag2(): """Alternatively you can add a tag by passing values defined by you.""" # Define app_id and secret my_app_id = 'my_app_id' my_secret = 'my_secret' # Create a Pushbots instance pushbots = Pushbots(app_id=my_app_id, secret=my_secret) # Define data data = {'platform': Pushbots.PLATFORM_ANDROID, 'alias': 'alias_to_set_tag', 'tag': 'tag_to_be_added'} code, message = pushbots.tag(data=data) print('Returned code: {0}'.format(code)) print('Returned message: {0}'.format(message))
def example_tag1(): """Add tag by passing values directly to Pushbots.tag()""" # Define app_id and secret my_app_id = 'my_app_id' my_secret = 'my_secret' # Create a Pushbots instance pushbots = Pushbots(app_id=my_app_id, secret=my_secret) # Define alias, tag and platform alias = 'alias_to_set_tag' tag = 'tag_to_be_added' platform = Pushbots.PLATFORM_ANDROID code, message = pushbots.tag(platform=platform, alias=alias, tag=tag) print('Returned code: {0}'.format(code)) print('Returned message: {0}'.format(message))
def example_tag2(): """Alternatively you can add a tag by passing values defined by you.""" # Define app_id and secret my_app_id = 'my_app_id' my_secret = 'my_secret' # Create a Pushbots instance pushbots = Pushbots(app_id=my_app_id, secret=my_secret) # Define data data = { 'platform': Pushbots.PLATFORM_ANDROID, 'alias': 'alias_to_set_tag', 'tag': 'tag_to_be_added' } code, message = pushbots.tag(data=data) print('Returned code: {0}'.format(code)) print('Returned message: {0}'.format(message))