Connections
Permit connections
Allows incoming messages from specified identities.
@client.messaging.permit_connection "1234567890"
err := selfsdk.MessagingService().PermitConnection("1234567890")
let success = await sdk.messaging().permitConnection("1234567890")
Permitting incomming connections only applies if you don’t have a global connection (*) permission. If you do, you have to revoke it first.
Permit global connections
You can permit connections from everyone using an “*”.
@client.messaging.permit_connection "*"
err := selfsdk.MessagingService().PermitConnection("*")
let success = await sdk.messaging().permitConnection("*")
Revoke specific connection
You can also revoke connections from a specific self identifier with:
@client.messaging.revoke_connection "1234567890"
err := client.MessagingService().RevokeConnection("1234567890")
let success = await sdk.messaging().revokeConnection("1234567890")
Revoking a connection only applies if you don’t have a global connection (*) permission setup. If you do, you have to revoke it first.
Revoke global connections
Revoke connection permissions from everyone using an “*”.
@client.messaging.revoke_connection "*"
err := client.MessagingService().RevokeConnection("*")
let success = await sdk.messaging().revokeConnection("*")
Listing connections
You can list your app allowed connections.
@client.messaging.allowed_connections.each do |self_id|
p "- '#{self_id}'"
end
connections, _ := client.MessagingService().ListConnections()
log.Println("connected to:", connections)
conns = await sdk.messaging().allowedConnections()
sdk.logger.info(` - connections : ${conns.join(",")}`)