Retrieve Active Users in the Group via Intent

Retrieve Active Users in the Group via Intent

This intent retrieves the active user from the group within the same site or department.

Prerequisites

  • The minimum required PTT Pro for Android version is 3.3.10330 or later.
  • One must register the ACTION_GET_GROUP_USERS_STATUS) status intent specified in the table under the Register Intent section

Intent Definition

Name
Definition
Action
com.symbol.wfc.pttpro.ACTION_GET_GROUP_USERS
Intent Type
broadcast
Extra 0
          Type
String
          Name
group
          Value
If the extra name is group
  • Only one group can be configured.
  • The group name is mandatory.
  • The group name is case-sensitive.
  • Use the group name must be exactly as it is created in the PTT Pro server.
Extra 1
          Type
String
          Name
presence
          Value
If the extra name is presence
  • 0 indicate all presence user
  • 1 indicates available user
Other than the above mentioned values, the client does not accept the Intent.
ADB Example:
adb shell am broadcast -a com.symbol.wfc.pttpro.ACTION_GET_GROUP_USERS --es group 'hunting' --ei presence 1

Register Intent

Name
Definition
Action
com.symbol.wfc.pttpro.ACTION_GET_GROUP_USERS_STATUS
Extra 0
          Type
Integer
          Name
status
          Value
  • 0 indicates failure. Check the
    error_reason
    parameter for more information.
  • 1 indicates a successful case.
Extra 1
          Type
String
          Name
results
          Value
  • 0 indicates failure. Check the
    error_reason
    parameter for more information.
  • 1 indicates a successful case.
  • If status is 1, the list of users present in the requested group will be shared in the JSON format with their presence details.
If the
ACTION_GET_GROUP_USERS
queried for available users, it returns a list of available users. If no users are available, the result is an empty list.
Example
[ {"username":"john","presence":1,"firstName":john,"lastname":Smith}, {"username":"david","presence":1,"firstName":david,"lastname":Wilson} ]
The
Below are the presence states for the PTT Pro user
The presence state of the PTT Pro user follows:
  • 0=UNAVAILABLE
  • 1=AVAILABLE
  • 2- IN_CALL
  • 3=DND
  • 4=NOT_RESPONDING
  • 5=SILENT
  • 6=URGENT_COMM_ONLY
  • 7=CIRCUIT_CALL
  • 8=SIGNED_OUT
  • 9= PRESENCE_MAX
Extra 2
          Type
String
          Name
error_reason
          Value
  • The specified group is not found, or the user does not belong to this group.
  • Invalid presence parameter. It should be either 0 or 1.
  • The network is currently offline.
  • The user is not signed in.
  • The group name parameter is missing.
  • There are no members in the specified group.
  • The specified group does not exist.
Extra 3
          Type
String
          Name
group
          Value
  • Return the group name passed as part of the com.symbol.wfc.pttpro.ACTION_GET_GROUP_USERS intent.
Extra 4
          Type
String
          Name
presence
          Value
  • Return the presence state passed as part of the com.symbol.wfc.pttpro.ACTION_GET_GROUP_USERS intent

Code Snippet

Send Broadcast
Intent intent = new Intent(); intent.setAction("com.symbol.wfc.pttpro.ACTION_GET_GROUP_USERS"); intent.putExtra("group", hunting); intent.putExtra("presence", 1);   sendBroadcast(intent);
Register Intent
IntentFilter intent= new IntentFilter(); intent.addAction("com.symbol.wfc.pttpro.ACTION_GET_GROUP_USERS_STATUS"); registerReceiver(mReceiver,intent); public void onReceive(Context context, Intent intent) { String action= intent.getAction(); if(intent.getAction().equals(MainActivity.INTENT_ACTION_GET_GROUP_USERS_STATUS)) { Log.d(TAG, "Received groupStatus status : " + intent.getIntExtra("status", -1) + " results : " + intent.getStringExtra("results") + " Error reason : " + intent.getStringExtra("error_reason") + " Group : " + intent.getStringExtra("group") + " Presence : " + intent.getStringExtra("presence")); } }