rhoconnect 3.4.5 → 4.0.0.beta.10
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +57 -3
- data/Gemfile +9 -7
- data/Gemfile.lock +37 -37
- data/Rakefile +18 -7
- data/bench/benchapp/Gemfile +1 -1
- data/bench/benchapp/config.ru +0 -3
- data/bench/benchapp/controllers/ruby/application.rb +17 -0
- data/bench/benchapp/controllers/ruby/application_controller.rb +17 -0
- data/bench/benchapp/controllers/ruby/mock_adapter_controller.rb +8 -0
- data/bench/benchapp/controllers/ruby/queue_mock_adapter_controller.rb +8 -0
- data/bench/benchapp/{sources → models/ruby}/mock_adapter.rb +1 -1
- data/bench/benchapp/{sources → models/ruby}/queue_mock_adapter.rb +0 -0
- data/bench/benchapp/spec/{sources → models/ruby}/mock_adapter_spec.rb +1 -1
- data/bench/benchapp/spec/{sources → models/ruby}/queue_mock_adapter_spec.rb +1 -1
- data/bench/benchapp/spec/spec_helper.rb +2 -2
- data/bench/blobapp/Gemfile +1 -1
- data/bench/blobapp/config.ru +0 -3
- data/bench/blobapp/controllers/ruby/application_controller.rb +17 -0
- data/bench/blobapp/controllers/ruby/blob_adapter_controller.rb +8 -0
- data/bench/blobapp/{sources → models/ruby}/blob_adapter.rb +9 -2
- data/bench/blobapp/spec/{sources → models/ruby}/blob_adapter_spec.rb +1 -1
- data/bench/blobapp/spec/spec_helper.rb +1 -1
- data/bench/lib/bench/cli.rb +1 -1
- data/bench/scripts/blob_cud_script.rb +1 -1
- data/bench/scripts/query_md_script.rb +1 -1
- data/bench/scripts/query_only_script.rb +1 -1
- data/bench/scripts/query_script.rb +1 -1
- data/bench/scripts/test_query_script.rb +7 -1
- data/bench/spec/mock_adapter_spec.rb +1 -1
- data/bench/spec/result_spec.rb +3 -3
- data/bin/rhoconnect +5 -3
- data/commands/dtach/dtach_install.rb +2 -2
- data/commands/execute.rb +8 -3
- data/commands/generators/app.rb +3 -3
- data/commands/generators/controller.rb +6 -0
- data/commands/generators/model.rb +6 -0
- data/commands/generators/source.rb +3 -3
- data/commands/generators/update.rb +1 -1
- data/commands/redis/redis_about.rb +2 -2
- data/commands/redis/redis_download.rb +1 -1
- data/commands/redis/redis_install.rb +4 -3
- data/commands/redis/redis_restart.rb +4 -4
- data/commands/redis/redis_start.rb +5 -4
- data/commands/redis/redis_startbg.rb +5 -4
- data/commands/redis/redis_status.rb +13 -0
- data/commands/redis/redis_stop.rb +3 -3
- data/commands/rhoconnect/config.rb +28 -16
- data/commands/rhoconnect/flushdb.rb +1 -2
- data/commands/rhoconnect/get_token.rb +15 -11
- data/commands/rhoconnect/restart.rb +13 -5
- data/commands/rhoconnect/set_admin_password.rb +8 -8
- data/commands/rhoconnect/start.rb +74 -16
- data/commands/rhoconnect/startbg.rb +1 -1
- data/commands/rhoconnect/startdebug.rb +1 -1
- data/commands/rhoconnect/stop.rb +13 -1
- data/commands/rhoconnect/web.rb +5 -5
- data/commands/rhoconnect_console/console.rb +7 -5
- data/commands/{rhoconnect → rhoconnect_spec}/spec.rb +0 -0
- data/commands/rhoconnect_war/war.rb +9 -9
- data/commands/utilities/blank_app.ru +56 -0
- data/commands/utilities/redis_runner.rb +54 -19
- data/doc/authentication.txt +80 -6
- data/doc/blob-sync.txt +104 -97
- data/doc/bulk-sync.txt +1 -1
- data/doc/client-java.txt +3 -3
- data/doc/client-objc.txt +2 -2
- data/doc/client.txt +4 -4
- data/doc/command-line.txt +105 -200
- data/doc/data-partitioning.txt +40 -0
- data/doc/deploying.txt +249 -77
- data/doc/extending-rhoconnect-server.txt +40 -57
- data/doc/heroku-addon.txt +2 -0
- data/doc/install.txt +45 -95
- data/doc/introduction.txt +1 -1
- data/doc/java-plugin.txt +365 -190
- data/doc/metadata.txt +1 -1
- data/doc/migration.txt +108 -142
- data/doc/preparing-production.txt +1 -1
- data/doc/push-backend-setup.txt +2 -0
- data/doc/push-client-setup-android.txt +78 -0
- data/doc/push-client-setup-bb.txt +81 -0
- data/doc/push-client-setup-ios.txt +70 -0
- data/doc/push-client-setup-rps.txt +200 -0
- data/doc/push-client-setup.txt +63 -66
- data/doc/push-server-setup.txt +67 -40
- data/doc/push-testing.txt +29 -0
- data/doc/push.txt +21 -6
- data/doc/rest-api.txt +128 -55
- data/doc/rhoconnect-redis-stack.txt +120 -0
- data/doc/settings.txt +4 -12
- data/doc/source-adapters-intro.txt +28 -0
- data/doc/source-adapters.txt +235 -272
- data/doc/stats-middleware.txt +9 -29
- data/doc/supported-platforms.txt +21 -30
- data/doc/testing.txt +40 -42
- data/doc/tutorial.txt +72 -57
- data/examples/simple/Gemfile +1 -1
- data/examples/simple/application.rb +4 -5
- data/examples/simple/my_server.rb +2 -2
- data/examples/simple/settings/settings.yml +1 -1
- data/generators/rhoconnect.rb +151 -50
- data/generators/templates/application/Gemfile +1 -1
- data/generators/templates/application/Rakefile +3 -3
- data/generators/templates/application/config.ru +1 -4
- data/generators/templates/application/controllers/application_controller.rb +17 -0
- data/generators/templates/application/controllers/js/application_controller.js +14 -0
- data/generators/templates/application/controllers/ruby/application_controller.rb +17 -0
- data/generators/templates/application/package.json +8 -0
- data/generators/templates/application/rcgemfile +2 -5
- data/generators/templates/application/settings/settings.yml +3 -3
- data/generators/templates/application/spec/application_controller_spec.rb +23 -0
- data/generators/templates/application/spec/js_spec.rb +25 -0
- data/generators/templates/application/spec/spec_helper.rb +21 -7
- data/generators/templates/source/controllers/js/controller.js +7 -0
- data/generators/templates/source/controllers/ruby/controller.rb +8 -0
- data/generators/templates/source/controllers/ruby/controller_spec.rb +27 -0
- data/generators/templates/source/models/js/model.js +46 -0
- data/generators/templates/source/{source_adapter.rb → models/ruby/model.rb} +15 -10
- data/generators/templates/source/{source_spec.rb → models/ruby/model_spec.rb} +1 -1
- data/install.sh +5 -5
- data/installer/unix-like/create_texts.rb +2 -2
- data/installer/unix-like/rho_connect_install_constants.rb +2 -2
- data/installer/unix-like/rho_connect_install_utilities.rb +1 -1
- data/installer/utils/constants.rb +4 -4
- data/js-adapters/ballroom.js +216 -0
- data/js-adapters/node.rb +52 -0
- data/js-adapters/node_channel.rb +181 -0
- data/js-adapters/request.js +27 -0
- data/js-adapters/response.js +57 -0
- data/js-adapters/rhoconnect_helpers.js +60 -0
- data/js-adapters/router.js +60 -0
- data/js-adapters/server.js +5 -0
- data/lib/rhoconnect/api/app/ans_login.rb +3 -3
- data/lib/rhoconnect/api/app/bulk_data.rb +10 -10
- data/lib/rhoconnect/api/app/fast_delete.rb +11 -10
- data/lib/rhoconnect/api/app/fast_insert.rb +11 -10
- data/lib/rhoconnect/api/app/fast_update.rb +11 -10
- data/lib/rhoconnect/api/app/login.rb +5 -5
- data/lib/rhoconnect/api/app/push_deletes.rb +12 -11
- data/lib/rhoconnect/api/app/push_objects.rb +12 -11
- data/lib/rhoconnect/api/app/query.rb +8 -7
- data/lib/rhoconnect/api/app/queue_updates.rb +98 -94
- data/lib/rhoconnect/api/app/search.rb +8 -7
- data/lib/rhoconnect/api/client/client_get_db_doc.rb +5 -5
- data/lib/rhoconnect/api/client/client_set_db_doc.rb +8 -8
- data/lib/rhoconnect/api/client/create.rb +7 -7
- data/lib/rhoconnect/api/client/get_client_params.rb +4 -4
- data/lib/rhoconnect/api/client/list_client_docs.rb +17 -17
- data/lib/rhoconnect/api/client/register.rb +12 -12
- data/lib/rhoconnect/api/client/reset.rb +5 -5
- data/lib/rhoconnect/api/readstate/set_refresh_time.rb +9 -9
- data/lib/rhoconnect/api/source/get_source_params.rb +4 -4
- data/lib/rhoconnect/api/source/list_sources.rb +16 -16
- data/lib/rhoconnect/api/source/update_source_params.rb +6 -6
- data/lib/rhoconnect/api/store/get_db_doc.rb +4 -4
- data/lib/rhoconnect/api/store/set_db_doc.rb +7 -7
- data/lib/rhoconnect/api/system/get_adapter.rb +4 -4
- data/lib/rhoconnect/api/system/get_license_info.rb +8 -8
- data/lib/rhoconnect/api/system/login.rb +15 -15
- data/lib/rhoconnect/api/system/reset.rb +11 -11
- data/lib/rhoconnect/api/system/save_adapter.rb +4 -4
- data/lib/rhoconnect/api/system/stats.rb +22 -22
- data/lib/rhoconnect/api/user/create_user.rb +7 -7
- data/lib/rhoconnect/api/user/delete_client.rb +6 -6
- data/lib/rhoconnect/api/user/delete_user.rb +11 -10
- data/lib/rhoconnect/api/user/list_clients.rb +4 -4
- data/lib/rhoconnect/api/user/list_source_docs.rb +10 -10
- data/lib/rhoconnect/api/user/list_users.rb +3 -3
- data/lib/rhoconnect/api/user/ping.rb +3 -3
- data/lib/rhoconnect/api/user/show_user.rb +3 -3
- data/lib/rhoconnect/api/user/update_user.rb +5 -5
- data/lib/rhoconnect/api/user/user_get_db_doc.rb +5 -5
- data/lib/rhoconnect/api/user/user_set_db_doc.rb +10 -10
- data/lib/rhoconnect/api_token.rb +5 -6
- data/lib/rhoconnect/app.rb +6 -46
- data/lib/rhoconnect/application/init.rb +5 -2
- data/lib/rhoconnect/async.rb +76 -39
- data/lib/rhoconnect/bulk_data/bulk_data.rb +6 -4
- data/lib/rhoconnect/client.rb +59 -9
- data/lib/rhoconnect/condition/admin_required.rb +27 -0
- data/lib/rhoconnect/condition/client_required.rb +50 -0
- data/lib/rhoconnect/condition/login_required.rb +22 -0
- data/lib/rhoconnect/condition/source_required.rb +49 -0
- data/lib/rhoconnect/condition/verbs.rb +17 -0
- data/lib/rhoconnect/condition/verify_success.rb +19 -0
- data/lib/rhoconnect/controller/app_base.rb +74 -0
- data/lib/rhoconnect/controller/base.rb +68 -0
- data/lib/rhoconnect/controller/clients_controller.rb +79 -0
- data/lib/rhoconnect/controller/dynamic_adapter_controller.rb +93 -0
- data/lib/rhoconnect/controller/js_base.rb +124 -0
- data/lib/rhoconnect/controller/read_state_controller.rb +22 -0
- data/lib/rhoconnect/controller/source_adapter_base.rb +14 -0
- data/lib/rhoconnect/controller/sources_controller.rb +44 -0
- data/lib/rhoconnect/controller/store_controller.rb +25 -0
- data/lib/rhoconnect/controller/system_controller.rb +67 -0
- data/lib/rhoconnect/controller/users_controller.rb +99 -0
- data/lib/rhoconnect/db_adapter.rb +1 -3
- data/lib/rhoconnect/document.rb +159 -50
- data/lib/rhoconnect/handler/authenticate/execute_methods.rb +77 -0
- data/lib/rhoconnect/handler/authenticate/runner.rb +49 -0
- data/lib/rhoconnect/handler/authenticate.rb +3 -0
- data/lib/rhoconnect/handler/bulk_data.rb +28 -0
- data/lib/rhoconnect/handler/changes/engine.rb +271 -0
- data/lib/rhoconnect/handler/changes/execute_methods.rb +88 -0
- data/lib/rhoconnect/handler/changes/pass_through_runner.rb +11 -0
- data/lib/rhoconnect/handler/changes/runner.rb +53 -0
- data/lib/rhoconnect/handler/changes.rb +31 -0
- data/lib/rhoconnect/handler/helpers/auth_method.rb +29 -0
- data/lib/rhoconnect/handler/helpers/binding.rb +18 -0
- data/lib/rhoconnect/handler/helpers/bulk_data.rb +53 -0
- data/lib/rhoconnect/handler/helpers/source_job.rb +14 -0
- data/lib/rhoconnect/handler/helpers.rb +4 -0
- data/lib/rhoconnect/handler/plugin_callbacks/execute_methods.rb +99 -0
- data/lib/rhoconnect/handler/plugin_callbacks/runner.rb +28 -0
- data/lib/rhoconnect/handler/plugin_callbacks.rb +67 -0
- data/lib/rhoconnect/handler/query/engine.rb +93 -0
- data/lib/rhoconnect/handler/query/execute_methods.rb +21 -0
- data/lib/rhoconnect/handler/query/pass_through_runner.rb +35 -0
- data/lib/rhoconnect/handler/query/runner.rb +270 -0
- data/lib/rhoconnect/handler/query.rb +19 -0
- data/lib/rhoconnect/handler/search/engine.rb +60 -0
- data/lib/rhoconnect/handler/search/execute_methods.rb +32 -0
- data/lib/rhoconnect/handler/search/pass_through_runner.rb +18 -0
- data/lib/rhoconnect/handler/search/runner.rb +104 -0
- data/lib/rhoconnect/handler/search.rb +26 -0
- data/lib/rhoconnect/handler/sync.rb +29 -0
- data/lib/rhoconnect/jobs/source_job.rb +13 -4
- data/lib/rhoconnect/js_adapter.rb +79 -0
- data/lib/rhoconnect/license.rb +10 -2
- data/lib/rhoconnect/middleware/current_user.rb +14 -1
- data/lib/rhoconnect/middleware/helpers.rb +10 -93
- data/lib/rhoconnect/middleware/x_domain_session_wrapper.rb +1 -1
- data/lib/rhoconnect/model/base.rb +229 -0
- data/lib/rhoconnect/model/dynamic_adapter_model.rb +90 -0
- data/lib/rhoconnect/model/js_base.rb +121 -0
- data/lib/rhoconnect/ping/android.rb +1 -1
- data/lib/rhoconnect/predefined_adapters/bench_adapter.rb +7 -4
- data/lib/rhoconnect/read_state.rb +3 -3
- data/lib/rhoconnect/server.rb +159 -190
- data/lib/rhoconnect/source.rb +100 -11
- data/lib/rhoconnect/stats/record.rb +10 -10
- data/lib/rhoconnect/store.rb +905 -591
- data/lib/rhoconnect/{model.rb → store_orm.rb} +53 -115
- data/lib/rhoconnect/tasks.rb +18 -4
- data/lib/rhoconnect/test_methods.rb +30 -17
- data/lib/rhoconnect/user.rb +35 -17
- data/lib/rhoconnect/utilities.rb +1 -1
- data/lib/rhoconnect/version.rb +2 -2
- data/lib/rhoconnect/web-console/server.rb +29 -14
- data/lib/rhoconnect/web-console/views/home.js +10 -10
- data/lib/rhoconnect/web-console/views/new_ping.js +1 -1
- data/lib/rhoconnect.rb +120 -51
- data/rhoconnect.gemspec +4 -3
- data/spec/api/api_helper.rb +1 -6
- data/spec/api/app/fast_delete_spec.rb +4 -4
- data/spec/api/app/fast_insert_spec.rb +4 -4
- data/spec/api/app/fast_update_spec.rb +8 -8
- data/spec/api/app/push_deletes_spec.rb +2 -2
- data/spec/api/app/push_objects_spec.rb +5 -5
- data/spec/api/client/client_get_db_doc_spec.rb +6 -4
- data/spec/api/client/client_set_db_doc_spec.rb +3 -2
- data/spec/api/client/get_client_params_spec.rb +14 -0
- data/spec/api/client/list_client_docs_spec.rb +30 -20
- data/spec/api/client/reset_spec.rb +36 -0
- data/spec/api/source/get_source_params_spec.rb +23 -17
- data/spec/api/system/get_license_info_spec.rb +0 -20
- data/spec/api/system/login_spec.rb +8 -0
- data/spec/api/system/reset_spec.rb +0 -1
- data/spec/api/system/stats_spec.rb +5 -5
- data/spec/api/user/create_user_spec.rb +14 -6
- data/spec/api/user/delete_user_spec.rb +20 -18
- data/spec/api/user/list_users_spec.rb +5 -6
- data/spec/api/user/update_user_spec.rb +5 -4
- data/spec/apps/rhotestapp/config.ru +16 -1
- data/spec/apps/rhotestapp/controllers/js/js_sample_controller.js +23 -0
- data/spec/apps/rhotestapp/controllers/js/sample2_controller.js +32 -0
- data/spec/apps/rhotestapp/controllers/ruby/application_controller.rb +21 -0
- data/spec/apps/rhotestapp/controllers/ruby/sample_adapter_controller.rb +8 -0
- data/spec/apps/rhotestapp/models/js/js_sample.js +55 -0
- data/spec/apps/rhotestapp/models/js/sample2.js +25 -0
- data/spec/apps/rhotestapp/{sources → models/ruby}/base_adapter.rb +0 -0
- data/spec/apps/rhotestapp/{sources → models/ruby}/fixed_schema_adapter.rb +0 -0
- data/spec/apps/rhotestapp/{sources → models/ruby}/other_adapter.rb +0 -0
- data/spec/apps/rhotestapp/{sources → models/ruby}/sample_adapter.rb +0 -0
- data/spec/apps/rhotestapp/{sources → models/ruby}/simple_adapter.rb +2 -2
- data/spec/apps/rhotestapp/{sources → models/ruby}/sub_adapter.rb +0 -0
- data/spec/apps/rhotestapp/settings/settings.yml +0 -1
- data/spec/bulk_data/bulk_data_spec.rb +20 -5
- data/spec/cli/cli_spec.rb +83 -0
- data/spec/client_spec.rb +20 -17
- data/spec/client_sync_spec.rb +244 -406
- data/spec/controllers/js_base_spec.rb +89 -0
- data/spec/doc/doc_spec.rb +18 -18
- data/spec/document_spec.rb +29 -13
- data/spec/dynamic_adapter_spec.rb +6 -6
- data/spec/generator/generator_spec.rb +7 -4
- data/spec/jobs/bulk_data_job_spec.rb +14 -10
- data/spec/jobs/source_job_spec.rb +8 -8
- data/spec/license_spec.rb +5 -2
- data/spec/models/js_model_spec.rb +39 -0
- data/spec/node_spec.rb +42 -0
- data/spec/perf/store_perf_spec.rb +67 -12
- data/spec/ping/android_spec.rb +1 -1
- data/spec/read_state_spec.rb +1 -1
- data/spec/rhoconnect_spec.rb +1 -1
- data/spec/server/cors_spec.rb +14 -18
- data/spec/server/server_spec.rb +265 -88
- data/spec/server/stats_spec.rb +1 -1
- data/spec/source_adapter_spec.rb +54 -27
- data/spec/source_spec.rb +8 -3
- data/spec/source_sync_spec.rb +538 -468
- data/spec/spec_helper.rb +35 -4
- data/spec/stats/record_spec.rb +10 -10
- data/spec/{model_spec.rb → store_orm_spec.rb} +56 -54
- data/spec/store_spec.rb +159 -179
- data/spec/support/shared_examples.rb +36 -27
- data/spec/sync_states_spec.rb +40 -33
- data/spec/test_methods_spec.rb +18 -14
- data/spec/user_spec.rb +17 -30
- metadata +156 -52
- data/bench/benchapp/application.rb +0 -39
- data/bench/blobapp/application.rb +0 -44
- data/commands/rhoconnect/clean_start.rb +0 -9
- data/commands/rhoconnect/create_user.rb +0 -18
- data/commands/rhoconnect/delete_device.rb +0 -9
- data/commands/rhoconnect/delete_user.rb +0 -8
- data/commands/rhoconnect/reset.rb +0 -16
- data/commands/rhoconnect/reset_refresh.rb +0 -11
- data/generators/templates/application/application.rb +0 -43
- data/lib/rhoconnect/client_sync.rb +0 -434
- data/lib/rhoconnect/dynamic_adapter.rb +0 -91
- data/lib/rhoconnect/middleware/admin_user.rb +0 -23
- data/lib/rhoconnect/middleware/current_request.rb +0 -16
- data/lib/rhoconnect/middleware/login_required.rb +0 -22
- data/lib/rhoconnect/source_adapter.rb +0 -132
- data/lib/rhoconnect/source_sync.rb +0 -464
- data/spec/apps/rhotestapp/application.rb +0 -23
@@ -0,0 +1,200 @@
|
|
1
|
+
Setting Up for RhoConnect Push Service on Client Application
|
2
|
+
===
|
3
|
+
|
4
|
+
RhoConnect Push Service is a separate process that will run on your machine and broker push messages between your RhoConnect server and registered Android and Windows Mobile/CE devices.
|
5
|
+
|
6
|
+
This chapter contains the steps you need to set up your registered Android or Windows Mobile/CE client and RhoConnect server for RhoConnect Push Service. After you perform the steps in this chapter, you will finish by performing the [client setup that is needed for all platforms](/rhoconnect/push-client-setup).
|
7
|
+
|
8
|
+
**NOTE: If you are setting up standard RhoConnect Push on Android, you do not perform the steps in this chapter. Perform the steps in [RhoConnect Push for Android setup](/rhoconnect/push-client-setup-android) instead.**
|
9
|
+
|
10
|
+
## Setting up RhoConnect Push Service on the Server
|
11
|
+
|
12
|
+
RhoConnect v3.3 introduces the RhoConnect Push Service (RPS) which supports efficient messaging for both Android and Windows Mobile. This service can be used instead of Google GCM on Android.
|
13
|
+
|
14
|
+
The typical flow of a message using RPS:
|
15
|
+
|
16
|
+
Device RPS RhoConnect Backend App
|
17
|
+
+ + + +
|
18
|
+
| | | |
|
19
|
+
| | | POST |
|
20
|
+
| | POST |/rc/v1/users/ping|
|
21
|
+
| |/instanceId |<----------------+
|
22
|
+
| |<-----------+ |
|
23
|
+
|<----------+ | |
|
24
|
+
|{"content"}| | |
|
25
|
+
| | | |
|
26
|
+
+ + + +
|
27
|
+
|
28
|
+
### Download and Install Nodejs
|
29
|
+
|
30
|
+
If you are using a Macintosh, go to the [Node.js website](http://nodejs.org/#), and download and install Node.js. (Motorola RhoMobile Suite for Windows includes Node.js in its installation.)
|
31
|
+
|
32
|
+
### Starting the Push Service
|
33
|
+
|
34
|
+
RhoConnect Push Service is a separate process that will run on your machine and broker push messages between your RhoConnect server and registered devices.
|
35
|
+
|
36
|
+
Assuming you've installed the latest [RhoMobile Suite](http://www.motorola.com/Business/US-EN/RhoMobile%20Suite/Downloads), start redis by runing the following command:
|
37
|
+
|
38
|
+
:::term
|
39
|
+
$ rhoconnect redis-start
|
40
|
+
|
41
|
+
Now start RhoConnect push by running the following command:
|
42
|
+
|
43
|
+
:::term
|
44
|
+
$ rhoconnect-push
|
45
|
+
RhoConnect push server started...
|
46
|
+
|
47
|
+
You can also start the server with more verbose logging (see next section for more details):
|
48
|
+
|
49
|
+
:::term
|
50
|
+
$ rhoconnect-push -d 3
|
51
|
+
|
52
|
+
Next, make sure you have the following option in your RhoConnect application's `settings/settings.yml` file in the `:development:`, `:production:` and `:test:` sections:
|
53
|
+
|
54
|
+
:::yaml
|
55
|
+
:push_server: http://someappname@localhost:8675/
|
56
|
+
|
57
|
+
Where you edit `someappname` to be a shared secret name between your RhoConnect application and your mobile application.
|
58
|
+
|
59
|
+
**NOTE: This shared secret name ensures that only your RhoConnect application can send push messages to the RPS instance you started up in the previous step. Use this shared secret name in your [mobile app's 'rhoconnect_push_appname' setting](/rhoconnect/push-client-setup-rps#configuring-rhoconfigtxt).**
|
60
|
+
|
61
|
+
Now setup [push notifications](/rhoconnect/push-client-setup#configuring-a-rhodes-application-to-receive-push-with-rhoconnect-push-service) in your Android or Windows Mobile RhoElements application, then start up your RhoConnect application.
|
62
|
+
|
63
|
+
### Configuring RhoConnect Push
|
64
|
+
|
65
|
+
You can control basic settings for RhoConnect push using command line arguments.
|
66
|
+
|
67
|
+
:::term
|
68
|
+
$ rhoconnect-push --help
|
69
|
+
|
70
|
+
Usage: rhoconnect-push [options]
|
71
|
+
|
72
|
+
Available options:
|
73
|
+
-c, --config FILE Path to configuration (config.json) file
|
74
|
+
-d, --debug LEVEL Specify server debug level: 0 (errors) - 3 (everything)
|
75
|
+
-e, --rcPort PORT Specify RhoConnect instance port
|
76
|
+
-h, --help Print this help message
|
77
|
+
-i, --rcHost HOST Host for the RhoConnect instance
|
78
|
+
-k, --keyFile FILE Path to private SSL keyfile (https only)
|
79
|
+
-p, --port Run the server on this port (defaults to 8675)
|
80
|
+
-r, --redis REDIS Redis connection string (i.e. redis://localhost:6379)
|
81
|
+
-s, --httpSecure Specify if this server is running over https or http
|
82
|
+
-t, --timeout TIMEOUT Time (in ms) before timeout is sent to client
|
83
|
+
-T, --registrationTimeout Expiration limit for client registration tokens
|
84
|
+
-v, --version Display server version
|
85
|
+
|
86
|
+
### Configuring and Running with config.json Advanced Options
|
87
|
+
|
88
|
+
You can also configure more advanced settings in RhoConnect push by creating a config.json file.
|
89
|
+
|
90
|
+
:::json
|
91
|
+
{
|
92
|
+
"httpSecure": "n",
|
93
|
+
"devAuthHost": "localhost",
|
94
|
+
"devAuthUrl": "/rc/v1/app/ans_login",
|
95
|
+
"devAuthPort": "9292",
|
96
|
+
"userAuthHost": "localhost",
|
97
|
+
"userAuthUrl": "/rc/v1/app/ans_login",
|
98
|
+
"userAuthPort": "9292",
|
99
|
+
"appAuthHost": "localhost",
|
100
|
+
"appAuthUrl": "/rc/v1/app/ans_login",
|
101
|
+
"appAuthPort": "9292",
|
102
|
+
"ansResponseTimeout": "300000",
|
103
|
+
"ansServerPort": "8675",
|
104
|
+
"registrationTimeout": "2592000",
|
105
|
+
"clearDataBase": "n",
|
106
|
+
"socketPoolSize": 1,
|
107
|
+
"debugLevel": "3"
|
108
|
+
}
|
109
|
+
|
110
|
+
To start the server using a config.json file, run the following command.
|
111
|
+
|
112
|
+
:::term
|
113
|
+
$ rhoconnect-push -c /path/to/config.json
|
114
|
+
|
115
|
+
The JSON file has the following parameters.
|
116
|
+
|
117
|
+
* `httpSecure` - Specify whether the push server will be an https or http server (y/n).
|
118
|
+
* `devAuthHost` - RhoConnect instance used to handle device credentials.
|
119
|
+
* `devAuthUrl` - Path used on the RhoConnect instance to handle device credentials.
|
120
|
+
* `devAuthPort` - Port used on the RhoConnect instance to handle device credentials.
|
121
|
+
* `userAuthHost` - RhoConnect instance used to handle user credentials.
|
122
|
+
* `userAuthUrl` - Path used on the RhoConnect instance to handle user credentials.
|
123
|
+
* `userAuthPort` - Port used on the RhoConnect instance to handle user credentials.
|
124
|
+
* `appAuthHost` - RhoConnect instance used to handle application credentials.
|
125
|
+
* `appAuthUrl` - Path used on the RhoConnect instance to handle application credentials.
|
126
|
+
* `appAuthPort` - Port used on the RhoConnect instance to handle application credentials.
|
127
|
+
* `ansResponseTimeout` - Time (in ms) that the push server will allow a message request from the client to go without a response. Upon expiration of this time, a 204 response will be issued and the request will be considered satisfied. If this parameter is set to 0, then this time limit will not be in effect - there is no limit to how long a client request will go without a response.
|
128
|
+
* `ansServerPort` - Push server listening port
|
129
|
+
* `registrationTimeout` - Expiration limit for registration tokens (in seconds), the client-side application is automatically unregistered if there is no activity related to its token for the registrationTimeout period. Activity related to its token consists of either attempted fetches of messages on its behalf by the push client or messages sent to the push server by RhoConnect.
|
130
|
+
* `clearDataBase` - Clear the redis database containing tokens, instanceIds, etc. at the start of the push server (y/n).
|
131
|
+
* `socketPoolSize` - The maximum number of sockets the push server will use when connecting to each of the authorization servers. This essentially caps the number of http requests to each authorization server that the push server can have outstanding at any given time.
|
132
|
+
* `debugLevel` - Print additional information to console to aid in debugging:
|
133
|
+
* 0 - print only error & warning info
|
134
|
+
* 1 - print error & warning info and message for each invoked ANS operation
|
135
|
+
* 2 - reserved for future use
|
136
|
+
* 3 - print everything
|
137
|
+
|
138
|
+
## Installing the rhoconnect-push-service Runtime Apps on the Mobile Device
|
139
|
+
|
140
|
+
To use the RhoConnect Push Service in your client application, you must install the rhoconnect-push-service runtime app(s) on your mobile device.
|
141
|
+
|
142
|
+
On the Macintosh, the rhoconnect-push-service runtime apps for Android and for Windows Mobile are located in the Motorola RhoMobile Suite installation package, in a folder called rhoconnect-push-service.
|
143
|
+
|
144
|
+
On Windows, the rhoconnect-push-service runtime apps for Android and for Windows Mobile are located in the Motorola RhoMobile Suite installation, in a directory called rhoconnect-push-service.
|
145
|
+
|
146
|
+
### Installing Runtime Apps on Android Device
|
147
|
+
|
148
|
+
If you are using an Android device, install `rhoconnect_push_service.apk` to your device. One way to do this is to connect your Android to your computer with a USB cable and use `adb install`. You can verify that your device is connected by executing:
|
149
|
+
|
150
|
+
$ adb devices
|
151
|
+
|
152
|
+
If connected, you’ll see the device name listed. If your computer doesn’t see the device, try killing the adb process first:
|
153
|
+
|
154
|
+
$ adb kill-server
|
155
|
+
|
156
|
+
Then navigate to the directory containing the runtime file and run `adb install`.
|
157
|
+
|
158
|
+
$ adb install <filename>.apk
|
159
|
+
|
160
|
+
### Installing Runtime Apps for Windows Mobile/CE Devices
|
161
|
+
|
162
|
+
If you are using a Windows Mobile or CE device, install the following runtime apps on your device.
|
163
|
+
|
164
|
+
* `rhoconnect-push-service.CAB`
|
165
|
+
* `NETCFv35.Messages.EN.wm.cab`
|
166
|
+
* `NETCFv35.Messages.EN.cab`
|
167
|
+
|
168
|
+
Connect your device to your Windows computer. You can use USB-cable, bluetooth or any other method. Start ActiveSync or Windows Mobile Device Center.
|
169
|
+
|
170
|
+
Manually copy the .cab files to the device. For example, you can use the device File Explorer to display the .cab files that are on the computer. Click on each .cab file and the installation process will be started; after it is finished, you should see the app icon on your device in Programs.
|
171
|
+
|
172
|
+
## Setting up the Rhodes Client for RhoConnect Push Service
|
173
|
+
|
174
|
+
To set up your Rhodes client application for RhoConnect Push Service, you configure rhoconfig.txt and build.yml.
|
175
|
+
|
176
|
+
### Configuring rhoconfig.txt
|
177
|
+
|
178
|
+
In your client application `rhoconfig.txt` file, set the following options to configure your RhoConnect Push Service.
|
179
|
+
|
180
|
+
syncserver = 'http://<hostname>:<port>/application'
|
181
|
+
rhoconnect_push_server = 'http://<hostname>:<port>'
|
182
|
+
rhoconnect_push_appname = 'someappname'
|
183
|
+
|
184
|
+
Next, your RhoConnect application should be running on a network that is accessible to your device. For example, you might have your RhoConnect application running on a LAN with IP 192.168.1.10, PORT 9292. Then make sure your device is connected to the same LAN.
|
185
|
+
|
186
|
+
Here is an example of setting `rhoconfig.txt` for the RhoConnect Push Service. The URLs used for the RhoConnect Push Service (rhoconnect_push_server) and the RhoConnect server are running on the same host.
|
187
|
+
|
188
|
+
syncserver = 'http://192.168.1.10:9292/application'
|
189
|
+
rhoconnect_push_server = 'http://192.168.1.10:8675'
|
190
|
+
rhoconnect_push_appname = 'someappname'
|
191
|
+
|
192
|
+
### Configuring build.yml
|
193
|
+
|
194
|
+
When you configure your application `build.yml` file for RhoConnect Push Service, do not add `push` under `capabilities`. Instead, add rhoconnect-push to extensions.
|
195
|
+
|
196
|
+
extensions: ["rhoconnect-push"]
|
197
|
+
|
198
|
+
## Finishing Client Setup
|
199
|
+
|
200
|
+
Once you have completed the above steps for setting up for RhoConnect Push Service on Android or Windows Mobile/CE client and RhoConnect server, you must still [perform the client setup that is needed for all platforms](/rhoconnect/push-client-setup).
|
data/doc/push-client-setup.txt
CHANGED
@@ -1,18 +1,22 @@
|
|
1
1
|
Setting Up for RhoConnect Push on Client Application
|
2
2
|
===
|
3
3
|
|
4
|
-
|
4
|
+
This chapter contains the final steps for setting up your Rhodes application for RhoConnect Push. You also need to perform the setup on client and server for your mobile device platform (if you have not done so already).
|
5
5
|
|
6
|
-
|
6
|
+
* [Setup for RhoConnect Push Service on client and server](/rhoconnect/push-client-setup-rps).
|
7
|
+
* [Setup for RhoConnect Push on client and server for Rhodes Android Client](/rhoconnect/push-client-setup-android).
|
8
|
+
* [Setup for RhoConnect Push on client and server for Rhodes Blackberry Client](/rhoconnect/push-client-setup-bb).
|
9
|
+
* [Setup for RhoConnect Push on client and server for Rhodes iOS Client](/rhoconnect/push-client-setup-ios).
|
7
10
|
|
8
|
-
|
11
|
+
## Configuring a Rhodes Application for RhoConnect Push
|
12
|
+
|
13
|
+
If you want your device to vibrate when it receives a push message, enable vibration in your Rhodes/RhoElements application in build.yml.
|
9
14
|
|
10
15
|
:::yaml
|
11
16
|
capabilities:
|
12
|
-
- push
|
13
17
|
- vibrate #=> if you want to enable vibrate in your push messages
|
14
18
|
|
15
|
-
Set up your application [rhoconfig.txt](configuration#run-time-configuration) syncserver to point to your RhoConnect server:
|
19
|
+
Set up your application [rhoconfig.txt](/rhodes/configuration#run-time-configuration) syncserver to point to your RhoConnect server:
|
16
20
|
|
17
21
|
syncserver = 'http://<rhoconnect_server_url>/application'
|
18
22
|
|
@@ -39,6 +43,15 @@ To have your Rhodes app automatically perform the operations listed in the push
|
|
39
43
|
"rho_push"
|
40
44
|
end
|
41
45
|
|
46
|
+
To get push messages from RhoConnect server, the user must be logged into the RhoConnect server.
|
47
|
+
|
48
|
+
In application.rb:
|
49
|
+
|
50
|
+
:::ruby
|
51
|
+
if SyncEngine::logged_in > 0
|
52
|
+
System.set_push_notification("/app/Settings/your_rhoconnect_callback",'')
|
53
|
+
end
|
54
|
+
|
42
55
|
## Understanding the Rhodes Push Message Payload
|
43
56
|
|
44
57
|
From Rhodes 2.0.4 on, the callback push message parameters are in the form of a hash. This hash contains parameters and values for the operation to perform. If the parameter for that operation is not listed, the operation is not performed.
|
@@ -48,84 +61,68 @@ The hash payload may include the parameters of alert, do_sync, sound, and vibrat
|
|
48
61
|
:::text
|
49
62
|
alert=some message here&sound=alert.mp3&vibrate=2000&do_sync=product,customer
|
50
63
|
|
51
|
-
To sync all the sources with do_sync, the source name list would specified as 'all' in the ping call, instead of 'product,customer' as in this example.
|
52
|
-
|
53
|
-
The sound file should be included in the Rhodes application bundle in the `/public/alerts` folder.
|
54
|
-
|
55
|
-
## Setting up the Rhodes Client for iPhone, Android, and Blackberry
|
56
|
-
|
57
|
-
To set up your Rhodes client for push, refer to these links for your respective platforms.
|
58
|
-
|
59
|
-
* [Setting up iPhone Client for Push](/rhodes/device-caps#iphone-push-setup)
|
60
|
-
* [Setting up Android Client for Push](/rhodes/device-caps#android-push-setup)
|
61
|
-
* [Setting up Blackberry Client for Push](/rhodes/device-caps#blackberry-push-setup)
|
62
|
-
|
63
|
-
## Configuring a Rhodes Application to Receive Push with RhoConnect Push Service
|
64
|
-
|
65
|
-
RhoConnect Push Service is a separate process that will run on your machine and broker push messages between your RhoConnect server and registered Android and Windows Mobile/CE devices.
|
66
|
-
|
67
|
-
NOTE: You do not perform the setup steps in the Rhodes Device Capabilities chapter when you use the RhoConnect Server Push Service. That setup is for regular RhoConnect push, not for the RhoConnect Server Push Service.
|
64
|
+
To sync all the sources with do_sync, the source name list would be specified as 'all' in the ping call, instead of 'product,customer' as in this example.
|
68
65
|
|
69
|
-
|
66
|
+
The Rhodes push payload allows more than one operation in a single message.
|
67
|
+
|
68
|
+
There are no required operations. There are default operations - if operation is not specified, no default operation will be performed.
|
70
69
|
|
71
|
-
|
70
|
+
Payload may include following operations which client will perform when it receives the PUSH message:
|
72
71
|
|
73
|
-
|
72
|
+
do_sync - do sync on spec specified sync source; use "all" to sync all sources
|
73
|
+
:::ruby
|
74
|
+
# one or more sources, or "all" can be specified
|
75
|
+
do_sync = "Product,Customer"
|
74
76
|
|
75
|
-
|
77
|
+
alert - bring app upfront and show specified message
|
78
|
+
:::ruby
|
79
|
+
alert = "Some message"
|
76
80
|
|
77
|
-
|
81
|
+
vibrate - vibrate for the specified number of milliseconds, up to 25500; if 0 or no duration is specified, it will vibrate for 2500 millisecond.
|
78
82
|
|
79
|
-
|
83
|
+
To enable vibrate in your rhodes application in build.yml:
|
80
84
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
In your client application `rhoconfig.txt` file, set the following options to configure your RhoConnect Push Service.
|
88
|
-
|
89
|
-
syncserver = 'http://<hostname>:<port>/application'
|
90
|
-
rhoconnect_push_server = 'http://<hostname>:<port>'
|
91
|
-
rhoconnect_push_appname = 'someappname'
|
92
|
-
|
93
|
-
Next, your RhoConnect application should be running on a network that is accessible to your device. For example, you might have your RhoConnect application running on a LAN with IP 192.168.1.10, PORT 9292. Then make sure your device is connected to the same LAN and set up your application rhoconfig.txt syncserver as follows:
|
94
|
-
|
95
|
-
Here is an example of setting `rhoconfig.txt` for the RhoConnect Push Service. The URLs used for the RhoConnect Push Service (rhoconnect_push_server) and the RhoConnect server running on the same host.
|
96
|
-
|
97
|
-
syncserver = 'http://192.168.1.10:9292/application'
|
98
|
-
rhoconnect_push_server = 'http://192.168.1.10:8675'
|
99
|
-
rhoconnect_push_appname = 'someappname'
|
100
|
-
|
101
|
-
### Configuring build.yml
|
85
|
+
capabilities:
|
86
|
+
- vibrate
|
87
|
+
|
88
|
+
Example of vibrate call:
|
89
|
+
|
90
|
+
vibrate = 2000 #=> duration in milliseconds
|
102
91
|
|
103
|
-
|
92
|
+
sound - play specified file if media type supported by the phone. iPhone will ignore media-type parameter.
|
93
|
+
:::ruby
|
94
|
+
sound = "hello.mp3"
|
104
95
|
|
105
|
-
|
96
|
+
The sound file should be included to the application bundle in `/public/alerts` folder.
|
106
97
|
|
107
|
-
|
98
|
+
Media type should be either specified explicitly or may be recognized from file extension. Known file extensions are: .mp3 - audio/mpeg; .wav - audio/x-wav.
|
108
99
|
|
109
|
-
|
110
|
-
- vibrate #=> if you want to enable vibrate in your push messages
|
100
|
+
## Handling Push Notifications from a non-RhoConnect Application
|
111
101
|
|
112
|
-
|
102
|
+
Rhodes applications can also handle PUSH notifications that didn't come from a RhoConnect application.
|
113
103
|
|
114
|
-
|
104
|
+
In this example, we will get the device ID so we can register the device with some push server:
|
105
|
+
:::ruby
|
106
|
+
System.get_property('device_id')
|
115
107
|
|
116
|
-
|
108
|
+
Application can set push callback to process any commands from server:
|
109
|
+
:::ruby
|
110
|
+
System.set_push_notification("/app/Settings/push_notify", '')
|
117
111
|
|
118
|
-
|
112
|
+
Callback parameters:
|
119
113
|
|
120
|
-
|
121
|
-
|
122
|
-
System.set_push_notification("/app/Settings/your_rhoconnect_callback",'')
|
123
|
-
end
|
114
|
+
* since Rhodes 2.0.4 : contain push message parameters as hash
|
115
|
+
* rhodes < 2.0.4 : message - contain server push message body
|
124
116
|
|
125
|
-
|
117
|
+
Callback return:
|
126
118
|
|
127
|
-
|
119
|
+
* empty string - do not run Rhodes push command processing
|
120
|
+
* "rho_push" - to run rhodes push command processing (for alerts, sounds, etc...)
|
128
121
|
|
129
|
-
|
122
|
+
Example:
|
123
|
+
:::ruby
|
124
|
+
def push_notify
|
125
|
+
puts 'push_notify: ' + @params.inspect
|
126
|
+
"rho_push"
|
127
|
+
end
|
130
128
|
|
131
|
-
Refer to [Rhodes Device Capabilities - Push Notifications - Push Payload](/rhodes/device-caps#push-payload) for more information about setting up the push payload.
|
data/doc/push-server-setup.txt
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
Setting Up Push on RhoConnect Server
|
2
2
|
===
|
3
3
|
|
4
|
-
To set up your RhoConnect server application for delivering push messages, you need to
|
4
|
+
To set up your RhoConnect server application for delivering push messages, you need to either:
|
5
|
+
|
6
|
+
* set up to deliver push messages in your RhoConnect server application settings for the operating system of your mobile client,
|
7
|
+
* or set up the RhoConnect Push Service to broker push messages between your RhoConnect server and your mobile client.
|
5
8
|
|
6
9
|
## Setting up RhoConnect Server Push for iOS
|
7
10
|
|
@@ -53,8 +56,6 @@ Update `settings/settings.yml` to include your GCM API key:
|
|
53
56
|
:licensefile: settings/license.key
|
54
57
|
:gcm_api_key: your_gcm_api_key_here
|
55
58
|
|
56
|
-
Start up your RhoConnect application and setup [push notifications](/rhodes/device-caps#push-notifications) in your Rhodes application.
|
57
|
-
|
58
59
|
## Setting up RhoConnect Server Push for Android (C2DM)
|
59
60
|
|
60
61
|
**NOTE: Google has officially deprecated the C2DM service and requires that you now use Google Cloud Messaging (GCM). Please see [Google's announcement](https://developers.google.com/android/c2dm/) for more details. Follow the instructions at [Setting up RhoConnect Server Push for Android (GCM)](/rhoconnect/push-server-setup#setting-up-rhoconnect-server-push-for-android-gcm) to set up your RhoConnect Application for GCM push.**
|
@@ -75,18 +76,14 @@ For this purpose, you can specify C2DM Google account's username/password combo
|
|
75
76
|
At run-time, the system will use these credentials to obtain the C2DM token and store it in the Redis for the future use.
|
76
77
|
Once the token is expired, the system will automatically connect to the Google C2DM service to renew the token.
|
77
78
|
|
78
|
-
Alternatively, you can use `:authtoken` setting to specify the pre-defined authentication token. This token MUST be related to the role-based google account registered for your application. See [the
|
79
|
+
Alternatively, you can use `:authtoken` setting to specify the pre-defined authentication token. This token MUST be related to the role-based google account registered for your application. See [the Rhodes client push instructions](/rhoconnect/push-client-setup-android#setting-up-the-rhodes-client-for-android-c2dm) for more details. To retrieve this token, use sample script [c2dm.rb](http://github.com/rhomobile/rhodes/blob/master/bin/c2dm.rb). Uncomment last two lines and put your google account specific data, then run it. It will print token to stdout.
|
79
80
|
However, this approach will not allow the server to connect to the C2DM service and renew the token once it is expired.
|
80
81
|
|
81
82
|
For those who interested in what this token means, the description is [here](http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html).
|
82
83
|
|
83
|
-
|
84
|
-
|
85
|
-
## Setting up RhoConnect Server Push Service
|
86
|
-
|
87
|
-
**NOTE: This option is still a _beta_ feature. You may encounter issues using this service.**
|
84
|
+
## Setting up RhoConnect Push Service
|
88
85
|
|
89
|
-
RhoConnect v3.3 introduces the RhoConnect Push Service (RPS) which supports efficient messaging for both Android and Windows Mobile. This service can be used instead of Google C2DM on Android.
|
86
|
+
RhoConnect v3.3 introduces the RhoConnect Push Service (RPS) which supports efficient messaging for both Android and Windows Mobile. This service can be used instead of Google GCM or C2DM on Android.
|
90
87
|
|
91
88
|
The typical flow of a message using RPS:
|
92
89
|
|
@@ -110,7 +107,59 @@ If you are using a Macintosh, go to the [Node.js website](http://nodejs.org/#),
|
|
110
107
|
|
111
108
|
RhoConnect Push Service is a separate process that will run on your machine and broker push messages between your RhoConnect server and registered devices.
|
112
109
|
|
113
|
-
|
110
|
+
Assuming you've installed the latest [RhoMobile Suite](http://www.motorola.com/Business/US-EN/RhoMobile%20Suite/Downloads), start redis by runing the following command:
|
111
|
+
|
112
|
+
:::term
|
113
|
+
$ rhoconnect redis-start
|
114
|
+
|
115
|
+
Now start RhoConnect push by running the following command:
|
116
|
+
|
117
|
+
:::term
|
118
|
+
$ rhoconnect-push
|
119
|
+
RhoConnect push server started...
|
120
|
+
|
121
|
+
You can also start the server with more verbose logging (see next section for more details):
|
122
|
+
|
123
|
+
:::term
|
124
|
+
$ rhoconnect-push -d 3
|
125
|
+
|
126
|
+
Next, make sure you have the following option in your RhoConnect application's `settings/settings.yml` file in the `:development:`, `:production:` and `:test:` sections:
|
127
|
+
|
128
|
+
:::yaml
|
129
|
+
:push_server: http://someappname@localhost:8675/
|
130
|
+
|
131
|
+
Where you edit `someappname` to be a shared secret name between your RhoConnect application and your mobile application.
|
132
|
+
|
133
|
+
**NOTE: This shared secret name ensures that only your RhoConnect application can send push messages to the RPS instance you started up in the previous step. Use this shared secret name in your [mobile app's 'rhoconnect_push_appname' setting](/rhoconnect/push-client-setup-rps#configuring-rhoconfigtxt).**
|
134
|
+
|
135
|
+
Now setup [push notifications](/rhoconnect/push-client-setup#configuring-a-rhodes-application-to-receive-push-with-rhoconnect-push-service) in your Android or Windows Mobile RhoElements application, then start up your RhoConnect application.
|
136
|
+
|
137
|
+
#### Configuring RhoConnect Push
|
138
|
+
|
139
|
+
You can control basic settings for RhoConnect push using command line arguments.
|
140
|
+
|
141
|
+
:::term
|
142
|
+
$ rhoconnect-push --help
|
143
|
+
|
144
|
+
Usage: rhoconnect-push [options]
|
145
|
+
|
146
|
+
Available options:
|
147
|
+
-c, --config FILE Path to configuration (config.json) file
|
148
|
+
-d, --debug LEVEL Specify server debug level: 0 (errors) - 3 (everything)
|
149
|
+
-e, --rcPort PORT Specify RhoConnect instance port
|
150
|
+
-h, --help Print this help message
|
151
|
+
-i, --rcHost HOST Host for the RhoConnect instance
|
152
|
+
-k, --keyFile FILE Path to private SSL keyfile (https only)
|
153
|
+
-p, --port Run the server on this port (defaults to 8675)
|
154
|
+
-r, --redis REDIS Redis connection string (i.e. redis://localhost:6379)
|
155
|
+
-s, --httpSecure Specify if this server is running over https or http
|
156
|
+
-t, --timeout TIMEOUT Time (in ms) before timeout is sent to client
|
157
|
+
-T, --registrationTimeout Expiration limit for client registration tokens
|
158
|
+
-v, --version Display server version
|
159
|
+
|
160
|
+
#### Configuring and Running with config.json Advanced Options
|
161
|
+
|
162
|
+
You can also configure more advanced settings in RhoConnect push by creating a config.json file.
|
114
163
|
|
115
164
|
:::json
|
116
165
|
{
|
@@ -132,6 +181,11 @@ First, create a file called "config.json" with the following content:
|
|
132
181
|
"debugLevel": "3"
|
133
182
|
}
|
134
183
|
|
184
|
+
To start the server using a config.json file, run the following command.
|
185
|
+
|
186
|
+
:::term
|
187
|
+
$ rhoconnect-push -c /path/to/config.json
|
188
|
+
|
135
189
|
The JSON file has the following parameters.
|
136
190
|
|
137
191
|
* `httpSecure` - Specify whether the push server will be an https or http server (y/n).
|
@@ -155,33 +209,6 @@ The JSON file has the following parameters.
|
|
155
209
|
* 2 - reserved for future use
|
156
210
|
* 3 - print everything
|
157
211
|
|
158
|
-
|
159
|
-
Assuming you've installed the latest [RhoMobile Suite](http://www.motorola.com/Business/US-EN/RhoMobile%20Suite/Downloads), start redis.
|
160
|
-
|
161
|
-
:::term
|
162
|
-
$ rhoconnect redis-start
|
163
|
-
|
164
|
-
Now start RhoConnect Push by running the following in a command line:
|
165
|
-
|
166
|
-
:::term
|
167
|
-
$ rhoconnect-push -c /path/to/your/config.json
|
168
|
-
|
169
|
-
For example:
|
170
|
-
|
171
|
-
:::term
|
172
|
-
$ rhoconnect-push -c C:/dev/config.json
|
173
|
-
|
174
|
-
Next, make sure you have the following option in your RhoConnect application's `settings/settings.yml` file in the `:development:`, `:production:` and `:test:` sections:
|
175
|
-
|
176
|
-
:::yaml
|
177
|
-
:push_server: http://someappname@localhost:8675/
|
178
|
-
|
179
|
-
Where `someappname` is a shared secret between your RhoConnect application and your mobile application.
|
180
|
-
|
181
|
-
**NOTE: This ensures that only your RhoConnect application can send push messages to the RPS instance you started up in the previous step. Use this in your [mobile app's 'rhoconnect_push_appname' setting](/rhoconnect/push-client-setup#configuring-a-rhodes-application-to-receive-push-with-rhoconnect-push-service). **
|
182
|
-
|
183
|
-
Now setup [push notifications](/rhoconnect/push-client-setup#configuring-a-rhodes-application-to-receive-push-with-rhoconnect-push-service) in your Android or Windows Mobile RhoElements application, then start up your RhoConnect application.
|
184
|
-
|
185
212
|
## Testing Push in the RhoConnect Web Console
|
186
213
|
|
187
214
|
The [RhoConnect Web Console](/rhoconnect/web-console) includes a utility for testing push to make sure everything is wired up correctly.
|
@@ -194,13 +221,13 @@ Next, once you've logged into the web console, navigate to the user's page you u
|
|
194
221
|
|
195
222
|
You should see a registered device for this user, for example: "c92e36874bc74f39a8fbd7c1a86f9e0e". Click on the link for this device and you will see the device attributes:
|
196
223
|
|
197
|
-
|
224
|
+
device_type: APPLE
|
198
225
|
device_pin: 10fd92abfa8ee48155d9af6e7329086322b323fd0d18fdbd19e92d03c0fef7c8
|
199
226
|
device_port: 100
|
200
227
|
user_id: t
|
201
228
|
app_id: application
|
202
229
|
|
203
|
-
**NOTE: If you don't see all of these attributes, then something is incorrect in your Rhodes application settings. Please verify you followed the [Rhodes application push setup](/
|
230
|
+
**NOTE: If you don't see all of these attributes, then something is incorrect in your Rhodes application settings. Please verify you followed the [Rhodes application push setup](/rhoconnect/push-client-setup).**
|
204
231
|
|
205
232
|
Now that the device is registered, go back to the user page and click 'Ping User'.
|
206
233
|
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Testing Push in the RhoConnect Web Console
|
2
|
+
===
|
3
|
+
|
4
|
+
The [RhoConnect Web Console](/rhoconnect/web-console) includes a utility for testing push to make sure everything is wired up correctly.
|
5
|
+
|
6
|
+
First, make sure you've logged in and performed a sync on the device/simulator you are going to test.
|
7
|
+
|
8
|
+
Next, once you've logged into the web console, navigate to the user's page you used to login in the Rhodes application. For example, if you logged in as user 't', the url would be:
|
9
|
+
|
10
|
+
http://localhost:9292/console/user?user_id=t
|
11
|
+
|
12
|
+
You should see a registered device for this user, for example: "c92e36874bc74f39a8fbd7c1a86f9e0e". Click on the link for this device and you will see the device attributes:
|
13
|
+
|
14
|
+
device_type: APPLE
|
15
|
+
device_pin: 10fd92abfa8ee48155d9af6e7329086322b323fd0d18fdbd19e92d03c0fef7c8
|
16
|
+
device_port: 100
|
17
|
+
user_id: t
|
18
|
+
app_id: application
|
19
|
+
|
20
|
+
**NOTE: If you don't see all of these attributes, then something is incorrect in your Rhodes application settings. Please verify you followed the [Rhodes application push setup](/rhoconnect/push-client-setup).**
|
21
|
+
|
22
|
+
Now that the device is registered, go back to the user page and click 'Ping User'.
|
23
|
+
|
24
|
+
Here you can specify an alert message, sources array to sync, badge value (iOS only), sound file to play, and duration to vibrate.
|
25
|
+
|
26
|
+
Enter in some values or try the defaults, you should see a push message on the device when you click "Ping!".
|
27
|
+
|
28
|
+
By default, the sources list will be a comma-separated list of your RhoConnect application's sources. This sources list will be sent in the push message to trigger a sync. You can specify one or more sources, or 'all' to trigger a sync of all sources.
|
29
|
+
|
data/doc/push.txt
CHANGED
@@ -3,12 +3,27 @@ Push Synchronization
|
|
3
3
|
|
4
4
|
Use push synchronization when you want to automatically detect changes on the RhoConnect side, and you want to push those changes to your client without having to tell your client to sync.
|
5
5
|
|
6
|
-
RhoConnect has a simple ruby API for sending push notifications (a ping call) to a user's devices. This API can be called directly, queued as a resque job, or called remotely via the [RhoConnect REST API](/rhoconnect/rest-api). The push message can trigger the following actions in the
|
6
|
+
RhoConnect has a simple ruby API for sending push notifications (a ping call) to a user's devices. This API can be called directly, queued as a resque job, or called remotely via the [RhoConnect REST API](/rhoconnect/rest-api). The push message can trigger the following actions in the Rhodes application: alert with a message, sync one or more sources, vibrate, display a badge, and play a sound file.
|
7
7
|
|
8
|
-
The following sections show how to use the RhoConnect application to deliver push messages
|
8
|
+
The following sections show how to use the RhoConnect application to deliver push messages to each client platform and how you can handle the push notification in your Rhodes application.
|
9
|
+
|
10
|
+
## Setting up Server and Client
|
11
|
+
|
12
|
+
You will need to perform one of the following set of instructions on the RhoConnect server and your mobile device for your specific platform.
|
13
|
+
|
14
|
+
* [Set up RhoConnect Push Service on client and server](/rhoconnect/push-client-setup-rps).
|
15
|
+
* [Set up RhoConnect Push on client and server for Rhodes Android Client](/rhoconnect/push-client-setup-android).
|
16
|
+
* [Set up RhoConnect Push on client and server for Rhodes Blackberry Client](/rhoconnect/push-client-setup-bb).
|
17
|
+
* [Set up RhoConnect Push on client and server for Rhodes iOS Client](/rhoconnect/push-client-setup-ios).
|
18
|
+
|
19
|
+
Then you will need to [perform the final set up on your client](/rhoconnect/push-client-setup).
|
20
|
+
|
21
|
+
## Executing a Ping Call
|
22
|
+
|
23
|
+
RhoConnect has a simple ruby API for sending push notifications (a ping call) to a user's devices. You can [execute a ping call from your RhoConnect source adapter or from your backend application that uses a RhoConnect plugin](/rhoconnect/push-backend-setup).
|
24
|
+
|
25
|
+
## Testing Push
|
26
|
+
|
27
|
+
You can [test push from the RhoConnect console](/rhoconnect/push-testing).
|
9
28
|
|
10
|
-
You will need to perform the following tasks.
|
11
29
|
|
12
|
-
* [Set up the configuration settings in the RhoConnect application](/rhoconnect/push-server-setup) for your mobile client operating system.
|
13
|
-
* [Execute a ping call](/rhoconnect/push-backend-setup) from your RhoConnect source adapter or from your backend application that uses a RhoConnect plugin.
|
14
|
-
* [Set up push notification support](/rhoconnect/push-client-setup) -- receiving push notifications from the RhoConnect server/backend -- on your Android, Blackberry, or iPhone client application.
|