diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index c751d34..0000000 --- a/Gruntfile.js +++ /dev/null @@ -1,270 +0,0 @@ -var fs = require('fs'); - -module.exports = function(grunt) { - - grunt.initConfig( - { - - /** - * Reads the 'package.json' file and puts it content into a 'pkg' Javascript object. - */ - pkg : grunt.file.readJSON('package.json'), - - /** - * Clean task. - */ - clean : ['build'], - - /** - * Copy task. - */ - copy : { - - /** - * Copy test resource files to the build. - */ - 'test-resources' : { - files : [ - { - cwd: 'src/test/resources', - expand: true, - src: '**', - dest: 'build/test-resources/' - } - ] - } - - }, /* Copy task */ - - /** - * Shell Task - */ - shell : { - - pdepend : { - command : function() { - - var command = 'php vendor/pdepend/pdepend/src/bin/pdepend'; - command += ' --jdepend-chart=build/reports/pdepend/jdepend-chart.svg'; - command += ' --jdepend-xml=build/reports/pdepend/jdepend.xml'; - command += ' --overview-pyramid=build/reports/pdepend/overview-pyramid.svg'; - command += ' --summary-xml=build/reports/pdepend/summary.xml'; - command += ' src/main/php'; - - return command; - - } - }, - - phpcs : { - command : function() { - - var command = 'php ./vendor/squizlabs/php_codesniffer/bin/phpcs'; - command += ' --cache'; - command += ' --filter=GitModified'; - command += ' --parallel=16'; // Requires PHP to be compiled with PCNTL package - command += ' --standard=PSR2'; - command += ' -v'; - - if(grunt.option('checkstyle') === true) { - - command += ' --report=checkstyle'; - command += ' --report-file=target/reports/phpcs/phpcs.xml'; - } - - command += ' src/main/php'; - command += ' src/test/php/Gomoob'; - - return command; - - } - }, - - phpcbf : { - command : function() { - - var command = 'php ./vendor/squizlabs/php_codesniffer/bin/phpcbf'; - command += ' --cache'; - command += ' --filter=GitModified'; - command += ' --parallel=16'; // Requires PHP to be compiled with PCNTL package - command += ' --standard=PSR2'; - command += ' src/main/php'; - command += ' src/test/php'; - - return command; - - } - }, - - phpcpd : { - command : function() { - - return 'php vendor/sebastian/phpcpd/phpcpd src/main/php'; - - } - }, - - phpdocumentor : { - command : function() { - return 'php vendor/phpdocumentor/phpdocumentor/bin/phpdoc.php --target=build/reports/phpdocumentor --directory=src/main/php'; - } - }, - - phploc : { - command : function() { - - return 'php vendor/phploc/phploc/phploc src/main/php'; - - } - }, - - phpmd : { - command : function() { - - var command = 'php vendor/phpmd/phpmd/src/bin/phpmd '; - command += 'src/main/php '; - command += 'html '; - command += 'cleancode,codesize,controversial,design,naming,unusedcode '; - command += '--reportfile=build/reports/phpmd/phpmd.html'; - - return command; - - }, - options : { - callback : function(err, stdout, stderr, cb) { - grunt.file.write('build/reports/phpmd/phpmd.html', stdout); - cb(); - - } - } - }, - - phpunit : { - command: (function() { - - var commandLine = 'php vendor/phpunit/phpunit/phpunit '; - commandLine += '--configuration phpunit.xml.dist '; - commandLine += '--colors=auto '; - - if(typeof grunt.option('group') !== 'undefined') { - commandLine += '--group=' + grunt.option('group') + ' '; - } - - commandLine += 'src/test/php/ '; - - return commandLine; - }), - options : { - execOptions : { - maxBuffer : 1000 * 1000 * 64 // 64 MB - } - } - } - - } /* Shell Task */ - - } - - ); /* Grunt initConfig call */ - - // Load the Grunt Plugins - require('load-grunt-tasks')(grunt); - - /** - * Task used to create directories needed by PDepend to generate its report. - */ - grunt.registerTask('before-pdepend' , 'Creating directories required by PDepend...', function() { - - if(!fs.existsSync('build')) { - fs.mkdirSync('build'); - } - - if(!fs.existsSync('build/reports')) { - fs.mkdirSync('build/reports'); - } - - if(!fs.existsSync('build/reports/pdepend')) { - fs.mkdirSync('build/reports/pdepend'); - } - - }); - - /** - * Task used to create directories needed by PHP_CodeSniffer to generate its report. - */ - grunt.registerTask('before-phpcs', 'Creating directories required by PHP Code Sniffer...', function() { - - if(grunt.option('checkstyle') === true) { - - if(!fs.existsSync('build')) { - fs.mkdirSync('build'); - } - - if(!fs.existsSync('build/reports')) { - fs.mkdirSync('build/reports'); - } - - if(!fs.existsSync('build/reports/phpcs')) { - fs.mkdirSync('build/reports/phpcs'); - } - - } - - }); - - /** - * Task used to create directories needed by PHPMD to generate its report. - */ - grunt.registerTask('before-phpmd', 'Creating directories required by PHP Mess Detector...', function() { - - if(!fs.existsSync('build')) { - fs.mkdirSync('build'); - } - - if(!fs.existsSync('build/reports')) { - fs.mkdirSync('build/reports'); - } - - if(!fs.existsSync('build/reports/phpmd')) { - fs.mkdirSync('build/reports/phpmd'); - } - - }); - - /** - * Task used to generate a PDepend report. - */ - grunt.registerTask('pdepend', ['before-pdepend', 'shell:pdepend']); - - /** - * Task used to automatically fix PHP_CodeSniffer errors. - */ - grunt.registerTask('phpcbf', ['shell:phpcbf']); - - /** - * Task used to check the code using PHP_CodeSniffer. - */ - grunt.registerTask('phpcs', ['before-phpcs', 'shell:phpcs']); - - /** - * Task used to generate a PHPMD report. - */ - grunt.registerTask('phpmd', ['before-phpmd', 'shell:phpmd']); - - /** - * Task used to create the project documentation. - */ - grunt.registerTask('generate-documentation', ['pdepend', 'phpcs', 'phpmd', 'shell:phpdocumentor']); - - /** - * Task used to execute the project tests. - */ - grunt.registerTask('test', ['copy:test-resources', 'shell:phpunit']); - - /** - * Default task, this task executes the following actions : - * - Clean the previous build folder - */ - grunt.registerTask('default', ['clean', 'test', 'generate-documentation']); - -}; diff --git a/LICENSE.md b/LICENSE similarity index 85% rename from LICENSE.md rename to LICENSE index 0d41e0f..c70174d 100644 --- a/LICENSE.md +++ b/LICENSE @@ -1,4 +1,6 @@ -Copyright (c) 2014 GOMOOB SARL. +MIT License + +Copyright (c) 2023, Anton Komarev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -7,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/package.json b/package.json deleted file mode 100644 index dd37307..0000000 --- a/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "cybercog-php-pushwoosh", - "version": "1.9.0", - "license": "MIT", - "repository" : { - "type" : "git", - "url" : "git://github.com/cybercog/php-pushwoosh.git" - }, - "devDependencies": { - "grunt": "^1.0.1", - "grunt-contrib-clean": "^1.1.0", - "grunt-contrib-copy": "^1.0.0", - "grunt-shell": "^2.1.0", - "load-grunt-tasks" : "^3.5.2" - } -} diff --git a/src/test/platforms/cordova/.gitignore b/src/test/platforms/cordova/.gitignore deleted file mode 100644 index 500b1c9..0000000 --- a/src/test/platforms/cordova/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -Intel-XDK/plugins -Cordova/platforms -Cordova/plugins -Cordova/node_modules -Intel-XDK/.tern-defs -*.xdke_bak -*.xdk_bak -/node_modules/ -/platforms/ -/plugins/ diff --git a/src/test/platforms/cordova/README.md b/src/test/platforms/cordova/README.md deleted file mode 100644 index 64dd98b..0000000 --- a/src/test/platforms/cordova/README.md +++ /dev/null @@ -1,50 +0,0 @@ -This folder contains a testing Apache Cordova project which can be used to manually test the `php-pushwoosh` library. - -# Setup - -## Configure identifiers and credentials - -In `www/index.js` configure your Google project identifier (i.e the identifier you can find in the "Parameters" / -"Cloud Messaging" section of your Google Firebase project) and your Pushwoosh application code. - -``` -//initialize Pushwoosh with projectid: "GOOGLE_PROJECT_ID", appid : "PUSHWOOSH_APP_ID". -// This will trigger all pending push notifications on start. -pushNotification.onDeviceReady({ - projectid: "XXXXXXXX", - appid: "XXXXX-XXXXX", - serviceName: "" -}); -``` - -In the `create-message.php` change the value of the `application` and `auth` parameters to use a valid Pushwoosh -application. - -``` -// Create a Pushwoosh client -$pushwoosh = Pushwoosh::create() - ->setApplication('XXXXX-XXXXX') - ->setAuth('XXXXXXXX'); -``` - -## Starts the testing Cordova application - -First install the Apache Cordova command line. - -Add support for the Android platform. - -``` -cordova platform add android -``` - -Then start the Android emulator with the following command. - -``` -cordova run android -``` - -# Test sending of a Push notification - -``` -php ./create-message.php -``` diff --git a/src/test/platforms/cordova/config.xml b/src/test/platforms/cordova/config.xml deleted file mode 100644 index b5b4ab4..0000000 --- a/src/test/platforms/cordova/config.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - Phonegap-Push - - A sample Apache Cordova application that responds to the deviceready event. - - - Apache Cordova Team - - - - - - - - - - - - - diff --git a/src/test/platforms/cordova/create-message.php b/src/test/platforms/cordova/create-message.php deleted file mode 100644 index 0d3d6cb..0000000 --- a/src/test/platforms/cordova/create-message.php +++ /dev/null @@ -1,43 +0,0 @@ -setApplication('XXXXX-XXXXX') - ->setAuth('XXXXXXXX'); - -// Create a request for the '/createMessage' Web Service -$request = CreateMessageRequest::create() - ->addNotification(Notification::create()->setContent('Hello Jean !')); - -// Call the REST Web Service -$response = $pushwoosh->createMessage($request); - -// Check if its ok -if($response->isOk()) { - print 'Great, my message has been sent !'; -} else { - print 'Oups, the sent failed :-(' . PHP_EOL; - print 'Status code : ' . $response->getStatusCode() . PHP_EOL; - print 'Status message : ' . $response->getStatusMessage() . PHP_EOL; -} diff --git a/src/test/platforms/cordova/hooks/README.md b/src/test/platforms/cordova/hooks/README.md deleted file mode 100644 index 62e58b4..0000000 --- a/src/test/platforms/cordova/hooks/README.md +++ /dev/null @@ -1,196 +0,0 @@ - -# Cordova Hooks - -Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system to customize cordova commands. Hook scripts could be defined by adding them to the special predefined folder (`/hooks`) or via configuration files (`config.xml` and `plugin.xml`) and run serially in the following order: -* Application hooks from `/hooks`; -* Application hooks from `config.xml`; -* Plugin hooks from `plugins/.../plugin.xml`. - -__Remember__: Make your scripts executable. - -__Note__: `.cordova/hooks` directory is also supported for backward compatibility, but we don't recommend using it as it is deprecated. - -## Supported hook types -The following hook types are supported: - - after_build/ - after_compile/ - after_docs/ - after_emulate/ - after_platform_add/ - after_platform_rm/ - after_platform_ls/ - after_plugin_add/ - after_plugin_ls/ - after_plugin_rm/ - after_plugin_search/ - after_plugin_install/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being installed - after_prepare/ - after_run/ - after_serve/ - before_build/ - before_compile/ - before_docs/ - before_emulate/ - before_platform_add/ - before_platform_rm/ - before_platform_ls/ - before_plugin_add/ - before_plugin_ls/ - before_plugin_rm/ - before_plugin_search/ - before_plugin_install/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being installed - before_plugin_uninstall/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being uninstalled - before_prepare/ - before_run/ - before_serve/ - pre_package/ <-- Windows 8 and Windows Phone only. - -## Ways to define hooks -### Via '/hooks' directory -To execute custom action when corresponding hook type is fired, use hook type as a name for a subfolder inside 'hooks' directory and place you script file here, for example: - - # script file will be automatically executed after each build - hooks/after_build/after_build_custom_action.js - - -### Config.xml - -Hooks can be defined in project's `config.xml` using `` elements, for example: - - - - - - - - - - ... - - - - - - - ... - - -### Plugin hooks (plugin.xml) - -As a plugin developer you can define hook scripts using `` elements in a `plugin.xml` like that: - - - - - - - - ... - - -`before_plugin_install`, `after_plugin_install`, `before_plugin_uninstall` plugin hooks will be fired exclusively for the plugin being installed/uninstalled. - -## Script Interface - -### Javascript - -If you are writing hooks in Javascript you should use the following module definition: -```javascript -module.exports = function(context) { - ... -} -``` - -You can make your scipts async using Q: -```javascript -module.exports = function(context) { - var Q = context.requireCordovaModule('q'); - var deferral = new Q.defer(); - - setTimeout(function(){ - console.log('hook.js>> end'); - deferral.resolve(); - }, 1000); - - return deferral.promise; -} -``` - -`context` object contains hook type, executed script full path, hook options, command-line arguments passed to Cordova and top-level "cordova" object: -```json -{ - "hook": "before_plugin_install", - "scriptLocation": "c:\\script\\full\\path\\appBeforePluginInstall.js", - "cmdLine": "The\\exact\\command\\cordova\\run\\with arguments", - "opts": { - "projectRoot":"C:\\path\\to\\the\\project", - "cordova": { - "platforms": ["wp8"], - "plugins": ["com.plugin.withhooks"], - "version": "0.21.7-dev" - }, - "plugin": { - "id": "com.plugin.withhooks", - "pluginInfo": { - ... - }, - "platform": "wp8", - "dir": "C:\\path\\to\\the\\project\\plugins\\com.plugin.withhooks" - } - }, - "cordova": {...} -} - -``` -`context.opts.plugin` object will only be passed to plugin hooks scripts. - -You can also require additional Cordova modules in your script using `context.requireCordovaModule` in the following way: -```javascript -var Q = context.requireCordovaModule('q'); -``` - -__Note__: new module loader script interface is used for the `.js` files defined via `config.xml` or `plugin.xml` only. -For compatibility reasons hook files specified via `/hooks` folders are run via Node child_process spawn, see 'Non-javascript' section below. - -### Non-javascript - -Non-javascript scripts are run via Node child_process spawn from the project's root directory and have the root directory passes as the first argument. All other options are passed to the script using environment variables: - -* CORDOVA_VERSION - The version of the Cordova-CLI. -* CORDOVA_PLATFORMS - Comma separated list of platforms that the command applies to (e.g.: android, ios). -* CORDOVA_PLUGINS - Comma separated list of plugin IDs that the command applies to (e.g.: org.apache.cordova.file, org.apache.cordova.file-transfer) -* CORDOVA_HOOK - Path to the hook that is being executed. -* CORDOVA_CMDLINE - The exact command-line arguments passed to cordova (e.g.: cordova run ios --emulate) - -If a script returns a non-zero exit code, then the parent cordova command will be aborted. - -## Writing hooks - -We highly recommend writing your hooks using Node.js so that they are -cross-platform. Some good examples are shown here: - -[http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/) - -Also, note that even if you are working on Windows, and in case your hook scripts aren't bat files (which is recommended, if you want your scripts to work in non-Windows operating systems) Cordova CLI will expect a shebang line as the first line for it to know the interpreter it needs to use to launch the script. The shebang line should match the following example: - - #!/usr/bin/env [name_of_interpreter_executable] diff --git a/src/test/platforms/cordova/hooks/after_platform_add/1_install_plugins.js b/src/test/platforms/cordova/hooks/after_platform_add/1_install_plugins.js deleted file mode 100644 index dc0d29c..0000000 --- a/src/test/platforms/cordova/hooks/after_platform_add/1_install_plugins.js +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env node - -//this hook installs all your plugins - -// add your plugins to this list--either -// the identifier, the filesystem location -// or the URL -var pluginlist = [ - "cordova-plugin-device", - "cordova-plugin-console", - "cordova-plugin-whitelist", - "pushwoosh-cordova-plugin" -]; - -var exec = require('child_process').exec; - -pluginlist.forEach(function(plugin) { - exec("cordova plugin add " + plugin); -}); diff --git a/src/test/platforms/cordova/hooks/after_platform_add/2_disable_permissions.js b/src/test/platforms/cordova/hooks/after_platform_add/2_disable_permissions.js deleted file mode 100644 index 46d2340..0000000 --- a/src/test/platforms/cordova/hooks/after_platform_add/2_disable_permissions.js +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env node - -var permissions = [ - "android.permission.ACCESS_COARSE_LOCATION", - "android.permission.ACCESS_FINE_LOCATION" -]; - -var rootdir = process.argv[2]; - -var exec = require('child_process').exec; -var path = require('path'); - -var manifest = path.join(rootdir, "platforms/android/AndroidManifest.xml"); - -permissions.forEach(function(permission) { - exec("perl -i -p -e 's/.*" + permission + ".*//g' " + manifest); -}); diff --git a/src/test/platforms/cordova/hooks/after_platform_add/missing_applicationId_workaround.js b/src/test/platforms/cordova/hooks/after_platform_add/missing_applicationId_workaround.js deleted file mode 100644 index e619424..0000000 --- a/src/test/platforms/cordova/hooks/after_platform_add/missing_applicationId_workaround.js +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env node - -var fs = require('fs'); -var path = require('path'); - -function append_string_to_file(filename, to_add) { - var data = fs.readFileSync(filename, 'utf8'); - data += "" + to_add; - fs.writeFileSync(filename, data, 'utf8'); -} - -var rootdir = process.argv[2]; -var build_config = path.join(rootdir, "platforms/android/build.gradle"); - -var to_add = "android { \n defaultConfig.applicationId = \"com.pushwoosh.tesing\"\n}"; - - -// https://code.google.com/p/analytics-issues/issues/detail?id=784 -// this problem was finally fixed in Cordova v6.0.0 -// If you use previous version uncomment this: -// append_string_to_file(build_config, to_add); diff --git a/src/test/platforms/cordova/package.json b/src/test/platforms/cordova/package.json deleted file mode 100644 index b89515c..0000000 --- a/src/test/platforms/cordova/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "com.pushwoosh.demoapp", - "version": "0.0.1", - "displayName": "Phonegap-Push", - "cordova": { - "platforms": [ - "android" - ], - "plugins": { - "cordova-plugin-console": {}, - "cordova-plugin-device": {}, - "cordova-plugin-whitelist": {}, - "pushwoosh-cordova-plugin": { - "LOG_LEVEL": "DEBUG", - "IOS_FOREGROUND_ALERT_TYPE": "NONE", - "ANDROID_FOREGROUND_PUSH": "false" - } - } - }, - "dependencies": { - "cordova-android": "^6.2.3", - "cordova-plugin-console": "^1.0.7", - "cordova-plugin-device": "^1.1.6", - "cordova-plugin-whitelist": "^1.3.2", - "pushwoosh-cordova-plugin": "^6.5.3" - } -} \ No newline at end of file diff --git a/src/test/platforms/cordova/www/css/index.css b/src/test/platforms/cordova/www/css/index.css deleted file mode 100644 index 76d4810..0000000 --- a/src/test/platforms/cordova/www/css/index.css +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -* { - -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */ -} - -body { - -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */ - -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */ - -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */ - background-color:#E4E4E4; - background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); - background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); - background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); - background-image:-webkit-gradient( - linear, - left top, - left bottom, - color-stop(0, #A7A7A7), - color-stop(0.51, #E4E4E4) - ); - background-attachment:fixed; - font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif; - font-size:12px; - height:100%; - margin:0px; - padding:0px; - text-transform:uppercase; - width:100%; -} - -/* Portrait layout (default) */ -.app { - background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */ - position:absolute; /* position in the center of the screen */ - left:50%; - top:30%; - height:50px; /* text area height */ - width:90%; /* text area width */ - text-align:center; - padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */ - margin:-115px 0px 0px -45%; /* offset vertical: half of image height and text area height */ - /* offset horizontal: half of text area width */ -} - -.statustext { - height: 50px; - width: 90%; - font-size: 12px; - overflow: auto; -} - -/* Landscape layout (with min-width) */ -@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) { - .app { - /* background-position:left center; */ - /* padding:75px 0px 75px 170px; */ /* padding-top + padding-bottom + text area = image height */ - /* margin:-90px 0px 0px -198px; */ /* offset vertical: half of image height */ - /* offset horizontal: half of image width and text area width */ - } -} - -h1 { - font-size:24px; - font-weight:normal; - margin:0px; - overflow:visible; - padding:0px; - text-align:center; -} - -.event { - border-radius:4px; - -webkit-border-radius:4px; - color:#FFFFFF; - font-size:12px; - margin:0px 30px; - padding:2px 0px; -} - -.event.listening { - background-color:#333333; - display:block; -} - -.event.received { - background-color:#4B946A; - display:none; -} - -@keyframes fade { - from { opacity: 1.0; } - 50% { opacity: 0.4; } - to { opacity: 1.0; } -} - -@-webkit-keyframes fade { - from { opacity: 1.0; } - 50% { opacity: 0.4; } - to { opacity: 1.0; } -} - -.blink { - animation:fade 3000ms infinite; - -webkit-animation:fade 3000ms infinite; -} diff --git a/src/test/platforms/cordova/www/icon.png b/src/test/platforms/cordova/www/icon.png deleted file mode 100644 index d01a993..0000000 Binary files a/src/test/platforms/cordova/www/icon.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/img/logo.png b/src/test/platforms/cordova/www/img/logo.png deleted file mode 100644 index ba75902..0000000 Binary files a/src/test/platforms/cordova/www/img/logo.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/index.html b/src/test/platforms/cordova/www/index.html deleted file mode 100644 index c563d16..0000000 --- a/src/test/platforms/cordova/www/index.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - Hello World - - -
- -
-
- Pushwoosh status: - Push token:
-
- Push message:
-
- Push data:
-
-
-
- - - - diff --git a/src/test/platforms/cordova/www/js/index.js b/src/test/platforms/cordova/www/js/index.js deleted file mode 100644 index 81cf591..0000000 --- a/src/test/platforms/cordova/www/js/index.js +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - function onPushwooshInitialized(pushNotification) { - - //if you need push token at a later time you can always get it from Pushwoosh plugin - pushNotification.getPushToken( - function(token) { - console.info('push token: ' + token); - } - ); - - //and HWID if you want to communicate with Pushwoosh API - pushNotification.getPushwooshHWID( - function(token) { - console.info('Pushwoosh HWID: ' + token); - } - ); - - //settings tags - pushNotification.setTags({ - tagName: "tagValue", - intTagName: 10 - }, - function(status) { - console.info('setTags success: ' + JSON.stringify(status)); - }, - function(status) { - console.warn('setTags failed'); - } - ); - - pushNotification.getTags( - function(status) { - console.info('getTags success: ' + JSON.stringify(status)); - }, - function(status) { - console.warn('getTags failed'); - } - ); - - //start geo tracking. - //pushNotification.startLocationTracking(); -} - -function initPushwoosh() { - var pushNotification = cordova.require("pushwoosh-cordova-plugin.PushNotification"); - - //set push notifications handler - document.addEventListener('push-notification', - function(event) { - var message = event.notification.message; - var userData = event.notification.userdata; - - document.getElementById("pushMessage").innerHTML = message + "

"; - document.getElementById("pushData").innerHTML = JSON.stringify(event.notification) + "

"; - - //dump custom data to the console if it exists - if (typeof(userData) != "undefined") { - console.warn('user data: ' + JSON.stringify(userData)); - } - } - ); - - //initialize Pushwoosh with projectid: "GOOGLE_PROJECT_ID", appid : "PUSHWOOSH_APP_ID". This will trigger all pending push notifications on start. - pushNotification.onDeviceReady({ - projectid: "377975385078", - appid: "6C94D-9ED62", - serviceName: "" - }); - - //register for push notifications - pushNotification.registerDevice( - function(status) { - document.getElementById("pushToken").innerHTML = status.pushToken + "

"; - onPushwooshInitialized(pushNotification); - }, - function(status) { - alert("failed to register: " + status); - console.warn(JSON.stringify(['failed to register ', status])); - } - ); -} - -var app = { - // Application Constructor - initialize: function() { - this.bindEvents(); - }, - // Bind Event Listeners - // - // Bind any events that are required on startup. Common events are: - // 'load', 'deviceready', 'offline', and 'online'. - bindEvents: function() { - document.addEventListener('deviceready', this.onDeviceReady, false); - }, - // deviceready Event Handler - // - // The scope of 'this' is the event. In order to call the 'receivedEvent' - // function, we must explicity call 'app.receivedEvent(...);' - onDeviceReady: function() { - initPushwoosh(); - app.receivedEvent('deviceready'); - }, - // Update DOM on a Received Event - receivedEvent: function(id) { - var parentElement = document.getElementById(id); - var listeningElement = parentElement.querySelector('.listening'); - var receivedElement = parentElement.querySelector('.received'); - - listeningElement.setAttribute('style', 'display:none;'); - receivedElement.setAttribute('style', 'display:block;'); - - console.log('Received Event: ' + id); - } -}; - -app.initialize(); diff --git a/src/test/platforms/cordova/www/res/bubble.mp3 b/src/test/platforms/cordova/www/res/bubble.mp3 deleted file mode 100644 index 33bceaf..0000000 Binary files a/src/test/platforms/cordova/www/res/bubble.mp3 and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/icon/android/icon-36-ldpi.png b/src/test/platforms/cordova/www/res/icon/android/icon-36-ldpi.png deleted file mode 100644 index c11ca90..0000000 Binary files a/src/test/platforms/cordova/www/res/icon/android/icon-36-ldpi.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/icon/android/icon-48-mdpi.png b/src/test/platforms/cordova/www/res/icon/android/icon-48-mdpi.png deleted file mode 100644 index a39b801..0000000 Binary files a/src/test/platforms/cordova/www/res/icon/android/icon-48-mdpi.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/icon/android/icon-72-hdpi.png b/src/test/platforms/cordova/www/res/icon/android/icon-72-hdpi.png deleted file mode 100644 index 63af375..0000000 Binary files a/src/test/platforms/cordova/www/res/icon/android/icon-72-hdpi.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/icon/android/icon-96-xhdpi.png b/src/test/platforms/cordova/www/res/icon/android/icon-96-xhdpi.png deleted file mode 100644 index f486e9d..0000000 Binary files a/src/test/platforms/cordova/www/res/icon/android/icon-96-xhdpi.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/icon/blackberry/icon-80.png b/src/test/platforms/cordova/www/res/icon/blackberry/icon-80.png deleted file mode 100644 index a6d13e3..0000000 Binary files a/src/test/platforms/cordova/www/res/icon/blackberry/icon-80.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/icon/ios/icon-57-2x.png b/src/test/platforms/cordova/www/res/icon/ios/icon-57-2x.png deleted file mode 100644 index 2832d64..0000000 Binary files a/src/test/platforms/cordova/www/res/icon/ios/icon-57-2x.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/icon/ios/icon-57.png b/src/test/platforms/cordova/www/res/icon/ios/icon-57.png deleted file mode 100644 index e8011ea..0000000 Binary files a/src/test/platforms/cordova/www/res/icon/ios/icon-57.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/icon/ios/icon-72-2x.png b/src/test/platforms/cordova/www/res/icon/ios/icon-72-2x.png deleted file mode 100644 index 44c9702..0000000 Binary files a/src/test/platforms/cordova/www/res/icon/ios/icon-72-2x.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/icon/ios/icon-72.png b/src/test/platforms/cordova/www/res/icon/ios/icon-72.png deleted file mode 100644 index f7798d7..0000000 Binary files a/src/test/platforms/cordova/www/res/icon/ios/icon-72.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/icon/windows-phone/icon-173-tile.png b/src/test/platforms/cordova/www/res/icon/windows-phone/icon-173-tile.png deleted file mode 100644 index cc48fbe..0000000 Binary files a/src/test/platforms/cordova/www/res/icon/windows-phone/icon-173-tile.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/icon/windows-phone/icon-48.png b/src/test/platforms/cordova/www/res/icon/windows-phone/icon-48.png deleted file mode 100644 index 7e7c581..0000000 Binary files a/src/test/platforms/cordova/www/res/icon/windows-phone/icon-48.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/icon/windows-phone/icon-62-tile.png b/src/test/platforms/cordova/www/res/icon/windows-phone/icon-62-tile.png deleted file mode 100644 index ad137cb..0000000 Binary files a/src/test/platforms/cordova/www/res/icon/windows-phone/icon-62-tile.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/push_sound.mp3 b/src/test/platforms/cordova/www/res/push_sound.mp3 deleted file mode 100644 index 01a99ce..0000000 Binary files a/src/test/platforms/cordova/www/res/push_sound.mp3 and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/android/screen-hdpi-landscape.png b/src/test/platforms/cordova/www/res/screen/android/screen-hdpi-landscape.png deleted file mode 100644 index 1555f95..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/android/screen-hdpi-landscape.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/android/screen-hdpi-portrait.png b/src/test/platforms/cordova/www/res/screen/android/screen-hdpi-portrait.png deleted file mode 100644 index cdb70e1..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/android/screen-hdpi-portrait.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/android/screen-ldpi-landscape.png b/src/test/platforms/cordova/www/res/screen/android/screen-ldpi-landscape.png deleted file mode 100644 index 76f21ab..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/android/screen-ldpi-landscape.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/android/screen-ldpi-portrait.png b/src/test/platforms/cordova/www/res/screen/android/screen-ldpi-portrait.png deleted file mode 100644 index 1fecc2e..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/android/screen-ldpi-portrait.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/android/screen-mdpi-landscape.png b/src/test/platforms/cordova/www/res/screen/android/screen-mdpi-landscape.png deleted file mode 100644 index 3865488..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/android/screen-mdpi-landscape.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/android/screen-mdpi-portrait.png b/src/test/platforms/cordova/www/res/screen/android/screen-mdpi-portrait.png deleted file mode 100644 index c3db30c..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/android/screen-mdpi-portrait.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/android/screen-xhdpi-landscape.png b/src/test/platforms/cordova/www/res/screen/android/screen-xhdpi-landscape.png deleted file mode 100644 index 961b5f2..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/android/screen-xhdpi-landscape.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/android/screen-xhdpi-portrait.png b/src/test/platforms/cordova/www/res/screen/android/screen-xhdpi-portrait.png deleted file mode 100644 index 92a8c5a..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/android/screen-xhdpi-portrait.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/blackberry/screen-225.png b/src/test/platforms/cordova/www/res/screen/blackberry/screen-225.png deleted file mode 100644 index f1f13f8..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/blackberry/screen-225.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/ios/screen-ipad-landscape-2x.png b/src/test/platforms/cordova/www/res/screen/ios/screen-ipad-landscape-2x.png deleted file mode 100644 index 60c8344..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/ios/screen-ipad-landscape-2x.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/ios/screen-ipad-landscape.png b/src/test/platforms/cordova/www/res/screen/ios/screen-ipad-landscape.png deleted file mode 100644 index 0e240ce..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/ios/screen-ipad-landscape.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/ios/screen-ipad-portrait-2x.png b/src/test/platforms/cordova/www/res/screen/ios/screen-ipad-portrait-2x.png deleted file mode 100644 index 847df12..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/ios/screen-ipad-portrait-2x.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/ios/screen-ipad-portrait.png b/src/test/platforms/cordova/www/res/screen/ios/screen-ipad-portrait.png deleted file mode 100644 index c778c37..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/ios/screen-ipad-portrait.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/ios/screen-iphone-landscape-2x.png b/src/test/platforms/cordova/www/res/screen/ios/screen-iphone-landscape-2x.png deleted file mode 100644 index cb1a009..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/ios/screen-iphone-landscape-2x.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/ios/screen-iphone-landscape.png b/src/test/platforms/cordova/www/res/screen/ios/screen-iphone-landscape.png deleted file mode 100644 index cb66e89..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/ios/screen-iphone-landscape.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/ios/screen-iphone-portrait-2x.png b/src/test/platforms/cordova/www/res/screen/ios/screen-iphone-portrait-2x.png deleted file mode 100644 index 675297e..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/ios/screen-iphone-portrait-2x.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/ios/screen-iphone-portrait-568h-2x.png b/src/test/platforms/cordova/www/res/screen/ios/screen-iphone-portrait-568h-2x.png deleted file mode 100644 index 7355002..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/ios/screen-iphone-portrait-568h-2x.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/ios/screen-iphone-portrait.png b/src/test/platforms/cordova/www/res/screen/ios/screen-iphone-portrait.png deleted file mode 100644 index 2b02409..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/ios/screen-iphone-portrait.png and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/screen/windows-phone/screen-portrait.jpg b/src/test/platforms/cordova/www/res/screen/windows-phone/screen-portrait.jpg deleted file mode 100644 index e404e8a..0000000 Binary files a/src/test/platforms/cordova/www/res/screen/windows-phone/screen-portrait.jpg and /dev/null differ diff --git a/src/test/platforms/cordova/www/res/silence.mp3 b/src/test/platforms/cordova/www/res/silence.mp3 deleted file mode 100644 index 01785e4..0000000 Binary files a/src/test/platforms/cordova/www/res/silence.mp3 and /dev/null differ diff --git a/src/test/resources/.gitignore b/src/test/resources/.gitignore deleted file mode 100644 index 5bbd283..0000000 --- a/src/test/resources/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/pushwoosh-test-properties.json diff --git a/src/test/resources/README.md b/src/test/resources/README.md deleted file mode 100644 index 6714d6e..0000000 --- a/src/test/resources/README.md +++ /dev/null @@ -1,15 +0,0 @@ -The `pushwoosh-test-properties.json` file MUST NOT be commited to the GIT repository because this file contains -authentication informations to connect to a Pushwoosh account. - -If you want to execute the unit / integration tests you have to create a `pushwoosh-test-properties.json` file with the -following informations : -``` -{ - "application" : "XXXX-XXXX", - "auth" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -} -``` - -It is advice to create a Pushwoosh application which is dedicated to the GoMoob PHP Pushwoosh library and which is not -used by an other application or project (otherwise some integration tests could fail). - \ No newline at end of file