This is a demo application built in Ruby using Ruby on Rails and the Vonage Ruby SDK to demonstrate the Rich Card and Suggested Reply functionality of RCS channel of the Vonage Messages API.
To run this demo locally you will need:
- A Vonage Developer account with a RCS Agent set up.
- Ruby installed
- Ngrok installed
You'll need to set up a Vonage application to manage the capabilities and obtain the API credentials for this app.
-
Log onto the Vonage Developer Dashboard
-
Go to the Applications page and click on the 'Create a new application' button
-
Generate a private key for the application by clicking on the 'Generate public and private key' button. Download the
private.key
file and keep it somewhere safe. -
Under 'Capabilities', enable the application for Messages by toggling the switch to 'on'.
-
Set the URLs for the Inbound and Message Status webhooks:
- The URL for Inbound webhook should have
/inbound_messages
appended to it - The URL for Status webhook should have
/status_messages
appended to it - Note: if you are running the demo locally, the URL in this case should be your Ngrok URL
- Click on the 'Generate new application' button at the bottom. This will generate and Application ID for the Vonage application; make a note of this or copy it to your clipboard for later.
-
Open Terminal and navigate to wherever you want to clone the repository.
-
Clone the repository
git clone https://github.com/Vonage-Community/demo-messages-ruby_on_rails-dev_fest_nantes_rcs_adventure_game.git
-
Change directory (
cd
) into the root directory of the cloned repository and install the dependenciesbundle install
-
Run Ngrok (if you haven't already done this) but running
ngrok http 3000
in a separate terminal tab or window. -
Copy or move the
private.key
file you downloaded earlier the root directory of this demo application -
Copy or rename the
.env-example
file to.env
and update the file with your Vonage credentials and the other settings:VONAGE_APPLICATION_ID
: This is the Application ID you generated earlier when creating the Vonage Application.RCS_SENDER_ID
: This is the sender ID for your RCS agent.MESSAGES_TO_NUMBER
: This is the mobile number, in E.164 format but without the leading+
, that will receive the RCS messages.- Note: if using a test RCS agent the mobile number needs to be added as a test number for that agent.
BASE_URL
: This is the URL for the site where you are running the demo. If running it locally, this will be your Ngrok URL.
-
Start the Rails application
rails s
-
In your browser, navigate to
localhost:3000
. The demo should now be running in the browser.