rhoconnect 3.4.5 → 4.0.0.beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
data/doc/metadata.txt
CHANGED
|
@@ -23,7 +23,7 @@ Then add `rhodes_translator` to your extensions in your Rhodes application's `bu
|
|
|
23
23
|
:::yaml
|
|
24
24
|
extensions: ["rhodes_translator"]
|
|
25
25
|
|
|
26
|
-
Now define some metadata and add this to a `metadata` method your [source adapter](/rhoconnect/source-adapters). For example:
|
|
26
|
+
Now define some metadata and add this to a `metadata` method your [source adapter model](/rhoconnect/source-adapters). For example:
|
|
27
27
|
|
|
28
28
|
:::ruby
|
|
29
29
|
def metadata
|
data/doc/migration.txt
CHANGED
|
@@ -1,194 +1,160 @@
|
|
|
1
|
-
Migrating
|
|
1
|
+
Migrating your application to RhoConnect 4.0
|
|
2
2
|
===
|
|
3
3
|
|
|
4
|
-
The best way of migrating your
|
|
4
|
+
The best way of migrating your old RhoConnect app to Rhoconnect 4.0+ is to re-generate the application skeleton
|
|
5
5
|
using Rhoconnect, then integrate all of your implementation specifics into it.
|
|
6
|
-
However, if you prefer to migrate your
|
|
6
|
+
However, if you prefer to migrate your RhoConnect app manually, perform the steps in this document.
|
|
7
7
|
|
|
8
|
-
##
|
|
9
|
-
Install the `bundler` gem:
|
|
8
|
+
## Upgrading dependency manifest
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
$ [sudo] gem install bundler
|
|
13
|
-
|
|
14
|
-
## Create the Gemfile
|
|
15
|
-
Create a new `Gemfile` file in your application directory with the following content:
|
|
10
|
+
Open the `Gemfile` of your application and find the `rhoconnect` line, it should look something like:
|
|
16
11
|
|
|
17
12
|
:::ruby
|
|
18
|
-
|
|
13
|
+
gem 'rhoconnect', '3.3.6'
|
|
19
14
|
|
|
20
|
-
|
|
15
|
+
Change this to the latest release version, which you can find on [rubygems.org](http://rubygems.org/gems/rhoconnect), for example if it is 4.0.1:
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
gem '
|
|
17
|
+
:::ruby
|
|
18
|
+
gem 'rhoconnect', '4.0.1'
|
|
24
19
|
|
|
25
|
-
|
|
26
|
-
gem 'jdbc-sqlite3', ">= 3.7.2"
|
|
27
|
-
gem 'dbi', ">= 0.4.5"
|
|
28
|
-
gem 'dbd-jdbc', ">= 0.1.4"
|
|
29
|
-
gem 'jruby-openssl', ">= 0.7.4"
|
|
30
|
-
gem 'warbler'
|
|
31
|
-
end
|
|
20
|
+
Run the following command from the root application directory:
|
|
32
21
|
|
|
33
|
-
|
|
22
|
+
:::term
|
|
23
|
+
$ bundle install
|
|
34
24
|
|
|
35
|
-
|
|
36
|
-
gem 'trinidad', :platforms => :jruby
|
|
25
|
+
Now update your application's RhoConnect dependency manifest:
|
|
37
26
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
gem 'thin', :platforms => [:ruby, :mswin, :mingw]
|
|
41
|
-
end
|
|
27
|
+
:::term
|
|
28
|
+
$ rhoconnect update
|
|
42
29
|
|
|
43
|
-
|
|
44
|
-
gem 'rack-test', '>= 0.5.3', :require => "rack/test"
|
|
45
|
-
gem 'rspec', '~> 2.6.0'
|
|
46
|
-
gem 'rcov', '>= 0.9.8'
|
|
47
|
-
end
|
|
48
|
-
|
|
30
|
+
## Migrating application files
|
|
49
31
|
|
|
50
|
-
|
|
32
|
+
If you have an existing RhoConnect application using version < 4.0 and want to upgrade it to RhoConnect 4.0+, then
|
|
33
|
+
you need to update the `Gemfile` file to properly use the latest RhoConnect runtime dependencies.
|
|
51
34
|
|
|
52
|
-
|
|
35
|
+
First, follow the instructions described in the [previous section](/rhoconnect/migration#upgrading-dependency-manifest).
|
|
53
36
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
:::ruby
|
|
57
|
-
begin
|
|
58
|
-
require 'vendor/rhosync/lib/rhosync/tasks'
|
|
59
|
-
require 'vendor/rhosync/lib/rhosync'
|
|
60
|
-
rescue LoadError
|
|
61
|
-
require 'rhosync/tasks'
|
|
62
|
-
require 'rhosync'
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
to this:
|
|
37
|
+
Next, make sure your `Gemfile` looks like the following example, replacing the version as necessary.
|
|
38
|
+
The `rhoconnect update` command will generate a reference `Gemfile.new` which you can use to replace your `Gemfile`:
|
|
66
39
|
|
|
67
40
|
:::ruby
|
|
68
|
-
|
|
69
|
-
require 'vendor/rhoconnect/lib/rhoconnect/tasks'
|
|
70
|
-
require 'vendor/rhoconnect/lib/rhoconnect'
|
|
71
|
-
rescue LoadError
|
|
72
|
-
require 'rhoconnect/tasks'
|
|
73
|
-
require 'rhoconnect'
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
## Edit config.ru
|
|
77
|
-
|
|
78
|
-
Adjust `config.ru` file by performing the following steps:
|
|
79
|
-
|
|
80
|
-
1) Change the section shown below to replace `rhosync` with `rhoconnect`.
|
|
41
|
+
source 'http://rubygems.org'
|
|
81
42
|
|
|
82
|
-
|
|
43
|
+
gem 'rhoconnect', '<put correct version here>'
|
|
44
|
+
gemfile_path = File.join(File.dirname(__FILE__), ".rcgemfile")
|
|
83
45
|
|
|
84
|
-
:::ruby
|
|
85
46
|
begin
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
47
|
+
eval(IO.read(gemfile_path))
|
|
48
|
+
rescue Exception => e
|
|
49
|
+
puts "ERROR: Couldn't read RhoConnect .rcgemfile"
|
|
50
|
+
puts e.message
|
|
51
|
+
exit 1
|
|
91
52
|
end
|
|
92
53
|
|
|
93
|
-
to this
|
|
54
|
+
# DON'T FORGET to add your application specific gems after this line ...
|
|
55
|
+
# ...
|
|
94
56
|
|
|
95
|
-
|
|
96
|
-
begin
|
|
97
|
-
require 'vendor/rhoconnect/lib/rhoconnect/tasks'
|
|
98
|
-
require 'vendor/rhoconnect/lib/rhoconnect'
|
|
99
|
-
rescue LoadError
|
|
100
|
-
require 'rhoconnect/tasks'
|
|
101
|
-
require 'rhoconnect'
|
|
102
|
-
end
|
|
57
|
+
You must update `config.ru`, `Rakefile`, 'application.rb' and your source adapter files to match RhoConnect 4.0+ gem requirements.
|
|
103
58
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
For example, change this:
|
|
59
|
+
Replace your existing `config.ru` with the listing below. Save your old `config.ru` since you will use values within it in the new `config.ru`.
|
|
107
60
|
|
|
108
61
|
:::ruby
|
|
109
|
-
|
|
62
|
+
# config.ru file
|
|
110
63
|
|
|
111
|
-
|
|
64
|
+
#!/usr/bin/env ruby
|
|
65
|
+
require 'rhoconnect/application/init'
|
|
112
66
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
67
|
+
# secret is generated along with the app
|
|
68
|
+
# NOTE:
|
|
69
|
+
# Substitute 'REPLACE_ME' string by the Rhoconnect::Server.set :secret value from your old config.ru
|
|
70
|
+
Rhoconnect::Server.set :secret, 'REPLACE_ME'
|
|
117
71
|
|
|
118
|
-
|
|
72
|
+
# !!! Add your custom initializers and overrides here !!!
|
|
73
|
+
# For example, uncomment the following line to enable Stats
|
|
74
|
+
#Rhoconnect::Server.enable :stats
|
|
75
|
+
# uncomment the following line to disable Resque Front-end console
|
|
76
|
+
#Rhoconnect.disable_resque_console = true
|
|
77
|
+
# uncomment the following line to disable Rhoconnect Front-end console
|
|
78
|
+
#Rhoconnect.disable_rc_console = true
|
|
119
79
|
|
|
120
|
-
|
|
80
|
+
# run RhoConnect Application
|
|
81
|
+
run Rhoconnect.app
|
|
121
82
|
|
|
122
|
-
|
|
123
|
-
class Application < Rhosync::Base
|
|
124
|
-
|
|
125
|
-
to:
|
|
83
|
+
And replace your existing `Rakefile` with the following:
|
|
126
84
|
|
|
127
85
|
:::ruby
|
|
128
|
-
|
|
86
|
+
require 'rubygems'
|
|
87
|
+
require 'bundler/setup'
|
|
88
|
+
require 'rhoconnect/tasks'
|
|
89
|
+
require 'rhoconnect'
|
|
90
|
+
require 'resque/tasks'
|
|
129
91
|
|
|
130
|
-
|
|
92
|
+
ROOT_PATH = File.expand_path(File.dirname(__FILE__))
|
|
131
93
|
|
|
132
|
-
|
|
94
|
+
task 'resque:setup' do
|
|
95
|
+
# The number of redis connections you want a job to have
|
|
96
|
+
Rhoconnect.connection_pool_size = 1
|
|
97
|
+
require 'rhoconnect/application/init'
|
|
133
98
|
|
|
134
|
-
|
|
135
|
-
|
|
99
|
+
Resque.after_fork do
|
|
100
|
+
Store.reconnect
|
|
101
|
+
end
|
|
102
|
+
end
|
|
136
103
|
|
|
137
|
-
|
|
138
|
-
ENV['RHO_ENV'] = 'test'
|
|
139
|
-
ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__),'..'))
|
|
140
|
-
Bundler.require(:default, ENV['RHO_ENV'].to_sym)
|
|
104
|
+
Move your existing `application.rb` file into `controllers/ruby/application_controller.rb` and update it with the following:
|
|
141
105
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
106
|
+
:::ruby
|
|
107
|
+
class ApplicationController < Rhoconnect::Controller::AppBase
|
|
108
|
+
register Rhoconnect::EndPoint
|
|
109
|
+
|
|
110
|
+
post "/login", :rc_handler => :authenticate,
|
|
111
|
+
:deprecated_route => {:verb => :post, :url => ['/application/clientlogin', '/api/application/clientlogin']} do
|
|
112
|
+
login = params[:login]
|
|
113
|
+
password = params[:password]
|
|
114
|
+
<INSERT YOUR AUTHENTICATION CODE HERE>
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
get "/rps_login", :rc_handler => :rps_authenticate,
|
|
118
|
+
:login_required => true do
|
|
119
|
+
login = params[:login]
|
|
120
|
+
password = params[:password]
|
|
121
|
+
<INSERT YOUR RPS AUTHENTICATION CODE HERE>
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# <.... PLACE HERE ALL OF YOUR EXISTING APPLICATION CODE ...>
|
|
147
125
|
end
|
|
148
126
|
|
|
149
|
-
|
|
150
|
-
require './application'
|
|
151
|
-
include Rhoconnect
|
|
127
|
+
NOTE: You must remove `initializer` method from the ApplicationController class. It is no longer supported.
|
|
152
128
|
|
|
153
|
-
|
|
129
|
+
NOTE: If you had `store_blob` method overriden in the `application.rb` file - you will need to move it into the corresponding model class. Global `store_blob` method is no longer supported.
|
|
130
|
+
See below for details.
|
|
154
131
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
private
|
|
159
|
-
def ensure_shared_example_group_name_not_taken(name)
|
|
160
|
-
end
|
|
161
|
-
end
|
|
162
|
-
end
|
|
163
|
-
end
|
|
132
|
+
Re-generate your sources by running 'rhoconnect source YOUR_SOURCE' command for all of your application sources. This will create source's controller files in the `controllers/ruby` directory
|
|
133
|
+
and source's model files in the `models/ruby` directory. After that, move your existing files from the `sources` directory into the `models/ruby` directory, replacing the generated model files.
|
|
134
|
+
Then, modify every file to make sure that your SourceAdapter classes now derive from the `Rhoconnect::Model::Base` class - SourceAdapters now became Models:
|
|
164
135
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
before(:each) do
|
|
169
|
-
Store.db.flushdb
|
|
170
|
-
Application.initializer(ROOT_PATH)
|
|
171
|
-
end
|
|
136
|
+
:::ruby
|
|
137
|
+
class Product < Rhoconnect::Model::Base
|
|
138
|
+
# .... rest of your code
|
|
172
139
|
end
|
|
173
140
|
|
|
174
|
-
|
|
175
|
-
all of your spec files should be modified from:
|
|
141
|
+
If you had global `store_blob` method in the `application.rb` file - you need to move it into every model's class that supports blobs:
|
|
176
142
|
|
|
177
143
|
:::ruby
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
144
|
+
class Product < Rhoconnect::Model::Base
|
|
145
|
+
# ... your code here ....
|
|
146
|
+
def store_blob(object, field, blob)
|
|
147
|
+
<YOUR_STORE_BLOB_IMPLEMENTATION>
|
|
148
|
+
end
|
|
149
|
+
end
|
|
182
150
|
|
|
183
|
-
to:
|
|
151
|
+
If you had source spec files in the `spec/sources` directory - you will need to move them into `spec/models/ruby` directory and adjust the top line of each spec file:
|
|
184
152
|
|
|
185
153
|
:::ruby
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
Modify all of your application implementation files by changing the `Rhosync` references
|
|
194
|
-
to `Rhoconnect`.
|
|
154
|
+
require File.join(File.dirname(__FILE__),'..','..','spec_helper')
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
Finally, run `bundle install` to install any missing dependencies in your RhoConnect directory:
|
|
158
|
+
|
|
159
|
+
:::term
|
|
160
|
+
$ bundle install
|
|
@@ -64,7 +64,7 @@ By default, the Rhoconnect application is started with Rack FiberPool's size equ
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
## settings/settings.yml
|
|
67
|
-
This file contains all source adapter options and settings
|
|
67
|
+
This file contains all source adapter options and settings, such as the redis server connection. Before deploying to production, make sure you have the appropriate production settings. A complete list of the settings is in the [RhoConnect Settings chapter](/rhoconnect/settings). Some sample settings for production are shown below. In this sample, the `poll_interval` setting was auto-generated for a source adapter named Product.
|
|
68
68
|
|
|
69
69
|
:::yaml
|
|
70
70
|
:sources:
|
data/doc/push-backend-setup.txt
CHANGED
|
@@ -3,6 +3,8 @@ Setting Up Push on Backend Application
|
|
|
3
3
|
|
|
4
4
|
A RhoConnect push to the client consists of executing a RhoConnect ping call. There are three ways to execute a ping call: you can use the RhoConnect REST API to remotely call the ping, perform the ping job directly in a blocking ruby call, or enqueue a resque job to ping asynchronously.
|
|
5
5
|
|
|
6
|
+
The push message can trigger the following actions in the Rhodes client application: alert with a message, sync one or more sources, vibrate, display a badge, and play a sound file.
|
|
7
|
+
|
|
6
8
|
## Pushing Remotely with the RhoConnect REST API
|
|
7
9
|
|
|
8
10
|
You can trigger a push remotely using the [RhoConnect API Ping method](/rhoconnect/rest-api). This is useful if you want to fully control the push process from a remote server, such as when you use a RhoConnect plugin to connect your backend application to the RhoConnect server application.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
Setting Up RhoConnect Push-Based Synchronization with Google Cloud Messaging
|
|
2
|
+
===
|
|
3
|
+
|
|
4
|
+
This chapter contains the steps you need to set up your Android Rhodes client and RhoConnect server for push messaging. 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).
|
|
5
|
+
|
|
6
|
+
**NOTE: If you are setting up RhoConnect Push Service on an Android client, you do not perform the steps in this chapter. Perform the steps in [RhoConnect Push Service setup](/rhoconnect/push-client-setup-rps) instead.**
|
|
7
|
+
|
|
8
|
+
## Setting up Android Google Cloud Messaging
|
|
9
|
+
|
|
10
|
+
To set up your Android Rhodes client application and RhoConnect server application for RhoConnect Push, you need to set up Android Google Cloud Messaging (GCM).
|
|
11
|
+
|
|
12
|
+
To do so, perform the following sections from the [GCM Getting Started](http://developer.android.com/google/gcm/gs.html) guide.
|
|
13
|
+
|
|
14
|
+
1. Creating a Google API project. (This gets a Google API project number which you will set in your Android client application.)
|
|
15
|
+
2. Enabling the GCM Service.
|
|
16
|
+
3. Obtaining an API Key. (You will set this key in your RhoConnect application.)
|
|
17
|
+
|
|
18
|
+
You can optionally stop in these Getting Started instructions once you complete the Obtaining an API Key section.
|
|
19
|
+
|
|
20
|
+
You may read common [GCM docs](http://developer.android.com/guide/google/gcm/index.html) at the Google developer site.
|
|
21
|
+
|
|
22
|
+
## Setting up RhoConnect Server Application for GCM Push
|
|
23
|
+
|
|
24
|
+
To set up your RhoConnect application for Android Google Cloud Messaging (GCM), you must have first set up Android Google Cloud Messaging. Then you can find your GCM API key in your [Google apis dashboard](https://code.google.com/apis/console).
|
|
25
|
+
|
|
26
|
+
Update `settings/settings.yml` to include your GCM API key:
|
|
27
|
+
|
|
28
|
+
:::yaml
|
|
29
|
+
:development:
|
|
30
|
+
:redis: localhost:6379
|
|
31
|
+
:syncserver: http://localhost:9292/application/
|
|
32
|
+
:licensefile: settings/license.key
|
|
33
|
+
:gcm_api_key: your_gcm_api_key_here
|
|
34
|
+
|
|
35
|
+
## Enabling the Rhodes Android Client for Push
|
|
36
|
+
|
|
37
|
+
Enable push in your Rhodes client application in build.yml.
|
|
38
|
+
|
|
39
|
+
:::yaml
|
|
40
|
+
capabilities:
|
|
41
|
+
- push
|
|
42
|
+
|
|
43
|
+
## Setting up the Rhodes Android (GCM) Client
|
|
44
|
+
|
|
45
|
+
Here are some guidelines for developing and testing an Android application that uses the Android Google Cloud Messaging feature.
|
|
46
|
+
|
|
47
|
+
* To develop and test your GCM applications, you need to run and debug the applications on an Android 2.2 system image that includes the necessary underlying Google services.
|
|
48
|
+
* To develop and debug on an actual device, you need a device running an Android 2.2 system image that includes the Market application.
|
|
49
|
+
* To develop and test on the Android Emulator, you need to download the Android 2.2 version of the Google APIs Add-On into your SDK using the Android SDK and AVD Manager. Specifically, you need to download the component named "Google APIs by Google Inc, Android API 8". Then, you need to set up an AVD that uses that system image.
|
|
50
|
+
* Android GCM system uses an existing connection for Google services. This requires users to set up their Google account on their mobile devices (and on emulator!).
|
|
51
|
+
|
|
52
|
+
### Setting up the Google API project ID in Your Client Application
|
|
53
|
+
|
|
54
|
+
To set up your Rhodes client application for Android Google Cloud Messaging (GCM), you must have first set up Android Google Cloud Messaging, where you noted the Google API project number.
|
|
55
|
+
|
|
56
|
+
Register the Google API project number for your client application. Modify your application's build.yml to specify the Google API project number used to send PUSH messages:
|
|
57
|
+
|
|
58
|
+
:::yaml
|
|
59
|
+
android:
|
|
60
|
+
push:
|
|
61
|
+
sender: <Google API project number>
|
|
62
|
+
|
|
63
|
+
### Setting up Status Bar Notifications for PUSH Messages
|
|
64
|
+
|
|
65
|
+
On the Android client, it is possible to set up status bar notifications for PUSH messages. In this case, push notification can be shown on the Android status bar after ruby callback. The user can activate application by touching this notification.
|
|
66
|
+
There are two modes available for push notifications:
|
|
67
|
+
- <i>always</i> - push notification is shown always
|
|
68
|
+
- <i>background</i> - push notification is shown only if application is backgrounded (not started)
|
|
69
|
+
If no push notification mode is specified in build.yml then no notifications are shown at all.
|
|
70
|
+
|
|
71
|
+
:::yaml
|
|
72
|
+
android:
|
|
73
|
+
push:
|
|
74
|
+
notifications: background
|
|
75
|
+
|
|
76
|
+
## Finishing Client Setup
|
|
77
|
+
|
|
78
|
+
Once you have completed the above steps for setting up push on Android client and RhoConnect server, you must still [perform the client setup that is needed for all platforms](/rhoconnect/push-client-setup).
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
Setting Up RhoConnect Push-Based Synchronization with BlackBerry Enterprise Server
|
|
2
|
+
===
|
|
3
|
+
|
|
4
|
+
This chapter contains the steps you need to set up your BlackBerry Rhodes client and RhoConnect server for push messaging. 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).
|
|
5
|
+
|
|
6
|
+
## Setting up RhoConnect Server Application for Push to Blackberry Clients
|
|
7
|
+
|
|
8
|
+
To set up your RhoConnect application for pushing to a BlackBerry client, you will need to update `settings/settings.yml` to include the following:
|
|
9
|
+
|
|
10
|
+
:::yaml
|
|
11
|
+
:development:
|
|
12
|
+
:redis: localhost:6379
|
|
13
|
+
:mdsserver: 192.168.1.110
|
|
14
|
+
:mdsserverport: 8080
|
|
15
|
+
:syncserver: http://localhost:9292/application/
|
|
16
|
+
:licensefile: settings/license.key
|
|
17
|
+
|
|
18
|
+
Replace `:mdsserver:` and `:mdsserverport:` with the hostname/IP and port of your machine (default port is 8080).
|
|
19
|
+
|
|
20
|
+
## Enabling Rhodes Client for RhoConnect Server Push
|
|
21
|
+
|
|
22
|
+
Enable push in your rhodes application in build.yml.
|
|
23
|
+
|
|
24
|
+
:::yaml
|
|
25
|
+
capabilities:
|
|
26
|
+
- push
|
|
27
|
+
|
|
28
|
+
## Setting up the Rhodes Blackberry Client for Push
|
|
29
|
+
|
|
30
|
+
Notifications to BlackBerry are sent using PAP 2.0 message through a BES/MDS server.
|
|
31
|
+
|
|
32
|
+
On the simulator, this is done via the MDS simulator tool (which you've probably already seen in the form of a console window every time you do 'rake run:bb'). On the device, this is done through the BES/MDS server that the phone is configured to use.
|
|
33
|
+
|
|
34
|
+
These instructions assume you are familiar with BES/MDS concepts (for more information please see [here](http://na.blackberry.com/eng/services/business/server/full/)).
|
|
35
|
+
|
|
36
|
+
In case of Blackberry, if the application is in the background, an alert operation will bring the application upfront; other operations will not.
|
|
37
|
+
|
|
38
|
+
### Setup MDS Simulator
|
|
39
|
+
|
|
40
|
+
<i>Make sure you close the BlackBerry simulator and MDS simulator before continuing for your changes to take effect!</i>
|
|
41
|
+
|
|
42
|
+
To enable the push port in your MDS simulator, edit the following file:
|
|
43
|
+
|
|
44
|
+
C:\Program Files\Research In Motion\BlackBerry JDE <VERSION YOU ARE BUILDING>\MDS\config\rimpublic.property
|
|
45
|
+
|
|
46
|
+
Uncomment the last line of the file, which should be 'push.application.reliable.ports=100':
|
|
47
|
+
|
|
48
|
+
push.application.reliable.ports=100
|
|
49
|
+
|
|
50
|
+
### Setup BlackBerry Simulator
|
|
51
|
+
|
|
52
|
+
To listen for incoming messages on BlackBerry, the Rhodes application will start when the device powers on, and will run a listener thread in the background. You will use the "push_port" option in the [rhoconfig.txt](configuration#run-time-configuration) to specify the listening port for incoming push messages. If "push_port" is not specified, default will be 100 as shown in the previous section.
|
|
53
|
+
|
|
54
|
+
For testing push on the BlackBerry simulator, you should preform the following 'kickstart' process. When the simulator starts, open the web browser on the simulator and navigate to any web page (i.e. http://m.google.com/). Now your simulator is ready to receive push messages.
|
|
55
|
+
|
|
56
|
+
### Setup BlackBerry Device
|
|
57
|
+
|
|
58
|
+
To test push on a BlackBerry device, you will need to use a device that is configured with a BES server. Then, [build your Rhodes application for the device](build#build-for-blackberry).
|
|
59
|
+
|
|
60
|
+
### BlackBerry 5.0 Push service
|
|
61
|
+
|
|
62
|
+
Rhodes 2.2 and higher supports the [Blackberry Push Service](http://na.blackberry.com/eng/developers/javaappdev/pushapi.jsp).
|
|
63
|
+
|
|
64
|
+
Define in [rhoconfig.txt](configuration#run-time-configuration) which push to use (if empty or missed, only MDS push is supported).
|
|
65
|
+
|
|
66
|
+
push_options = 'mds;push_service'
|
|
67
|
+
|
|
68
|
+
The following parameters are from [PushApplicationDescriptor](http://www.blackberry.com/developers/docs/5.0.0api/net/rim/blackberry/api/push/PushApplicationDescriptor.html). Set them in [rhoconfig.txt](configuration#run-time-configuration):
|
|
69
|
+
|
|
70
|
+
push_service_url = 'https://pushapi.eval.blackberry.com/'
|
|
71
|
+
push_service_port = 20558
|
|
72
|
+
push_service_appname = 'RhoTest'
|
|
73
|
+
push_service_type = 'BPAS'
|
|
74
|
+
|
|
75
|
+
### Alert Audio File Setup for Blackberry
|
|
76
|
+
|
|
77
|
+
In case of Blackberry Rhodes client, if the audio file is in the public folder, the file name will be `/apps/public/alerts/test-file.mp3`.
|
|
78
|
+
|
|
79
|
+
## Finishing Client Setup
|
|
80
|
+
|
|
81
|
+
Once you have completed the above steps for setting up push on Blackberry client and RhoConnect server, you must still [perform the client setup that is needed for all platforms](/rhoconnect/push-client-setup).
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
Setting Up RhoConnect Push-Based Synchronization with Apple Push Notification Service
|
|
2
|
+
===
|
|
3
|
+
|
|
4
|
+
This chapter contains the steps you need to set up your iOS Rhodes client and RhoConnect server for push messaging. 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).
|
|
5
|
+
|
|
6
|
+
## Setting up RhoConnect Server Application for Push to iOS Clients
|
|
7
|
+
|
|
8
|
+
To set up your RhoConnect application for pushing to an iOS client, you will need to update `settings/settings.yml` to include the following:
|
|
9
|
+
|
|
10
|
+
:::yaml
|
|
11
|
+
:development:
|
|
12
|
+
:redis: localhost:6379
|
|
13
|
+
:iphonecertfile: settings/apple_push_cert.pem
|
|
14
|
+
:iphonepassphrase: #=> empty or put password for your certificate
|
|
15
|
+
:iphoneserver: gateway.sandbox.push.apple.com
|
|
16
|
+
:iphoneport: 2195
|
|
17
|
+
:syncserver: http://localhost:9292/application/
|
|
18
|
+
:licensefile: settings/license.key
|
|
19
|
+
|
|
20
|
+
This is for running your application in development mode; for production, you will need all of the iphone settings, and you change the `:iphoneserver:` to:
|
|
21
|
+
|
|
22
|
+
:::yaml
|
|
23
|
+
:iphoneserver: gateway.push.apple.com
|
|
24
|
+
|
|
25
|
+
## Enabling Rhodes Client for RhoConnect Server Push
|
|
26
|
+
|
|
27
|
+
Enable push in your rhodes application in build.yml.
|
|
28
|
+
|
|
29
|
+
:::yaml
|
|
30
|
+
capabilities:
|
|
31
|
+
- push
|
|
32
|
+
|
|
33
|
+
## Setting up the Rhodes iOS (APNS) Client for Push
|
|
34
|
+
|
|
35
|
+
iOS PUSH support uses the Apple Push Notification Service (APNS) introduced in iOS SDK 3.0. In order to use the service, you will need to obtain a push-enabled provisioning profile and a server-side push certificate used for encrypting RhoConnect->APNS traffic.
|
|
36
|
+
|
|
37
|
+
In case of iOS, regardless of the operation, the user will be presented with the option to activate the application if it is not running.
|
|
38
|
+
|
|
39
|
+
**NOTE: For testing push, you will need to build and deploy your application to a physical iPhone (or iPad) device. Apple does not support testing push on simulators.**
|
|
40
|
+
|
|
41
|
+
### Setup Push Certificate
|
|
42
|
+
The first step to setting up your environment is to create an APNS push certificate. To create the SSL certificate, follow the "Creating the SSL Certificate and Keys" section on the
|
|
43
|
+
[developer site](https://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ProvisioningDevelopment/ProvisioningDevelopment.html#//apple_ref/doc/uid/TP40008194-CH104-SW4).
|
|
44
|
+
|
|
45
|
+
Once you have the certificate, you will need to export it to a .pem format using [these instructions](https://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ProvisioningDevelopment/ProvisioningDevelopment.html#//apple_ref/doc/uid/TP40008194-CH104-SW6). Make sure to name the output file 'apple_push_cert.pem' file from these instructions, since this is what we configured in our RhoConnect application.
|
|
46
|
+
|
|
47
|
+
Once you have this file, copy it to your RhoConnect application directory under the settings folder:
|
|
48
|
+
|
|
49
|
+
:::term
|
|
50
|
+
$ cd myrhoconnectapp
|
|
51
|
+
$ cp /path/to/apple_push_cert.pem settings/apple_push_cert.pem
|
|
52
|
+
|
|
53
|
+
Now your RhoConnect application is ready to send APNS messages.
|
|
54
|
+
|
|
55
|
+
### Setup Provisioning Profile
|
|
56
|
+
Next, you can setup your Apple Push Provisioning Profile using Apple's [developer site instructions](https://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ProvisioningDevelopment/ProvisioningDevelopment.html#//apple_ref/doc/uid/TP40008194-CH104-SW5). Once you have the profile installed in XCode and on your test device, you are ready to test push.
|
|
57
|
+
|
|
58
|
+
### Setup iOS Device
|
|
59
|
+
Setting up the device is the same process as [building any normal Rhodes application](build#building-a-rhodes-application-for-iphoneipad). When you start the application, make sure to also open the console window (cmd-shift-R). When the application starts, you should see some output in the console that shows the device token (towards the top):
|
|
60
|
+
|
|
61
|
+
2010-08-19 10:14:22.627 rhorunner[1486:307] Device token is <10fd92ab fa8ee481 55d9af6e 73290863 22b323fd 0d18fdbd 19e92d03 c0fef7c8>
|
|
62
|
+
|
|
63
|
+
This confirms that your application is running with push enabled. Once you login to the RhoConnect application and sync, you will see the device registered on the RhoConnect console under the user id you used to login. Now you are ready to [test push from your RhoConnect application](/rhoconnect/push-server-setup#testing-push-in-the-rhoconnect-web-console).
|
|
64
|
+
|
|
65
|
+
### Alert Audio File Setup for iOS
|
|
66
|
+
In case of iOS, audio files for the push alert should be placed in the `/public/alerts` folder and build script will copy them into root of the application main bundle (iOS wouldn't play file from any other place).
|
|
67
|
+
|
|
68
|
+
## Finishing Client Setup
|
|
69
|
+
|
|
70
|
+
Once you have completed the above steps for setting up push on iOS client and RhoConnect server, you must still [perform the client setup that is needed for all platforms](/rhoconnect/push-client-setup).
|