XingClient not working on ios9 - ios

I am using same client as I have used in iOS 8.4 but client is not working in iOS 9.
Same code is working in iOS 8.4 but it is not working in iOS 9 I don't know but it is weird my app stop working.
As from iOS 9 we have to set security key in info.plist which I am setting but still client is still not working.
I am getting below error :
Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: unauthorized (401)" UserInfo={com.alamofire.serialization.response.error.response= { URL: https://api.xing.com/v1/request_token } { status code: 401, headers {
"Cache-Control" = "no-cache";
Connection = "Keep-Alive";
"Content-Encoding" = gzip;
"Content-Length" = 93;
"Content-Type" = "application/json; charset=utf-8";
Date = "Tue, 01 Sep 2015 06:29:16 GMT";
"Keep-Alive" = "timeout=5, max=56";
Server = Apache;
"Set-Cookie" = "c_=baca882ff97bd2cf6a18b395933613a0; domain=.xing.com; path=/; expires=Mon, 27 Aug 2035 06:29:16 -0000; secure; HttpOnly";
Status = "401 Unauthorized";
Vary = "Accept-Encoding";
"X-Content-Type-Options" = nosniff;
"X-Frame-Options" = SAMEORIGIN;
"X-Logjam-Request-Action" = "WebService::OauthController#request_token";
"X-Logjam-Request-Id" = "xws-production-85b5a502132e496daedb58968863026a";
"X-Powered-By" = "Phusion Passenger 4.0.59";
"X-Request-Id" = "e82a4a5e-5876-4e1d-9017-85dbbbd1a0f4";
"X-Runtime" = "0.012464";
"X-XSS-Protection" = "1; mode=block";
} }, NSErrorFailingURLKey=https://api.xing.com/v1/request_token, com.alamofire.serialization.response.error.data=<7b226d65 73736167 65223a22 496e7661 6c696420 4f417574 68207369 676e6174 75726522 2c226572 726f725f 6e616d65 223a2249 4e56414c 49445f4f 41555448 5f534947 4e415455 5245227d>, NSLocalizedDescription=Request failed: unauthorized (401)}
I have added below code in my info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
I using referring code from below URL:
https://github.com/xing/XNGAPIClient

Related

Firebase Crash Reporting is not transmitting crash report when using Real iOS device

I have integrated Firebase Crash Reporting in my xcode Project by watching their tutorials here
Crash Reports are uploaded successfully when using simulator . but it shows error below when i am using a real device and crash reports are not uploaded. I searched for solution but have not got any which can solve this problem .
`<Error> [Firebase/Crash][I-CRA100001] Failed to transmit crash: Error Domain=com.google.FirebaseCrash Code=1 "Upload failed" UserInfo={NSLocalizedDescription=Upload failed, NSLocalizedFailureReason=HTTP Error Code 400: <NSHTTPURLResponse: 0x174039920> { URL: https://mobilecrashreporting.googleapis.com/v1/crashes:batchCreate?key=AIzaSyB8TUDtvxRxo5Kx3nEtIRKYlXDG%5Fj%2DRXmY&alt=json } { status code: 400, headers {
"Cache-Control" = private;
"Content-Encoding" = gzip;
"Content-Length" = 157;
"Content-Type" = "application/json; charset=UTF-8";
Date = "Thu, 01 Jun 2017 08:49:40 GMT";
Server = ESF;
Vary = "Origin, X-Origin, Referer";
"alt-svc" = "quic=\":443\"; ma=2592000; v=\"38,37,36,35\"";
"x-content-type-options" = nosniff;
"x-frame-options" = SAMEORIGIN;
"x-xss-protection" = "1; mode=block";
} }}`
at last i changed my version from 1.0 to 2.0 but it is still not working .

restkit ios: authentication start failing, if user provide wrong credential in first attempt and correct credential in subsquent attempts

