diff --git a/.env.example b/.env.example index b0ad489..ae09d3a 100644 --- a/.env.example +++ b/.env.example @@ -6,8 +6,8 @@ TWILIO_API_SECRET= # Required for Video TWILIO_CONFIGURATION_SID= -# Required for IP Messaging -TWILIO_IPM_SERVICE_SID= +# Required for Chat +TWILIO_CHAT_SERVICE_SID= # Required for Notify TWILIO_NOTIFICATION_SERVICE_SID= diff --git a/README.md b/README.md index ef46ef1..0abc82e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This sample project demonstrates how to use Twilio APIs in a Python web application. Once the app is up and running, check out [the home page](http://localhost:5000) -to see which demos you can run. You'll find examples for [IP Messaging](https://www.twilio.com/ip-messaging), +to see which demos you can run. You'll find examples for [Chat](https://www.twilio.com/chat), [Video](https://www.twilio.com/video), [Sync](https://www.twilio.com/sync), and more. Let's get started! @@ -41,7 +41,7 @@ Depending on which demos you'd like to run, you'll need to configure a few more | Config Value | Product Demo | Description | | :------------- |:------------- |:------------- | -`TWILIO_IPM_SERVICE_SID` | IP Messaging | Like a database for your IP Messaging data - [generate one in the console here](https://www.twilio.com/console/ip-messaging/services) +`TWILIO_CHAT_SERVICE_SID` | Chat | Like a database for your Chat data - [generate one in the console here](https://www.twilio.com/console/chat/services) `TWILIO_CONFIGURATION_SID` | Video | Identifier for a set of config properties for your video application - [find yours here](https://www.twilio.com/console/video/profiles) `TWILIO_SYNC_SERVICE_SID` | Sync (Preview) | Like a database for your Sync data - generate one with the curl command below. `TWILIO_NOTIFICATION_SERVICE_SID` | Notify (Preview) | You will need to create a Notify service - [generate one here](https://www.twilio.com/console/notify/services) diff --git a/app.py b/app.py index d55056c..9dcfe4b 100644 --- a/app.py +++ b/app.py @@ -28,9 +28,9 @@ def sync(): def notify(): return app.send_static_file('notify/index.html') -@app.route('/ipmessaging/') -def ipmessaging(): - return app.send_static_file('ipmessaging/index.html') +@app.route('/chat/') +def chat(): + return app.send_static_file('chat/index.html') # Basic health check - check environment variables have been configured # correctly @@ -43,7 +43,7 @@ def config(): TWILIO_GCM_CREDENTIAL_SID=os.environ['TWILIO_GCM_CREDENTIAL_SID'], TWILIO_API_KEY=os.environ['TWILIO_API_KEY'], TWILIO_API_SECRET=bool(os.environ['TWILIO_API_SECRET']), - TWILIO_IPM_SERVICE_SID=os.environ['TWILIO_IPM_SERVICE_SID'], + TWILIO_CHAT_SERVICE_SID=os.environ['TWILIO_CHAT_SERVICE_SID'], TWILIO_SYNC_SERVICE_SID=os.environ['TWILIO_SYNC_SERVICE_SID'], TWILIO_CONFIGURATION_SID=os.environ['TWILIO_CONFIGURATION_SID'] ) @@ -56,7 +56,7 @@ def token(): api_secret = os.environ['TWILIO_API_SECRET'] sync_service_sid = os.environ['TWILIO_SYNC_SERVICE_SID'] configuration_profile_sid = os.environ['TWILIO_CONFIGURATION_SID'] - ipm_service_sid = os.environ['TWILIO_IPM_SERVICE_SID'] + chat_service_sid = os.environ['TWILIO_CHAT_SERVICE_SID'] # create a randomly generated username for the client @@ -79,10 +79,10 @@ def token(): video_grant = ConversationsGrant(configuration_profile_sid=configuration_profile_sid) token.add_grant(video_grant) - # Create an IP Messaging grant and add to token - if ipm_service_sid: - ipm_grant = IpMessagingGrant(endpoint_id=endpoint, service_sid=ipm_service_sid) - token.add_grant(ipm_grant) + # Create an Chat grant and add to token + if chat_service_sid: + chat_grant = IpMessagingGrant(endpoint_id=endpoint, service_sid=chat_service_sid) + token.add_grant(chat_grant) # Return token info as JSON return jsonify(identity=identity, token=token.to_jwt()) diff --git a/static/ipmessaging/index.css b/static/chat/index.css similarity index 100% rename from static/ipmessaging/index.css rename to static/chat/index.css diff --git a/static/ipmessaging/index.html b/static/chat/index.html similarity index 68% rename from static/ipmessaging/index.html rename to static/chat/index.html index 5e93564..c5d76a0 100755 --- a/static/ipmessaging/index.html +++ b/static/chat/index.html @@ -1,14 +1,14 @@
-