Difference between revisions of "Synergy Messaging Plugins"

From WebOS Internals
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
Basics of how a Synergy connector works: A service must be registered to handle an account, then an account must be created. When the account is enabled in the Accounts app, then it will be available for the Messaging app to use. When the Messaging app wants to send a message, it will insert an object into the system database, which the service will then query and then handle the sending of the message. Similarly, when a message is received,  the service will place an object into the system database, where the Messaging app will handle the notification and displaying of the message.
 
Basics of how a Synergy connector works: A service must be registered to handle an account, then an account must be created. When the account is enabled in the Accounts app, then it will be available for the Messaging app to use. When the Messaging app wants to send a message, it will insert an object into the system database, which the service will then query and then handle the sending of the message. Similarly, when a message is received,  the service will place an object into the system database, where the Messaging app will handle the notification and displaying of the message.
 +
 +
== Registering the Service ==
 +
 +
Every Synergy connector needs to specify a capability provider with the MESSAGING capability in an account-template.json file. The following is an example of an account-template.json file:
 +
 +
<source lang="javascript">
 +
{
 +
  "id":"com.example.account.im",
 +
  "loc_name": "Example",
 +
  "loc_shortName": "Example",
 +
  "capability":"MESSAGING",
 +
  "capabilitySubtype": "IM",
 +
  "serviceName":"type_example",
 +
  "supportsInvisibleStatus": false,
 +
  "implementation": "palm://com.example.service/",
 +
  "onEnabled": "palm://com.example.service/onEnabled",
 +
  "onCredentialsChanged": "palm://com.example.service/onCredentialsChanged",
 +
  "loginStateChanged": "palm://com.example.service/loginStateChanged",
 +
  "sendIM": "palm://com.example.service/sendIM",
 +
  "sendCommand": "palm://com.example.service/sendCommand",
 +
  "chatWithNonBuddies": true,
 +
  "readOnlyData": false,
 +
  "icon": { "loc_32x32": "images/example32.png", "loc_48x48": "images/example48.png", "splitter": "images/example32.png" },
 +
  "dbkinds": {
 +
    "immessage": "com.example.service.immessage:1",
 +
    "imloginstate": "com.example.service.loginstate:1",
 +
    "imcommand": "com.example.service.imcommand:1"
 +
}
 +
</source>
 +
 +
Description of the properties:
 +
 +
'''id''': The a

Latest revision as of 22:45, 21 April 2012

Warning This page is a work-in-progress!

How Synergy Messaging Plugins Work

Basics of how a Synergy connector works: A service must be registered to handle an account, then an account must be created. When the account is enabled in the Accounts app, then it will be available for the Messaging app to use. When the Messaging app wants to send a message, it will insert an object into the system database, which the service will then query and then handle the sending of the message. Similarly, when a message is received, the service will place an object into the system database, where the Messaging app will handle the notification and displaying of the message.

Registering the Service

Every Synergy connector needs to specify a capability provider with the MESSAGING capability in an account-template.json file. The following is an example of an account-template.json file:

<source lang="javascript"> {

 "id":"com.example.account.im",
 "loc_name": "Example",
 "loc_shortName": "Example",
 "capability":"MESSAGING",
 "capabilitySubtype": "IM",
 "serviceName":"type_example",
 "supportsInvisibleStatus": false,
 "implementation": "palm://com.example.service/",
 "onEnabled": "palm://com.example.service/onEnabled",
 "onCredentialsChanged": "palm://com.example.service/onCredentialsChanged",
 "loginStateChanged": "palm://com.example.service/loginStateChanged",
 "sendIM": "palm://com.example.service/sendIM",
 "sendCommand": "palm://com.example.service/sendCommand",
 "chatWithNonBuddies": true,
 "readOnlyData": false,
 "icon": { "loc_32x32": "images/example32.png", "loc_48x48": "images/example48.png", "splitter": "images/example32.png" },
 "dbkinds": {
   "immessage": "com.example.service.immessage:1",
   "imloginstate": "com.example.service.loginstate:1",
   "imcommand": "com.example.service.imcommand:1"

} </source>

Description of the properties:

id: The a