I have been trying to send Push Notification to IOS device using Bluemix, In dashboard, It is giving successful response that Notification sent but I didnt receive the same in any of my device.
Note: Getting an response "UserId not set". Please do the needful.
Response:
Device is already registered. Return the device Id - Response is: httpStatus: 200
responseHeaders: {
"Cache-Control" = "no-cache=\"set-cookie, set-cookie2\"";
Connection = "Keep-Alive";
"Content-Type" = "application/json";
Date = "Fri, 31 Jul 2015 02:23:43 GMT";
Expires = "Thu, 01 Dec 1994 16:00:00 GMT";
"Set-Cookie" = "LtpaToken2=OwuD5qhTnGA48q9L5dQ+U2niyL+3R52+0ckK09o1Q2dPfq6ZJeIqXtvlb3mdwCP68o+LrjLdHcZOIqTwnQrgM7E3GPOde80ENO5T73uNbi/nUx1G358YpBu/D7TXO/gN+TT6zv/ShGI+ECDQwQVjkk5o7e8PRNje7QwGTe6ls/KASQ3PnPrt5HaKmdhaCtGqDm/dfbhIdF04uXWsAfLUpBqzrzt3lHd1nxQkOfCHyKp7xl2Rp3lh4x6oIDNMHph04zgukwVOEHftKXN4TgAj8Xd0ug9cGxuKthfPCr2gsoKc0KrOABSODHUhcHjW010YnU0Eam60Yr+iR5axhzs1M8FY83VOXC+CcrQINBfCakvArP0PecwVTK2qfSQSnfPBD+wokCwMX78YMukIXs2fprsFwvNE/ZE9tKIfiz9C9ruVe0c6h79fbUx9C0yuugZMDaOheiEXfgAUL6QVu4cWQG1Ul1HV+8SVq9VKh1GjKd4=; Path=/; HttpOnly";
"Transfer-Encoding" = Identity;
"X-Backside-Transport" = "OK OK";
"X-Cf-Requestid" = "bbb1720e-9d41-44d8-4151-871119ed5a68";
"X-Client-IP" = "60.51.27.236";
"X-Global-Transaction-ID" = 987171295;
"X-Powered-By" = "Servlet/3.0";
}
responseJson: {
createdTime = "2015-07-31T02:23:06Z";
deviceId = "84278A9D-FB54-4E71-ASS1-F5F62113C813";
lastUpdatedTime = "2015-07-31T02:23:06Z";
token = 281e351bfa3350e9e2ca96ec95dbf635363e30c708a14903awew7c670eba06ac;
userId = "UserId not set";
}
Response text: {"deviceId":"84278A9D-FB54-4E71-ASS1-F5F62113C813","token":"281e351bfa3350e9e2ca96ec95dbf635363e30c708a1490xxx7c670eba06ac","userId":"UserId not set","createdTime":"2015-07-31T02:23:06Z","lastUpdatedTime":"2015-07-31T02:23:06Z"}
Can you please check to make sure your push certificate that you have uploaded is not expired. You can find this in the Push Dashboard under Push->Configuration
When you send the push notification is the application in the background? Unless you have code written to specifically handle when a push notification is received and the application is in the foreground you will not see a push notification. You can write some code in the "didReceiveRemoteNotification" function, such as showing an alert for a quick test.
Related
I dont know how to where i should start from.
So, pleaes forgive me if I'm asking wrong question.
I have an iOS app. The app request to an API of CentOS server which using FuelPHP to get list of data. Also, we are using CDN to cache the data (Azure -Verizon)
When I get respond header, I saw that :
Access-Control-Allow-Headers" = ": X-Requested-With";
"Access-Control-Allow-Methods" = ": post, get, origins";
"Access-Control-Allow-Origin" = ": *";
"Cache-Control" = "no-cache, must-revalidate";
Connection = close;
"Content-Type" = "application/json";
Date = "Mon, 13 Mar 2017 07:13:01 GMT";
Expires = "Sat, 26 Jul 1997 05:00:00 GMT";
Pragma = "no-cache";
Server = "Apache/2.2.15 (CentOS)";
"Transfer-Encoding" = Identity;
"X-Powered-By" = "PHP/5.5.32
What should I do to make Cache-Control become max-age=xxx?
what I want is to cache the data via CDN of window Aruze Verizon.
Please help, If my question is not clear, please guide me, i will provide mor information.
We are experiencing an issue downloading file, when we activate airplane mode.
We are using the following Manager configuration:
let configuration = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier(self.sessionIdentifier)
configuration.HTTPMaximumConnectionsPerHost = 1
let manager = Alamofire.Manager(configuration: configuration)
The expected behaviour is that when you activate the airplane mode, the response handler is not called and the download is still active and waiting for the internet connection to be active again. But the response is called and we get the following information:
Error:
Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL}
Data:
nil
Response:
status code: 200, headers {
"Accept-Ranges" = bytes;
"Cache-Control" = "max-age=604800";
"Content-Length" = 138310665;
"Content-Type" = "video/mp4";
Date = "Thu, 20 Oct 2016 13:09:19 GMT";
Etag = "\"3168233889\"";
Expires = "Thu, 27 Oct 2016 13:09:19 GMT";
"Last-Modified" = "Fri, 25 Sep 2015 09:38:30 GMT";
Server = "ECAcc (fcn/40BD)";
"X-Cache" = HIT;
And the original request
Notice that the error does not contain, even resume data, which I think it should.
And also this is not the case when we test it in the simulator and stop the internet connection.
Any help will be much appreciated!
I am making a multi part upload request to Google drive api in Objective c and this is my request parameter
url:https://www.googleapis.com/upload/drive/v2/files?uploadType=multipart
{
Authorization = "Bearer token here";
"Content-Length" = 1259175;
"Content-Type" = "multipart/related; boundary=1F538E72-A1C7-4D64-A90C-7286FADE6E92-4313-000022A3405EDE24";
}
i get the error response as follows with status code 400
{
"Alternate-Protocol" = "443:quic,p=0.02";
"Content-Length" = 44;
"Content-Type" = "text/html; charset=UTF-8";
Date = "Fri, 09 Jan 2015 14:35:35 GMT";
Server = "UploadServer (\"Built on Dec 19 2014 10:24:45 (1419013485)\")";
}
And it reports
"Invalid multipart request with 0 mime parts." {NSLocalizedDescription=Invalid multipart request with 0 mime parts.}
Can anyone tell me why i am facing this issue.
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)}
A few time ago I've developed an iOS app with MGTwitterEngine and XML parsing option.
Since Twitter updated the API to 1.1, seems to be that all messages must be called with JSON format.
After a long nightmare to integrate YAJL library with MGTwitterEngine, my program makes a Succeeded Request but the statusesReceived delegate method is not fired.
I've checked if the delegated is properly assigned, and everything is correct. After launch the HTTP request I get the response OK but not any message.
Here an example of the call I made:
INFO -> Twitter URL: https://api.twitter.com/1.1/statuses/user_timeline.json?since_id=1&screen_name=CFarmaceutico&count=50
And here the response:
MGTwitterEngine: (200) [no error]:
{
"Cache-Control" = "no-cache, no-store, must-revalidate, pre-check=0, post-check=0";
"Content-Encoding" = gzip;
"Content-Length" = 10778;
"Content-Type" = "application/json;charset=utf-8";
Date = "Thu, 28 Nov 2013 11:57:33 GMT";
Expires = "Tue, 31 Mar 1981 05:00:00 GMT";
"Last-Modified" = "Thu, 28 Nov 2013 11:57:33 GMT";
Pragma = "no-cache";
Server = tfe;
"Set-Cookie" = "lang=es, guest_id=v1%3A138563985309026395; Domain=.twitter.com; Path=/; Expires=Sat, 28-Nov-2015 11:57:33 UTC";
Status = "200 OK";
"Strict-Transport-Security" = "max-age=631138519";
"x-access-level" = "read-write-directmessages";
"x-frame-options" = SAMEORIGIN;
"x-rate-limit-limit" = 180;
"x-rate-limit-remaining" = 166;
"x-rate-limit-reset" = 1385639983;
"x-transaction" = da0b638eef7ffe43;
"x-xss-protection" = "1; mode=block";
}
2013-11-28 12:57:34.025 Otsuka On[60073:a0b] Request Suceeded: 59CA5086-8AA9-4632-978B-2B9F2334D704
But the statusesReceived method is not called anymore.
Any idea?
Thanks.
no idea - but MGTwitterEngine does not support API 1.1, and when API 1.1 was released, we tried hard to get MGTwitterEngine working - and failed. Eventually we converted our app to FHSTwitterEngine - and it works fine since then. It was relatively straightforward process so I would strongly recommend you to do the same. It will take you less time than fixing bugs in MGTwitterEngine.