~abreu-alexandre/unity-webapps-qml/content-hub-getpeers-failure-14-10

« back to all changes in this revision

Viewing changes to src/Ubuntu/UnityWebApps/bindings/online-accounts/client/online-accounts.js

  • Committer: Alexandre Abreu
  • Date: 2014-05-09 13:17:09 UTC
  • mto: This revision was merged to the branch mainline in revision 116.
  • Revision ID: alexandre.abreu@canonical.com-20140509131709-6g9z2qqjgrks9wj6
add filtering param to getProviders

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
             * Gets list of available providers.
192
192
             *
193
193
             * @method api.getProviders
194
 
             * @param filters {Object} A dictionary of parameters to filter the result.
 
194
             * @param filters {Object} A dictionary of parameters to filter the result. The filtering keys are:
 
195
             * - applicationId: the ID of a application (see /usr/share/accounts/applications/ or ~/.local/share/accounts/applications/ for a list of the available applications)
195
196
             * @param callback {Function(List of AccountService objects)} Callback that receives the result or null.
196
197
             *                                                            The result is a dictionary with the following keys:
197
198
             *          - displayName: the display name for the corresponding provider
201
202
               var api = external.getUnityObject(1.0);
202
203
               var oa = api.OnlineAccounts;
203
204
 
204
 
               oa.api.getProviders(function(result) {
 
205
               oa.api.getProviders({}, function(result) {
205
206
                 for (var i = 0; i < result.length; ++i) {
206
207
                   console.log("displayName: " + result[i].displayName
207
208
                               + ', providerId: ' + result[i].providerId);
209
210
               });
210
211
 
211
212
             */
212
 
            getProviders: function(callback) {
 
213
            getProviders: function(filters, callback) {
213
214
                backendBridge.call('OnlineAccounts.getProviders'
214
 
                                   , []
 
215
                                   , [filters]
215
216
                                   , callback);
216
217
            },
217
218
        },