Merge pull request #2 from TwilioDevEd/update-notify

Update Notify Instructions
This commit is contained in:
Jeff Linwood
2017-02-21 10:34:35 -06:00
committed by GitHub
6 changed files with 9 additions and 22 deletions

View File

@@ -11,8 +11,6 @@ TWILIO_CHAT_SERVICE_SID=
# Required for Notify
TWILIO_NOTIFICATION_SERVICE_SID=
TWILIO_APN_CREDENTIAL_SID=
TWILIO_GCM_CREDENTIAL_SID=
# Required for Sync
TWILIO_SYNC_SERVICE_SID=

View File

@@ -45,8 +45,6 @@ Depending on which demos you'd like to run, you'll need to configure a few more
`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)
`TWILIO_APN_CREDENTIAL_SID` | Notify (Preview) | Adds iOS notification ability to your app - [generate one here](https://www.twilio.com/console/notify/credentials). You'll need to provision your APN push credentials to generate this. See [this](https://www.twilio.com/docs/api/ip-messaging/guides/push-notifications-ios) guide on how to do that. (Optional)
`TWILIO_GCM_CREDENTIAL_SID` | Notify (Preview) |Adds Android/GCM notification ability to your app - [generate one here](https://www.twilio.com/console/notify/credentials). You'll need to provision your GCM push credentials to generate this. See [this](https://www.twilio.com/docs/api/ip-messaging/guides/push-notifications-android) guide on how to do that (Optional)
#### Temporary: Generating a Sync Service Instance
@@ -60,6 +58,10 @@ curl -X POST https://preview.twilio.com/Sync/Services \
-u 'SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_api_secret'
```
### Configuring Notify
You will need to create a Notify Service through the [Twilio Console](https://www.twilio.com/console/notify/services), and add at least one credential on the [Mobile Push Credential screen](https://www.twilio.com/console/notify/credentials) (such as Apple Push Notification Service or Firebase Cloud Messaging for Android) to send notifications using Notify.
## Run the sample application
This application uses the lightweight [Flask Framework](http://flask.pocoo.org/).
@@ -86,7 +88,7 @@ python app.py
Your application should now be running at [http://localhost:5000](http://localhost:5000). When you're finished, deactivate your virtual environment using `deactivate`.
![Home Screen](https://cloud.githubusercontent.com/assets/809856/19532947/673cc7d6-9603-11e6-9a7c-13c0f9ab33b7.png)
![Home Screen](https://cloud.githubusercontent.com/assets/809856/23171215/8107bd9e-f817-11e6-94c5-2b132d798fae.png)
## Running the SDK Starter Kit with ngrok

2
app.py
View File

@@ -39,8 +39,6 @@ def config():
return jsonify(
TWILIO_ACCOUNT_SID=os.environ['TWILIO_ACCOUNT_SID'],
TWILIO_NOTIFICATION_SERVICE_SID=os.environ['TWILIO_NOTIFICATION_SERVICE_SID'],
TWILIO_APN_CREDENTIAL_SID=os.environ['TWILIO_APN_CREDENTIAL_SID'],
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_CHAT_SERVICE_SID=os.environ['TWILIO_CHAT_SERVICE_SID'],

View File

@@ -5,8 +5,6 @@ $(function() {
configureField(response, 'TWILIO_API_SECRET','twilioAPISecret',true);
configureField(response, 'TWILIO_CONFIGURATION_SID','twilioConfigurationSID',false);
configureField(response, 'TWILIO_NOTIFICATION_SERVICE_SID','twilioNotificationServiceSID',false);
configureField(response, 'TWILIO_APN_CREDENTIAL_SID','twilioAPNCredentialSID',false);
configureField(response, 'TWILIO_GCM_CREDENTIAL_SID','twilioGCMCredentialSID',false);
configureField(response, 'TWILIO_CHAT_SERVICE_SID','twilioChatServiceSID',false);
configureField(response, 'TWILIO_SYNC_SERVICE_SID','twilioSyncServiceSID',false);

View File

@@ -37,17 +37,7 @@
<td class="config-product">Notify</td>
<td class="config-key">TWILIO_NOTIFICATION_SERVICE_SID</td>
<td class="config-value" id="twilioNotificationServiceSID"></td>
</tr>
<tr>
<td class="config-product">Notify</td>
<td class="config-key">TWILIO_APN_CREDENTIAL_SID</td>
<td class="config-value" id="twilioAPNCredentialSID"></td>
</tr>
<tr>
<td class="config-product">Notify</td>
<td class="config-key">TWILIO_GCM_CREDENTIAL_SID</td>
<td class="config-value" id="twilioGCMCredentialSID"></td>
</tr>
</tr>
<tr>
<td class="config-product">Chat</td>
<td class="config-key">TWILIO_CHAT_SERVICE_SID</td>

View File

@@ -16,8 +16,9 @@
</header>
<section>
<h1>Send Notification</h1>
<input type="text" id="identityInput" size="30"/>
<h1>Send Notification to Identity</h1>
<input type="text" id="identityInput" placeholder="Identity" size="30"/>
<p/>
<input type="submit" id="sendNotificationButton" value="Send Notification"/>