InvergeDocs
PythonAPI reference

Push

Push notifications — transactional sends to users, segments or filters.

// access
client.push

Push notifications — transactional sends to users, segments or filters.

Campaigns, provider credentials, segments and templates live in the console; this resource is for one-off, event-driven sends from your backend. Delivered over FCM / APNs / Web Push.

Push

class

client.push

Extends Resource.

View source

notification()

method
def notification() -> PushBuilder

Start a fluent notification — the recommended way to send.

Returns PushBuilder

View source

send()

method
def send(distinct_ids, message=None, *, title=None, body=None, image_url=None, data=None, options=None) -> Dict[str, Any]

Send to specific users across every device each has registered.

client.push.send(["user_1", "user_2"], title="Welcome 👋")
client.push.send(["user_1"], {"title": "Hi", "data": {"screen": "/home"}})

Parameters

Prop

Type

Returns Dict[str, Any]

View source

send_to_user()

method
def send_to_user(distinct_id, message=None, **kwargs) -> Dict[str, Any]

Send to one user.

Parameters

Prop

Type

Returns Dict[str, Any]

View source

send_to_segments()

method
def send_to_segments(segment_ids, message=None, **kwargs) -> Dict[str, Any]

Send to the union of saved segments.

Parameters

Prop

Type

Returns Dict[str, Any]

View source

send_raw()

method
def send_raw(payload) -> Dict[str, Any]

Send a fully assembled payload (what the builder calls).

Returns {sent, failed, recipients}.

Parameters

Prop

Type

Returns Dict[str, Any]

View source

register_token()

method
def register_token(token, platform, *, provider=None, distinct_id=None, device_key=None, app_version=None, os_type=None, os_version=None, lang=None, tags=None) -> Dict[str, Any]

Register or refresh a device token.

The client SDKs normally do this; it's here for server-driven and bring-your-own-token flows. platform is ios | android | web.

Parameters

Prop

Type

Returns Dict[str, Any]

View source

unregister()

method
def unregister(token) -> Dict[str, Any]

Stop delivering to a token (logout, uninstall).

Parameters

Prop

Type

Returns Dict[str, Any]

View source

opened()

method
def opened(notification_id, **options) -> Dict[str, Any]

Record that a notification was opened (delivery analytics).

Parameters

Prop

Type

Returns Dict[str, Any]

View source

On this page