Send a PTT Message

Send a PTT Message

This intent is used to send a PTT message to a group or to one or more users.

Prerequisites

  • When initiating a message to a group, the group must be defined in the
    PTT Pro Server
    , and the initiating PTT Pro user (i.e., the target of the intent) must be a member of the group.
  • When initiating a call to one or more users, the usernames(s) must be defined in the
    PTT Pro Server
    .
  • The minimum required PTT Pro for Android version is 3.3.10134.
  • The Support Audio Sharing feature (PTT Pro for Android version 3.3.10330) is only applicable to the Zebra
    WS50 device

Intent Definition

Name
Description
Action
com.symbol.wfc.pttpro.ACTION_PTT_PRO_MESSAGE
Intent Type
broadcast
Extra 0
This extra defines whether the call is targeted to a group or a user. This is a mandatory parameter
          Type
Integer
          Name
recipientType
          Value
1
to target the call to a group.
0
to target the call to 1 or more users.
Extra 1
         Type
String
          Name
recipientName
          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 2
         Type
String
          Name
message
          Value
Any message if string format. This is used configure the message to be sent to the Group/User.
Extra 3
         Type
String
          Name
userToken
          Value
Zems User Token. Configures the Zems Token to the WS50 device.
Extra 4
         Type
String
          Name
encodedAudio
          Value
Encoded Audio as a String. This is used to configure the audio message to be sent to the Group/User.

ADB Examples

Sending to a group:
adb shell am broadcast -a com.symbol.wfc.pttpro.ACTION_PTT_PRO_MESSAGE --ei recipientType 1 --es recipientName staff_admin' --es message 'Team meeting at 4pm'
adb shell am broadcast -a com.symbol.wfc.pttpro.ACTION_PTT_PRO_MESSAGE --ei recipientType 1 --es recipientName 'hardware_admin' --es message 'Hi! This is a test message.' --es userToken 'zems user token' --es encodedAudio 'audio stream'
adb shell am broadcast -a com.symbol.wfc.pttpro.ACTION_PTT_PRO_MESSAGE --ei recipientType 0 --es recipientName 'john' --es message 'Hi! This is a test message.' --es userToken 'zems user token' --es encodedAudio 'audio stream'
adb shell am broadcast -a com.symbol.wfc.pttpro.ACTION_PTT_PRO_MESSAGE --ei recipientType 0 --es recipientName 'john,steve' --es message 'Hi! This is a test message.' --es userToken 'zems user token' --es encodedAudio 'audio stream'
Sending to a user:
adb shell am broadcast -a com.symbol.wfc.pttpro.ACTION_PTT_PRO_MESSAGE --ei recipientType 0 --es recipientName 'george.shaw' --es message 'Review tomorrow is cancelled'
Sending to multiple users:
adb shell am broadcast -a com.symbol.wfc.pttpro.ACTION_PTT_PRO_MESSAGE --ei recipientType 0 --es recipientName 'george.shaw,ira.gershwin,cole.porter' --es message 'Review tomorrow is cancelled'

Register Intent

The following information pertains to the Intent and the additional parameter that other applications must register to receive the results of the
com.symbol.wfc.pttpro.ACTION_PTT_PRO_MESSAGE
intent.
Third-party applications must follow the following steps outlined to receive intent information from the
PTT Pro Client
.
Listen for the broadcast with the action
PTTPRO_MESSAGE_STATUS
and filter the results using the appropriate extra types to obtain the status and other information, as detailed in the following table.
Name
Definition
Action
com.symbol.wfc.pttpro.PTTPRO_MESSAGE_STATUS
Extra 0
          Type
Integer
          Name
PTT_PRO_MESSAGE_STATUS
          Value
  • 0 indicates failure. Check
    PTT_PRO_MESSAGE_STATUS_REASON
    extra for more information.
  • 1 indicates a successful case.
Extra 1
          Type
String
          Name
PTT_PRO_MESSAGE_ERROR_REASON
          Value
  • The username is invalid.
  • The group name is invalid.
  • The network is currently offline.
  • An error occurred while sending the Zems message.
  • An error occurred in the ZEMS configuration.
  • The ZEMS API key or URL is not configured.
  • The user is not signed in.
  • The user token parameter is missing.
  • The encoded audio parameter is missing.
  • An error occurred while parsing the encoded audio.
Extra 2
          Type
String
          Name
recipientName
          Value
Returns the recipientName passed as part of the
com.symbol.wfc.pttpro.ACTION_PTT_PRO_MESSAGE
intent.

Code Snippet

Send Broadcast
Intent intent = new Intent(); intent.setAction("com.symbol.wfc.pttpro.ACTION_PTT_PRO_MESSAGE"); intent.putExtra("recipientType", 0); intent.putExtra("recipientName", "Aryan01"); intent.putExtra("message", "Hi this is from VAI"); intent.putExtra("encodedAudio", encodedAudio); intent.putExtra("userToken", "userToken");   sendBroadcast(intent);
Register Intent
IntentFilter message_intent= new IntentFilter(); message_intent.addAction("com.symbol.wfc.pttpro.PTTPRO_MESSAGE_STATUS"); registerReceiver(mReceiver,message_intent); public void onReceive(Context context, Intent intent) { String action= intent.getAction(); if(action.equals("com.symbol.wfc.pttpro.PTTPRO_MESSAGE_STATUS")) { int message_status = intent.getIntExtra("PTT_PRO_MESSAGE_STATUS" , 0); if ( message_status == 0) { String message_error_reason = intent.getStringExtra("PTT_PRO_MESSAGE_ERROR_REASON"); Log.i(TAG, " message_error_reason : "+ message_error_reason ); } String recipient_name = intent.getStringExtra("recipientName"); Log.i(TAG, " recipient_name : "+ recipient_name ); } } }