When application is failed to login/authenticate successfully with restkit in first attempts due to wrong username or password, application never get success even with correct username and password, any help would be appreciated in this.
On login button i create the restkit instance and pass the information here is the code
func sendLoginRequest(userName:String,password:String){
let authenticate:String = String(format: "%#:%#", userName, password)
let plainData = (authenticate as NSString).dataUsingEncoding(NSUTF8StringEncoding)
let base64String = plainData!.base64EncodedStringWithOptions(NSDataBase64EncodingOptions(rawValue: 0))
print(base64String)
headers = ["Authorization" : String(format: "Basic %#", base64String)]
self.webInterface = DFWebInterface.shareWebInterface(DFModel.sharedInstance.bMockServer)
self.webInterface?.sendRequest(nil,request: LOGIN.rawValue, nil,headers: headers as! [NSObject : AnyObject])
}
then initialize my web interface class
-(id)init:(NSString*)strURL :(BOOL)mockServer{
if(nil!=(sDFWebInterface=[super init])){
NSURL *baseURL = [NSURL URLWithString:strURL];
DFAFHTTPClient* client=[[DFAFHTTPClient alloc] initWithBaseURL:baseURL];
sDFWebInterface->rkobjmanagerDF = [[RKObjectManager alloc] initWithHTTPClient:client];
[RKMIMETypeSerialization registerClass:[RKNSJSONSerialization class] forMIMEType:#"text/plain"];
[AFNetworkActivityIndicatorManager sharedManager].enabled = YES;
}
return sDFWebInterface;
}
After initializing i create mapping and send post request
Everything works fine if application send correct credential very first time
Here is the log for second time fail even application passing correct credential
2016-02-11 12:07:44.242 MyProject[7033:94063] I restkit.network:RKObjectRequestOperation.m:150 POST 'https://myproject-dev.apps.mycompany-iot-cloud.com/api/v1/authenticate'
2016-02-11 12:07:45.215 MyProject[7033:95645] E restkit.network:RKObjectRequestOperation.m:551 Object request failed: Underlying HTTP request operation failed with error: Error Domain=org.restkit.RestKit.ErrorDomain Code=-1011 "Expected status code in (200), got 401" UserInfo={NSLocalizedRecoverySuggestion={"timestamp":"2016-02-11T06:37:45.103+0000","status":401,"error":"Unauthorized","message":"Failed authenticating with username and password","path":"/api/v1/authenticate"}, NSErrorFailingURLKey=https://myproject-dev.apps.mycompany-iot-cloud.com/api/v1/authenticate, AFNetworkingOperationFailingURLRequestErrorKey= { URL: https://myproject-dev.apps.mycompany-iot-cloud.com/api/v1/authenticate }, AFNetworkingOperationFailingURLResponseErrorKey= { URL: https://myproject-dev.apps.mycompany-iot-cloud.com/api/v1/authenticate } { status code: 401, headers {
"Cache-Control" = "no-cache, no-store, max-age=0, must-revalidate";
"Content-Length" = 171;
"Content-Type" = "application/json;charset=UTF-8";
Date = "Thu, 11 Feb 2016 06:37:44 GMT";
Expires = 0;
Pragma = "no-cache";
Server = "";
"Set-Cookie" = "VCAP_ID=7487ff5a5d1940b895d0459b91eaec009a55f1ebd2774084b28fc6d24cab0f01; Path=/; HttpOnly";
"Strict-Transport-Security" = "max-age=31536000 ; includeSubDomains";
"Www-Authenticate" = "Basic realm=\"DEEPFIELD\"";
"X-Application-Context" = "gateway-dev:dev,cloud:0";
"X-Cf-Requestid" = "b0f1e586-8b60-4413-646d-515dbbe1f097, 954fd628-3beb-4777-41be-4eb50221b808";
"X-Content-Type-Options" = nosniff;
"X-Frame-Options" = DENY;
"X-Xss-Protection" = "1; mode=block";
} }, NSLocalizedDescription=Expected status code in (200), got 401}
2016-02-11 12:07:45.216 DeepField[7033:95645] E restkit.network:RKObjectRequestOperation.m:215 POST 'https://myproject-dev.apps.mycompany-iot-cloud.com/api/v1/authenticate' (401 Unauthorized / 0 objects) [request=0.9732s mapping=0.0000s total=0.9869s]: Error Domain=org.restkit.RestKit.ErrorDomain Code=-1011 "Expected status code in (200), got 401" UserInfo={NSLocalizedRecoverySuggestion={"timestamp":"2016-02-11T06:37:45.103+0000","status":401,"error":"Unauthorized","message":"Failed authenticating with username and password","path":"/api/v1/authenticate"}, NSErrorFailingURLKey=https://myproject-dev.apps.mycompany-iot-cloud.com/api/v1/authenticate, AFNetworkingOperationFailingURLRequestErrorKey= { URL: https://myproject-dev.apps.mycompany-iot-cloud.com/api/v1/authenticate }, AFNetworkingOperationFailingURLResponseErrorKey= { URL: https://myproject-dev.apps.mycompany-iot-cloud.com/api/v1/authenticate } { status code: 401, headers {
"Cache-Control" = "no-cache, no-store, max-age=0, must-revalidate";
"Content-Length" = 171;
"Content-Type" = "application/json;charset=UTF-8";
Date = "Thu, 11 Feb 2016 06:37:44 GMT";
Expires = 0;
Pragma = "no-cache";
Server = "";
"Set-Cookie" = "VCAP_ID=7487ff5a5d1940b895d0459b91eaec009a55f1ebd2774084b28fc6d24cab0f01; Path=/; HttpOnly";
"Strict-Transport-Security" = "max-age=31536000 ; includeSubDomains";
"Www-Authenticate" = "Basic realm=\"myproject\"";
"X-Application-Context" = "gateway-dev:dev,cloud:0";
"X-Cf-Requestid" = "b0f1e586-8b60-4413-646d-515dbbe1f097, 954fd628-3beb-4777-41be-4eb50221b808";
"X-Content-Type-Options" = nosniff;
"X-Frame-Options" = DENY;
"X-Xss-Protection" = "1; mode=block";
} }, NSLocalizedDescription=Expected status code in (200), got 401}
2016-02-11 12:07:45.216 DeepField[7033:94063] Error from server in Post Request
I just set header again for restkit httpclient and it starts working.
RKObjectManager* rkobjmanagerDF;
[[rkobjmanager.HTTPClient defaultHeaders] setValue:#"application/json" forKey:#"Content-Type"];
[[rkobjmanagerDF.HTTPClient defaultHeaders] setValue:#"application/json" forKey:#"Accept"];

Fetch friends email from Google Account on iOS

I am developing an iPhone application which uses Google Plus as one of the social logins. I want to fetch user friends emails.
I use this from Contact API 3.0, and add the access token I get from Google Plus token:
NSString *url=[NSString stringWithFormat:#"https://www.google.com/m8/feeds/contacts/default/full?alt=json&v=3.0&max-results=500&access_token=%#",accessToken];
But it returns the following error:
Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: forbidden (403)" UserInfo=0x15a8ea20 {com.alamofire.serialization.response.error.response= { URL: https://www.google.com/m8/feeds/contacts/default/full?alt=json&v=3.0&max-results=500&access_token=ya29.jfgsugfsugfjsgfjsgfhkjsgfjksguljcX3JXwPvEwrvcg } { status code: 403, headers {
"Accept-Ranges" = none;
"Cache-Control" = "private, max-age=0";
"Content-Type" = "application/json; charset=UTF-8";
Date = "Fri, 05 Jun 2015 11:34:01 GMT";
Expires = "Fri, 05 Jun 2015 11:34:01 GMT";
Server = GSE;
Vary = "X-Origin, Origin,Accept-Encoding";
"Www-Authenticate" = "Bearer realm=\"https://accounts.google.com/\", error=insufficient_scope, scope=\"https://www.googleapis.com/auth/contacts\"";
"alternate-protocol" = "443:quic,p=1";
"x-content-type-options" = nosniff;
"x-frame-options" = SAMEORIGIN;
"x-xss-protection" = "1; mode=block";
} }, NSErrorFailingURLKey=https://www.google.com/m8/feeds/contacts/default/full?alt=json&v=3.0&max-results=500&access_token=ya29.jfgsugfsugfjsgfjsgfhkjsgfjksguljcX3JXwPvEwrvcg, NSLocalizedDescription=Request failed: forbidden (403), com.alamofire.serialization.response.error.data=<7b0a2022 6572726f 72223a20 7b0a2020 22657272 6f727322 3a205b0a 2020207b 0a202020 2022646f 6d61696e 223a2022 676c6f62 616c222c 0a202020 20227265 61736f6e 223a2022 696e7375 66666963 69656e74 5065726d 69737369 6f6e7322 2c0a2020 2020226d 65737361 6765223a 2022496e 73756666 69636965 6e742050 65726d69 7373696f 6e220a20 20207d0a 20205d2c 0a202022 636f6465 223a2034 30332c0a 2020226d 65737361 6765223a 2022496e 73756666 69636965 6e742050 65726d69 7373696f 6e220a20 7d0a7d0a>}
You can't fetch a user's friend's email using G+. Google plus requires a users consent before revealing their email address. Since you haven't obtained consent from those users you can't get their email address. And just because someone is in your user's circles does not give your user permission to consent on their behalf.

Quickblox iOS - Logs in Fine. Can't get Facebook popup to appear?

I'm working my way through the relevant Quickblox modules starting with users. I can authenticate an application and register a new account and login.
I tried to login with a Facebook account using
[QBRequest logInWithSocialProvider:#"facebook" scope:#[] successBlock:[self successBlock] errorBlock:[self errorBlock]];
but nothing happens. When I try it with the sample code, I get a popup dialog. The API is so well hidden, I can't troubleshoot the popup. What am I missing?
The console output:
Request URL:https://api.quickblox.com/login.json
Request method: POST
Request parameters:{
provider = facebook;
}
Request headers: {
"Content-Type" = "application/json";
"QB-SDK" = "iOS 2.0.9";
"QB-Token" = XXXXXXXXXXXXXXXXXX;
"QuickBlox-REST-API-Version" = "0.1.1";
}
__65-[QBHTTPConnection generateRequestOperation:forPath:usingMethod:]_block_invoke126 -> Redirecting, request: https://www.facebook.com/dialog/oauth?response_type=code&client_id=XXXXXXXXXXX&redirect_uri=http%3A%2F%2Fapi.quickblox.com%2Fauth%2Ffacebook%2Fcallback&state=XXXXXXXXXXX.users.json&display=touch&scope=email, redirectResponse: https://graph.facebook.com/oauth/authorize?response_type=code&client_id=XXXXXXX&redirect_uri=http%3A%2F%2Fapi.quickblox.com%2Fauth%2Ffacebook%2Fcallback&state=XXXXXXXXXXXX.users.json&display=touch&scope=email
__65-[QBHTTPConnection generateRequestOperation:forPath:usingMethod:]_block_invoke126 -> Redirecting, request: https://m.facebook.com/v2.1/dialog/oauth?redirect_uri=http%3A%2F%2Fapi.quickblox.com%2Fauth%2Ffacebook%2Fcallback&state=XXXXXXXXXXX.users.json&scope=email&response_type=code&client_id=XXXXXXXXXXXXXXX, redirectResponse: https://www.facebook.com/dialog/oauth?response_type=code&client_id=365974270237542&redirect_uri=http%3A%2F%2Fapi.quickblox.com%2Fauth%2Ffacebook%2Fcallback&state=XXXXXXXXXX.users.json&display=touch&scope=email
__65-[QBHTTPConnection generateRequestOperation:forPath:usingMethod:]_block_invoke126 -> Redirecting, request: https://m.facebook.com/login.php?skip_api_login=1&api_key=365974270237542&signed_next=1&next=https%3A%2F%2Fm.facebook.com%2Fv2.1%2Fdialog%2Foauth%3Fredirect_uri%3Dhttp%253A%252F%252Fapi.quickblox.com%252Fauth%252Ffacebook%252Fcallback%26state%XXXXXXXXXXXX.users.json%26scope%3Demail%26response_type%3Dcode%26client_id%3D365974270237542%26ret%3Dlogin&cancel_uri=http%3A%2F%2Fapi.quickblox.com%2Fauth%2Ffacebook%2Fcallback%3Ferror%3Daccess_denied%26error_code%3D200%26error_description%3DPermissions%2Berror%26error_reason%3Duser_denied%26state%XXXXXXXXXXXXXXXX.users.json%23_%3D_&display=touch&_rdr, redirectResponse: https://m.facebook.com/v2.1/dialog/oauth?redirect_uri=http%3A%2F%2Fapi.quickblox.com%2Fauth%2Ffacebook%2Fcallback&state=XXXXXXXXXXXX.users.json&scope=email&response_type=code&client_id=XXXXXXXXXXXXXX
Response headers: {
"Cache-Control" = "private, no-cache, no-store, must-revalidate";
"Content-Encoding" = gzip;
"Content-Type" = "text/html; charset=utf-8";
Date = "Mon, 20 Oct 2014 19:39:49 GMT";
Expires = "Sat, 01 Jan 2000 00:00:00 GMT";
Pragma = "no-cache";
"Set-Cookie" = "datr=IFpFVEOSkGoM49QHhNpqt37f; expires=Wed, 19-Oct-2016 19:39:49 GMT; Max-Age=63072000; path=/; domain=.facebook.com; httponly, reg_ext_ref=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; domain=.facebook.com, reg_fb_ref=https%3A%2F%2Fm.facebook.com%2Flogin.php%3Fskip_api_login%3D1%26api_key%XXXXXXXXXXX%26signed_next%3D1%26next%3Dhttps%253A%252F%252Fm.facebook.com%252Fv2.1%252Fdialog%252Foauth%253Fredirect_uri%253Dhttp%25253A%25252F%25252Fapi.quickblox.com%25252Fauth%25252Ffacebook%25252Fcallback%2526state%253De1d84aXXXXXX.users.json%2526scope%253Demail%2526response_type%253Dcode%2526client_id%253D365974270237542%2526ret%253Dlogin%26cancel_uri%3Dhttp%253A%252F%252Fapi.quickblox.com%252Fauth%252Ffacebook%252Fcallback%253Ferror%253Daccess_denied%2526error_code%253D200%2526error_description%253DPermissions%252Berror%2526error_reason%253Duser_denied%2526state%253De1d84ad000164XXXXXXXXXb40ab6b321.users.json%2523_%253D_%26display%3Dtouch; path=/; domain=.facebook.com, m_ts=1413833989; path=/; domain=.facebook.com; httponly";
p3p = "CP=\"Facebook does not have a P3P policy. Learn why here: http://fb.me/p3p\"";
"x-content-type-options" = nosniff;
"x-fb-debug" = "BImF8RRsnETruM0QYD0fBV3KszW1T4VMWl1Btxl3//5CcsLSJgLDG9Sz99coS+qYlDsx53SKC6pvpNt+WVzhFA==";
"x-frame-options" = DENY;
"x-xss-protection" = 0;
}
Response JSON: (null)
Well, now I feel silly. I kept working on the app and then I discovered that the dialog screen actually popped UNDER the top viewController.

Instagram API, AFNetworking 2.0 iOS client 400 error

I haven't changed anything in my app and my code seems to generate the proper URL with access token attached, but I am getting a 400 error bad request for the past day. It doesn't seem as if Instagram has changed the endpoint. Can someone help me decipher the error log to see if there is any usable info here to help me debug? Access Token x'd out.
Failure Error Domain=AFNetworkingErrorDomain Code=-1011 "Request failed: bad request (400)"
UserInfo=0x9261450 {NSErrorFailingURLKey=https://api.instagram.com/v1/locations/search?lat=37.785834&lng=-122.406417&distance=50&access_token=XXXX, AFNetworkingOperationFailingURLResponseErrorKey=<NSHTTPURLResponse: 0x92627d0> { URL: https://api.instagram.com/v1/locations/search?lat=37.785834&lng=-122.406417&distance=50&access_token=XXXX }
{ status code: 400, headers {
"Cache-Control" = "private, no-cache, no-store, must-revalidate";
Connection = "keep-alive";
"Content-Language" = en;
"Content-Type" = "application/json; charset=utf-8";
Date = "Tue, 26 Aug 2014 05:19:53 GMT";
Expires = "Sat, 01 Jan 2000 00:00:00 GMT";
Pragma = "no-cache";
Server = nginx;
"Set-Cookie" = "csrftoken=26b1980509fc8303e630689c2d483074; expires=Tue, 25-Aug-2015 05:19:53 GMT; Max-Age=31449600; Path=/, ccode=US; Path=/";
"Transfer-Encoding" = Identity;
Vary = "Cookie, Accept-Language";
"X-Ratelimit-Limit" = 5000;
"X-Ratelimit-Remaining" = 4999;
} }, NSLocalizedDescription=Request failed: bad request (400)}

Resources