Future-Completable RPC Call

Thanks Phil.

Some notes for my future self and others:

  1. To push to a designer/client from the gateway, add a notification to the session received from the RPC call using:
session.addNotification(...)
  1. To listen for this notification in the designer/client, you first need a GatewayConnection object. Don't make a new connection, get one from the GatewayConnectionManager.
new DesignerGatewayConnection(context.getLaunchContext()) # incorrect
GatewayConnectionManager.getInstance() # correct
  1. In the designer/client, add a push notification listener to the GatewayConnection to handle the notification:
GatewayConnection connection = GatewayConnectionManager.getInstance();
connection.addPushNotificationListener(...);
connection.removePushNotificationListener(...);
3 Likes