{"id":22329148,"url":"https://github.com/realtime-framework/realtimemessaging-appcelerator","last_synced_at":"2025-07-07T01:33:37.790Z","repository":{"id":73122203,"uuid":"53963791","full_name":"realtime-framework/RealtimeMessaging-Appcelerator","owner":"realtime-framework","description":"Realtime Messaging modules for Appcelerator","archived":false,"fork":false,"pushed_at":"2016-03-15T18:26:37.000Z","size":3841,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-31T17:44:47.860Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/realtime-framework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-15T17:15:03.000Z","updated_at":"2016-05-28T10:25:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"d3078255-ec9c-4374-a375-9663ca84adcc","html_url":"https://github.com/realtime-framework/RealtimeMessaging-Appcelerator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/realtime-framework/RealtimeMessaging-Appcelerator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realtime-framework%2FRealtimeMessaging-Appcelerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realtime-framework%2FRealtimeMessaging-Appcelerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realtime-framework%2FRealtimeMessaging-Appcelerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realtime-framework%2FRealtimeMessaging-Appcelerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/realtime-framework","download_url":"https://codeload.github.com/realtime-framework/RealtimeMessaging-Appcelerator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realtime-framework%2FRealtimeMessaging-Appcelerator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263997815,"owners_count":23541738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-04T03:14:36.552Z","updated_at":"2025-07-07T01:33:37.782Z","avatar_url":"https://github.com/realtime-framework.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Realtime Messaging modules for Appcelerator\n\nThese modules allows the integration of Realtime Messaging services (aka ORTC) in Appcelerator applications.\n\nPart of the [The Realtime® Framework](http://framework.realtime.co), Realtime Cloud Messaging (aka ORTC) is a secure, fast and highly scalable cloud-hosted Pub/Sub real-time message broker for web and mobile apps.\n\nIf your app has data that needs to be updated in the user’s interface as it changes (e.g. real-time stock quotes or ever changing social news feed) Realtime Cloud Messaging is the reliable, easy, unbelievably fast, “works everywhere” solution.\n\nRequirements: Android =\u003e 2.3.3\n\n## Installation\n\nFor information how to use Titanium Modules, please follow the guide [here](http://wiki.appcelerator.org/display/tis/Using+Titanium+Modules).\n\nRequire module **Ti.map**\n\n## Accessing the ORTC Module\n\nTo access this module from JavaScript, you would do the following:\n\n\tvar ORTC = require(\"co.realtime.ortc\");\n\nThe ORTC variable is a reference to the Module object.\t\n\n## Reference\n\n### Properties\n\n#### clusterUrl\nThe cluster server URL\n\nExample:\n\n\tORTC.clusterUrl = 'http://ortc-developers.realtime.co/server/2.1';\n#### url\nThe server URL\n\nExample:\n\n\tORTC.url = 'http://ortc-developers-euwest1-S0001.realtime.co/server/2.1';\n#### connectionMetadata\nThe client connection metadata\n\nExample:\n\n\tORTC.connectionMetadata = 'Titanium Client';\n#### announcementSubchannel\nThe client announcement subchannel\n\nExample:\n\n\tORTC.announcementSubchannel = 'announcementSubchannel';\n#### sessionId (readonly)\nThe client session identifier\n\nExample:\n\n\talert(ORTC.sessionId);\n\n### Events\n\n#### onException\nEvent fired whenever exception occurs.\nThe event parameter passed on the callback function has defined following property:\n- **info** [string]: description of the exception\n\nExample:\n\n\tORTC.addEventListener('onException', function(e) {\t\n\t\talert('Exception: '+e.info);\n\t});\n\n#### onConnected\nEvent fired whenever module connects.\n\nExample:\n\n\tORTC.addEventListener('onConnected', function(e) {\n\t\talert('Connected');\n\t});\n\n#### onDisconnected\nEvent fired whenever module disconnects.\n\nExample:\n\n\tORTC.addEventListener('onDisconnected', function(e) {\n\t\talert('Disconnected');\n\t});\n\n#### onReconnected\nEvent fired whenever module reconnects.\n\nExample:\n\n\tORTC.addEventListener('onReconnected', function(e) {\n\t\talert('Reconnected');\n\t});\n\n#### onReconnecting\nEvent fired whenever module connects.\n\nExample:\n\n\tORTC.addEventListener('onReconnecting', function(e) {\n\t\talert('Reconnecting');\n\t});\n\n#### onSubscribed\nEvent fired when module subscribes to a channel.\nThe event parameter passed on the callback function has defined following property:\n- **channel** [string]: the channel name\n\nExample:\n\n\tORTC.addEventListener('onSubscribed', function(e) { \n\t\talert('Subscribed to channel: '+e.channel);\n\t});\n\n\n#### onUnsubscribed\nEvent fired when module unsubscribes from a channel.\nThe event parameter passed on the callback function has defined following property:\n- **channel** [string]: the channel name\n\nExample:\n\n\tORTC.addEventListener('onUnsubscribed', function(e) { \n\t\talert('Unsubscribed from: '+e.channel);\n\t});\n\n\n#### onMessage\nEvent fired when module receives a message on the subscribed channel.\nThe event parameter passed on the callback function has defined following properties:\n- **channel** [string]: the channel name\n- **message** [string]: the message\n\nExample:\n\n\tORTC.addEventListener('onMessage', function(e) {\n\t\talert('(Channel: '+e.channel+') Message received: '+e.message);\n\t});\n\t\n#### onNotification\nEvent fired when module receives a push notification. The event parameter passed on the callback function has defined following properties:\n\n- **channel** [string]: the channel name\n- **message** [string]: the message\n- **payload** [string]: the payload\n\nExample:\n\n\tORTC.addEventListener('onNotification', function(e) {\n    alert('(Channel: '+e.channel+') Message received: '+e.message + ' payload: ' + e.payload);\n});\n\n#### onPresence\nEvent fired as a response for presence request.\nThe event parameter passed on the callback function has defined following properties:\n- **channel** [string]: the channel name\n- **result** [string]: JSON string containing the presence response\n- **error** [string]: the error description, if occurs, otherwise empty string\n\nExample:\n\n\tORTC.addEventListener('onPresence', function(e) {\n\t\tif (e.error != \"\"){\n\t\t\talert('(Channel: '+e.channel+') Presence error: ' + e.error);\n\t\t} else {\n\t\t\talert('(Channel: '+e.channel+') Presence: '+e.result);\n\t\t}\n\t});\n\n### Methods\n\n#### connect\nConnects the client using the supplied application key and authentication token.\nParameters:\n- **application_key** [string]: Your ORTC application key.\n- **authentication_token** [string]: - Your ORTC authentication token (this parameter is optional).\n\nExample:\n\n\tORTC.connect('yourApplicationKey');\n\tor\n\tORTC.connect('yourApplicationKey', 'yourAuthenticationToken');\n\n#### disconnect\nDisconnects the client.\n\nExample:\n\n\tORTC.disconnect();\n\n#### subscribe\nSubscribes to the supplied channel to receive messages sent to it.\nParameters:\n- **channel** [string]: The channel name.\n- **subscribe_on_reconnect** [bool] -Indicates whether the client should subscribe to the channel when reconnected (if it was previously subscribed when connected).\n\nExample:\n\n\tORTC.subscribe('yellow', true);\n\t\n#### subscribeWithNotifications\nSubscribes with notification to the supplied channel to receive messages sent to it.\nParameters:\n- **channel** [string]: The channel name.\n- **subscribe_on_reconnect** [bool] -Indicates whether the client should subscribe to the channel when reconnected (if it was previously subscribed when connected).\n\nExample:\n\n\tORTC.subscribeWithNotifications('yellow', true);\n\t\n#### unsubscribe\nUnsubscribes from the supplied channel to stop receiving messages sent to it.\nParameter:\n- **channel** [string]: The channel name.\n\nExample:\n\t\n\tORTC.unsubscribe('yellow');\n\t\n#### send\nSends the supplied message to the supplied channel.\nParameters:\n- **channel** [string]: The channel name.\n- **message** [string]: The message to send.\n\nExample:\n\n\tORTC.send('yellow', 'This is the message');\n\t\n#### setGoogleProjectId\nSets the Google Project ID. Not necessary if you are not going to use ORTC with Google Cloud Messaging.\nParameters:\n- **googleProjectId** [string]: Project Id of your Google project.\n\nExample:\n\n\tortc.setGoogleProjectId('PROJECT_ID');\n\n#### isSubscribed\nReturns boolean value which indicates whether the client is subscribed to the supplied channel.\nParameter:\n- **channel** [string]: The channel name.\n\nExample:\n\n\talert(ORTC.isSubscribed('yellow'));\n\n#### isConnected\nReturns boolean value which indicates whether the client is connected. \n\nExample:\n\n\talert(ORTC.isConnected());\n\t\n#### presence\nGets a dictionary indicating the subscriptions number in the specified channel and if active the first 100 unique metadata.\nParameter: \n- **channel** [string]: The channel name with presence data active.\n\nExample:\n\t\n\tORTC.presence('yellow');\n\t\n## Push notifications guide\n\nFor using ORTC Titanium SDK with push notifications from GCM.\n\n- Create a google project, more info [here](http://messaging-public.realtime.co/documentation/starting-guide/mobilePushGCM.html).\n\n- Set notification title to be displayed in the notification manager.\n\n\t\tortc.setNotificationTitle('[App name for example]');\n\n\n- Before connect set your Google project id: \n\n\t\tortc.setGoogleProjectId('462540995476');\n\t\tortc.clusterUrl = 'http://ortc-developers.realtime.co/server/2.1';\n\t\tif(taAuthToken.value != '') {\n\t\t\tortc.connect(taAppKey.value, taAuthToken.value);\n\t\t} else {\n\t\t\tortc.connect(taAppKey.value);\n\t\t}\n\t\t\n- Set onNotification eventListener. \n\n\t\tortc.addEventListener('onNotification', function(e) {\n\t\t\taddRowToEvents('(onNotification Channel: '+e.channel+') Message received: '+e.message+' Payload received: '+e.payload);\n\t\t\tTitanium.API.log('(onNotification Channel: '+e.channel+') Message received: '+e.message);\n\t\t});\n\t\t\n- Use subscribeWithNotifications to subscribe the channel.\n\t\t\n\t\tortc.subscribeWithNotifications(taChannel.value, true);\n\t\t\n- Add the folling entrys to your application TiApp.xml, replace **[Titanium project identifier]** :\n\n\t\t    \u003candroid xmlns:android=\"http://schemas.android.com/apk/res/android\"\u003e\n\t\t        \u003cmanifest\u003e\n\t\t            \u003cpermission\n\t\t                android:name=\"[Titanium project identifier].permission.C2D_MESSAGE\" android:protectionLevel=\"signature\"/\u003e\n\t\t            \u003cuses-permission android:name=\"[Titanium project identifier].permission.C2D_MESSAGE\"/\u003e\n\t\t            \u003cuses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/\u003e\n\t\t            \u003cuses-permission\n\t\t                android:name=\"android.permission.GET_TASKS\"/\u003e //detect if app is running from service\n\t\t            \u003cuses-permission android:name=\"com.google.android.c2dm.permission.RECEIVE\"/\u003e\n\t\t            \u003cuses-permission android:name=\"android.permission.WAKE_LOCK\"/\u003e\n\t\t            \u003capplication android:debuggable=\"true\"\u003e\n\t\t                \u003cservice android:name=\"co.realtime.ortc.BackgroundService\"/\u003e\n\t\t                \u003cservice android:name=\"ibt.ortc.extensibility.GcmOrtcIntentService\"/\u003e\n\t\t                \u003creceiver\n\t\t                    android:name=\"ibt.ortc.extensibility.GcmOrtcBroadcastReceiver\" android:permission=\"com.google.android.c2dm.permission.SEND\"\u003e\n\t\t                    \u003cintent-filter\u003e\n\t\t                        \u003caction android:name=\"com.google.android.c2dm.intent.RECEIVE\"/\u003e\n\t\t                        \u003caction android:name=\"android.intent.action.BOOT_COMPLETED\"/\u003e\n\t\t                        \u003ccategory android:name=\"[Titanium project identifier]\"/\u003e\n\t\t                    \u003c/intent-filter\u003e\n\t\t                    \u003cintent-filter\u003e\n\t\t                        \u003caction android:name=\"com.google.android.c2dm.intent.REGISTRATION\"/\u003e\n\t\t                        \u003ccategory android:name=\"[Titanium project identifier]\"/\u003e\n\t\t                        \u003caction android:name=\"android.intent.action.BOOT_COMPLETED\"/\u003e\n\t\t                    \u003c/intent-filter\u003e\n\t\t                \u003c/receiver\u003e\n\t\t            \u003c/application\u003e\n\t\t        \u003c/manifest\u003e\n\t\t    \u003c/android\u003e\n\n\t\t\n\n\t\t\n\n\n\n\t\n## Usage\n\nPlease see the examples files included in the directory 'example'\n\n## Author\nRealtime.co\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealtime-framework%2Frealtimemessaging-appcelerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frealtime-framework%2Frealtimemessaging-appcelerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealtime-framework%2Frealtimemessaging-appcelerator/lists"}