diff --git a/appinfo/routes.php b/appinfo/routes.php index cc6aa65..c43700e 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -43,7 +43,7 @@ $application->registerRoutes($this, array('routes' => array( array('name' => 'api#fetch_messages_count', 'url' => '/api/v2/messages/count', 'verb' => 'GET'), // Android APIv2 // Android API v3 - // @TODO + array('name' => 'api#generate_sms_test_data', 'url' => '/api/v3/test/generate_sms_data', 'verb' => 'POST'), // Android APIv3 // Android API v4 // @TODO future calls to sending calls recorded on the phone diff --git a/controller/apicontroller.php b/controller/apicontroller.php index cc93c04..77c9469 100644 --- a/controller/apicontroller.php +++ b/controller/apicontroller.php @@ -229,4 +229,25 @@ class ApiController extends Controller { // @TODO return new JSONResponse(array("messages" => array())); } + + /** + * @NoAdminRequired + * @NoCSRFRequired + * + * @param $smsCount + * @param $smsDatas + * @return JSONResponse + * + * produce a bunch of data to test application + */ + public function generateSmsTestData () { + return $this->push(2, array( + array("_id" => 702, "type" => 1, "mbox" => 0, "read" => "true", + "seen" => "true", "date" => 1654777777, "address" => "+33123456789", + "body" => "hello dude"), + array("_id" => 685, "type" => 1, "mbox" => 1, "read" => "true", + "seen" => "true", "date" => 1654777777, "address" => "+33123456789", + "body" => "😀🌍⭐🌎🌔🌒🐕🍖🥂🍻🎮🤸‍♂️🚇🈲❕📘📚📈🇸🇨🇮🇲"), + )); + } }