Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to getUsers? #382

Closed
muraribohra opened this issue Apr 4, 2016 · 11 comments
Closed

How to getUsers? #382

muraribohra opened this issue Apr 4, 2016 · 11 comments

Comments

@muraribohra
Copy link

Hello ,
I want to get users by their ID's but it returning nil.
My code is:

[[[ServicesManager instance].usersService getUsersWithIDs:dialog.occupantIDs] continueWithBlock:^id(BFTask *task) {
//
NSLog(@"bftask result %@",task.result);
return nil;
}];

if i doing any mistake , then please guide me.
Thanks

@ghost
Copy link

ghost commented Apr 4, 2016

Hi @muraribohra ,

Please attach some logs. Unfortunately we cannot help you with your problem unless we see them.

@muraribohra
Copy link
Author

This is the complete log.

[QBCore] Request URL:https://api.quickblox.com/users.json?filter%5B%5D=number%20id%20in%2011126799%2C11240919&page=1&per_page=2
2016-04-04 05:32:43.470 Demo[14280:224300] [QBCore] Request method: GET
2016-04-04 05:32:43.471 Demo[14280:224300] [QBCore] Request parameters:{
"filter[]" = "number id in 11126799,11240919";
page = 1;
"per_page" = 2;
}
2016-04-04 05:32:43.472 Demo[14280:224300] [QBCore] Request headers: {
"Content-Type" = "application/json";
"QB-OS" = "iOS 9.0";
"QB-SDK" = "iOS 2.7";
"QB-Token" = 070fc435b4b5c97aa531768ce9b867c19674e2fb;
"QuickBlox-REST-API-Version" = "0.1.1";
}
2016-04-04 05:32:43.776 Demo[14280:224300] [QBCore] Response error: Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: forbidden (403)" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x7b969d20> { URL: https://api.quickblox.com/users.json?filter%5B%5D=number%20id%20in%2011126799%2C11240919&page=1&per_page=2 } { status code: 403, headers {
"Access-Control-Allow-Origin" = "*";
"Cache-Control" = "no-cache";
Connection = "keep-alive";
"Content-Length" = 150;
"Content-Type" = "application/json; charset=utf-8";
Date = "Mon, 04 Apr 2016 12:32:43 GMT";
"QB-Token-ExpirationDate" = "2016-04-04 14:20:05 UTC";
"QuickBlox-REST-API-Version" = "0.1.1";
Server = "nginx/1.8.1";
Status = "403 Forbidden";
"X-Rack-Cache" = miss;
"X-Request-Id" = eccc14673e12c096ab592af5e8972b02;
"X-Runtime" = "0.057966";
"X-UA-Compatible" = "IE=Edge,chrome=1";
} }, NSErrorFailingURLKey=https://api.quickblox.com/users.json?filter[]=number%20id%20in%2011126799%2C11240919&page=1&per_page=2, NSLocalizedDescription=Request failed: forbidden (403), com.alamofire.serialization.response.error.data=<7b226572 726f7273 223a7b22 62617365 223a5b22 55736572 73207265 74726965 76696e67 20666f72 62696464 656e2069 6e206164 6d696e20 70616e65 6c2c2061 70706c69 63617469 6f6e2073 65747469 6e67732e 20536574 75702069 74206865 72652068 74747073 3a2f2f61 646d696e 2e717569 636b626c 6f782e63 6f6d2f61 7070732f 33373938 302f7365 7474696e 6773225d 7d7d>}

@ghost
Copy link

ghost commented Apr 4, 2016

@muraribohra
As you can see, the request returns you an error.

We need to get details of this error. Please put a breakpoint in the method implementation

- (BFTask *)getUsersWithIDs:(NSArray *)ids foundUsers:(NSArray *)foundUsers forceDownload:(BOOL)forceDownload page:(QBGeneralResponsePage *)page

in the error block, where we set error to the source [source setError:response.error.error] and when breakpoint called please print out [response.error reasons]

If you need any help feel free to ask.

@ghost
Copy link

ghost commented Apr 4, 2016

@muraribohra
I think I know where is the problem.

  1. You need to go to the admin.quickblox.com.
  2. Then select your app and go to the settings. http://joxi.ru/p27bp9dt8adxm7
  3. Then you should select checkmark "Allow to retrieve a list of users". http://joxi.ru/VrwbG80tk9GMAX

It will allow you to retrieve a list of users.

@muraribohra
Copy link
Author

thnx Guru, It's done.

@ghost
Copy link

ghost commented Apr 5, 2016

@muraribohra
Glad to hear it.

@ghost ghost closed this as completed Apr 5, 2016
@raviWestAgileLabs
Copy link

We need to provide tags while creating the user , otherwise we will get 404 Error.

Note: Got the 404 error and added tags to user issue resolved

@ghost
Copy link

ghost commented Apr 27, 2017

@raviWestAgileLabs,
Hello.
Please create a separate issue and describe actual and expected behavior in details.

@primeappsin
Copy link

I have check Allow to retrieve a list of users and add tags the also getting 404 error

@mikeRozen
Copy link

I started to experience the same issue
It seems that this option no longer exists in the setting....

@ghost
Copy link

ghost commented Dec 18, 2017

@mikeRozen, Please create a separate issue and attach full logs.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants