Synaptop's API allows you to deploy your web application to multiple platforms and take advantage or Synaptop's unique live colaboration tools. The Developer application is released on October 28th 2011 and we will be adding the update to the Synappstore the week of November 1st so you can start putting your apps in the Synappstore. In the mean time, you can begin writing your apps using the API. Getting started with the Synaptop API is easy:
You can download a sample app by clicking the Download Now button below:
Your launch url is where Synaptop loads your application from. Set this url to your initialization script on your server.
Your site domain is important, allowing Synaptop to identify applications and ensure that it is communicating with only trusted sites. Every message between your site and Synaptop requires that this domain matches the domain the request is coming from so please ensure that it is accurate.
Displays that approval status of your application. If your application is approved, it will appear in the Synappstore.
A url that points to the icon for your application. It should be at least 64x64 pixels so that it appears correctly on higher-resolution displays. It must be in PNG format.
Mobile development for the Synaptop API is being rolled out the week of November 1st. If your application is mobile-ready, change this value to true. Mobile applications should be formatted for displays on IOS/Android devices and be optimized for a touch interface. A useful tool to help you get started developing mobile interfaces can be found here:http://jquerymobile.com/
Once you have completed the setup for your application, you will need to get your server ready to launch your app. Below is a "Hello World" style example illustrating the basic framework of a Synaptop application.
To be able to access the Synaptop API from your application, you must include the Synaptop API script in the HEAD section of your startup page (the example below uses jQuery to call synaptop.loaded() when the document is ready. You can use any other framework to accomplish this.
If your launch url is http://www.mysite.com/app.php, Synaptop launches your application by loading that url inside an iframe that resides within a Synaptop window. Two parameters are passed to your application:
mobile — A boolean value indicating if the user agent is a mobile device or not (this approximation is done based on the user-agent that the browser provides. It may not be entirely accurate so best practices for CSS are recommended when creating your application.
Once your application is loaded, call synaptop.loaded() to notify the operating system that your application has completely loaded.
Once you have called synaptop.loaded() and notified the operating system that your application is loaded, you can begin accessing the native functionality of the Synaptop Operating system. Below are the various function calls you can make on the Synatop system:
Description: Call the loaded function once your application has loaded to register it with the Synaptop Operating System.
Description: Set a callback function to be called when a new subscriber/follower is added to the program.
Description: Set a callback function to be called when a new subscriber/follower stops following the current user.
Description: Use the native prompt to ask the user a question.
The text of the question you would like to ask the user.
The button set that you would like to present to the user. The accepted values for this are "yesno" or "okcancel". Each will provide an answer of true or false respectively.
The callback function to run when the question is answered by the user.
Description: Closes your app.
Description: Use the native prompt to show the user a message.
The text of the message you would like to show to the user.
Description: Get a count of how many people are subscribed to the current user.
Description: Returns the user-agent details about the client. The object that is returned will contain two properties:
userAgent — the user agent string of the client.
device — one of "iPod", "iPhone", "iPad", "BlackBerry", "Android", "unknown". If you need more specification than the options provided, you can parse the user agent string.
Description: Execute a YQL statement and get teh results back in the format of your choosing.
The query you would like to execute.
Example: SELECT * FROM html WHERE url = 'http://www.cnn.com'
Provide the format that you want to receive the results of the query in. You can choose "xml" or "json".
Description: Send a message to all subscribed/following clients.
A message that you would like to broadcast to all connected clients.
Description: Send a message to all a subset of subscribed/following clients. Each client that subscribes the onSubscriber function. You can use this information to manage the list of subscribers or you can call the getSubscribers function to get a list of client ids that are currently connected.
An array of integer ids of the clients to send the message to. The clients must be part of the current subscribers list to send a message to them.
A message that you would like to broadcast to the selected connected clients.
Description: Provide a callback function to be initiated when a message is sent from another client to the local client. It is up to you to format your outgoing messages that are sent via the broadcast or broadcastRecipients function so that they are readable by the function provided to onMessage.
Description: Get information about the current user. (Returns the name, id and profile image of the user.
The function to be called when the user is returned.
Description: Returns a list of subscriber ids.
The function to be called when the file is returned.
Description: Get a the flash version from swfboject. More about the function here: http://code.google.com/p/swfobject/wiki/api
Callback with the results of getFlashVersion.
Description: Returns a list of the users current friends that are online:
Callback function to be passed the list of friends
Description: Prompts the user to open a file and then returns the file.
Callback function to be called with the file as a parameter