// Reference to RBM API helper
const rbmApiHelper = require('@google/rcsbusinessmessaging');
// Send the tester invite to the device
rbmApiHelper.sendTesterInvite('+12223334444', function(response) {
console.log(response);
});
import com.google.rbm.RbmApiHelper;
…
try {
// Create an instance of the RBM API helper
RbmApiHelper rbmApiHelper = new RbmApiHelper();
// Register the device as a tester
rbmApiHelper.registerTester("+12223334444");
} catch(Exception e) {
e.printStackTrace();
}
# Reference to RBM Python client helper
from rcs_business_messaging import rbm_service
# Send the tester invite to a device
rbm_service.invite_tester('+12223334444')
using RCSBusinessMessaging;
…
// Create an instance of the RBM API helper
RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation,
projectId);
// Register the device as a tester
rbmApiHelper.RegisterTester("+12223334444");
[null,null,["最后更新时间 (UTC):2024-11-06。"],[[["\u003cp\u003eBefore launching your agent, it can only communicate with designated test devices to allow for internal testing and prevent accidental access by end-users.\u003c/p\u003e\n"],["\u003cp\u003eTo interact with an RBM agent, a test device must have RCS enabled, which can be verified and activated through the device's Messages app settings.\u003c/p\u003e\n"],["\u003cp\u003eAn agent can invite a device to be a tester by sending a tester request, and once accepted, the device can receive and respond to messages from the agent, but there is a limit of 20 tester requests per day, and a total of 200 requests.\u003c/p\u003e\n"],["\u003cp\u003eTester requests can be sent through the Business Communications Developer Console or via the RBM API, with examples provided for cURL, Node.js, Java, Python, and C#.\u003c/p\u003e\n"],["\u003cp\u003eAfter a test device is no longer needed for testing, it can be removed through the Business Communications Developer Console, preventing it from receiving messages from the agent, although messages in transit or stored will not be removed.\u003c/p\u003e\n"]]],[],null,["Until you\n[launch](/business-communications/rcs-business-messaging/guides/launch/launch-approval)\nyour agent, it can only communicate with designated test devices. This lets you\ntest your agent internally while preventing accidental early access to\nend-users.\n\nTo communicate with an RBM agent, a test device needs to be RCS-enabled. Note\nthat some Android devices don't have RCS enabled by default. You can\ncheck the [RCS status](#check-rcs) of your device and, if necessary, [enable\nRCS](#enable-rcs) by configuring your device with pre-release versions of the\nMessages and Carrier Services apps.\n\nWhen your device is RCS-enabled, you can send a [tester\nrequest](#tester-request) to invite the device to test your agent. Once the\ndevice accepts the request, it can receive and respond to messages from your\nunlauched agent.\n\nAn agent can send 20 tester requests each day with a maximum total of 200\ntester requests. If you add testers through the RBM API and you send more\nthan 200 requests, the RBM platform returns a `429 RESOURCE_EXHAUSTED` response.\n| **Note:** After you launch your agent, it can communicate to any RCS-enabled device, not just test devices.\n\nCheck the RCS status of your device\n\n1. In the Messages app, navigate to **Messages settings**.\n2. Tap **RCS chats** . If you can't find \"RCS chats\", tap **Chat features**.\n3. Find the **Status** value.\n\n If **Status** is **Connected**, RCS is active on your device.\n\nNext steps\n\nIf RCS is active on your device, you're ready to send a [tester\nrequest](#tester-request). If RCS is inactive on your device, you need to\n[enable RCS](#enable-rcs) on your device before you can begin testing your RBM\nagent with it.\n\nEnable RCS on your device\n\nTo enable RCS on an Android device, [turn on RCS chats in the Messages app](https://support.google.com/messages/answer/7189714?&ref_topic=9459217&sjid=4666643179640476654-AP).\n\nNext steps\n\nOnce RCS is active on your device, you're ready to send a [tester\nrequest](#tester-request).\n\nSend a tester request\n\nTo invite an RCS-enabled device to become a tester, you send a tester request.\nIf the device accepts the request, your agent can send messages, events, and\nrequests to the device.\n\nIf the device isn't RCS-enabled, hasn't responded to the tester request, or\ndeclines the request, your agent receives a `403 PERMISSION_DENIED`\nerror when it attempts to communicate with the device.\n\nOption 1: Send a tester request with the Business Communications Developer Console\n\n1. Open the [Business Communications Developer\n Console](https://business-communications.cloud.google.com?utm_source=/business-communications/rcs-business-messaging/guides/build/test&utm_medium=devsite&utm_campaign=rcs-business-messaging), sign in with your RBM Google account, and click your agent.\n2. In the left navigation, click **Devices**.\n3. For **Add test devices** , enter your device's phone number and click **Add**.\n\n**Test devices list** details the tester request status for each device that you\ninvite to test your agent.\n\nOption 2: Send a tester request with the RBM API\n\nThe following code sends a tester request. For formatting and value options, see\n[`phones.testers`](/business-communications/rcs-business-messaging/reference/rest/v1/phones.testers). \n\ncURL \n\n```console\ncurl -X POST \"https://\u003cvar fieldvalues=\"asia,europe,us\" translate=\"no\"\u003eREGION\u003c/var\u003e-rcsbusinessmessaging.googleapis.com/v1/phones/\u003cvar translate=\"no\"\u003ePHONE_NUMBER\u003c/var\u003e/testers?agentId=AGENT_ID\" \\\n-H \"Content-Type: application/json\" \\\n-H \"User-Agent: curl/rcs-business-messaging\" \\\n-H \"`oauth2l header --json \u003cvar translate=\"no\"\u003ePATH_TO_SERVICE_ACCOUNT_KEY\u003c/var\u003e rcsbusinessmessaging`\"\n```\n\nNode.js \n\n```javascript\n// Reference to RBM API helper\nconst rbmApiHelper = require('@google/rcsbusinessmessaging');\n\n// Send the tester invite to the device\nrbmApiHelper.sendTesterInvite('\u003cvar fieldlabel=\"Phone number\" translate=\"no\"\u003e+12223334444\u003c/var\u003e', function(response) {\n console.log(response);\n});\n```\nThis code is an excerpt from an [RBM sample agent](/business-communications/rcs-business-messaging/samples).\n\nJava \n\n```java\nimport com.google.rbm.RbmApiHelper;\n...\n\ntry {\n // Create an instance of the RBM API helper\n RbmApiHelper rbmApiHelper = new RbmApiHelper();\n\n // Register the device as a tester\n rbmApiHelper.registerTester(\"\u003cvar fieldlabel=\"Phone number\" translate=\"no\"\u003e+12223334444\u003c/var\u003e\");\n} catch(Exception e) {\n e.printStackTrace();\n}\n```\nThis code is an excerpt from an [RBM sample agent](/business-communications/rcs-business-messaging/samples).\n\nPython \n\n```python\n# Reference to RBM Python client helper\nfrom rcs_business_messaging import rbm_service\n\n# Send the tester invite to a device\nrbm_service.invite_tester('\u003cvar fieldlabel=\"Phone number\" translate=\"no\"\u003e+12223334444\u003c/var\u003e')\n```\nThis code is an excerpt from an [RBM sample agent](/business-communications/rcs-business-messaging/samples).\n\nC# \n\n```c#\nusing RCSBusinessMessaging;\n...\n\n// Create an instance of the RBM API helper\nRbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation,\n projectId);\n\n// Register the device as a tester\nrbmApiHelper.RegisterTester(\"\u003cvar fieldlabel=\"Phone number\" translate=\"no\"\u003e+12223334444\u003c/var\u003e\");\n```\nThis code is an excerpt from an [RBM sample agent](/business-communications/rcs-business-messaging/samples).\n\nNext steps\n\nAfter the device accepts the tester request, it's a designated test device for\nyour agent. You can send\n[messages](/business-communications/rcs-business-messaging/guides/build/messages/send),\n[events](/business-communications/rcs-business-messaging/guides/build/events), and\n[capability checks](/business-communications/rcs-business-messaging/guides/build/capabilities)\nto your device to test your agent's functionality and workflows.\n\nRemove a test device\n\nWhen you remove a test device, the device can no longer receive messages from\nyour unlaunched agent. The RBM platform doesn't delete messages sent by your\nagent that are in transit to or stored on the test device.\n\n1. Open the [Business Communications Developer\n Console](https://business-communications.cloud.google.com?utm_source=/business-communications/rcs-business-messaging/guides/build/test&utm_medium=devsite&utm_campaign=rcs-business-messaging), sign in with your RBM Google account, and click your agent.\n2. In the left navigation, click **Devices**.\n3. Locate the device in **Test device list** and click the more_vert menu for that list item.\n4. Click **Remove device**."]]