Browse Source

support subscribing with either "topic" or "url" param

master
Aaron Parecki 9 years ago
parent
commit
227fb5ac84
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      controllers/push.php

+ 5
- 1
controllers/push.php View File

@ -52,7 +52,11 @@ $app->post('/', function() use($app) {
case 'unsubscribe': case 'unsubscribe':
// Sanity check the request params // Sanity check the request params
$topic = push_param($params, 'topic');
$topic = push_param($params, 'url');
// Support subscribing using either "url" or "topic" parameters
if(!$topic) {
$topic = push_param($params, 'topic');
}
$callback = push_param($params, 'callback'); $callback = push_param($params, 'callback');
if(!$topic) { if(!$topic) {

Loading…
Cancel
Save