BU.MP sdk : Send message to channel / user

159 Views Asked by At

First of all.. what is the difference between the two? Can multiple users be subscribing on the same channel? Second of all, i can send a message across to the other phone i'm bumping with from the code that defines the BroadcastReceiver

else if (action.equals(BumpAPIIntents.CHANNEL_CONFIRMED)) {
                long channelID = intent.getLongExtra("channelID", 0);
                Log.i("Bump Test", "Channel confirmed with " + api.userIDForChannelID(channelID));
                Toast.makeText(getBaseContext(), "Channel confirmed with " + api.userIDForChannelID(channelID), Toast.LENGTH_SHORT).show();
                api.send(channelID, "Hello, world!".getBytes());

AFAIK the session then remains open and I can send subsequent messages. I have no idea how to do that. I really wish the bump api had (better) docs :(

any help will be greatly appreciated.

1

There are 1 best solutions below

0
On

I am not sure of your question "What is the difference between the two"?

Regarding if can multiple users be subscribing on the same channel, from my personal experience I haven't seen this to be possible.

Yes, you can start calling api.send() when you have received the CHANNEL_CONFIRMED broadcast.