WeatherKit with watchOS resulting with 401 - ios

My guess the issue is that the iOS app is com.example.MyApp and the bundle id for the watchOS app is com.example.MyApp.watchkitapp, so WeatherKit works perfectly on the iOS app after registering bundleID and request WeatherKit service.
But it does not work on watchOS, giving me 401 errors. I assume it is because of the bundleID, but maybe something else.
2022-06-25 08:58:58.999485-0500 JumpLog Watch App[72341:1201484] [WK_Geocode] failed to reverse geocode. location=CLLocationCoordinate2D(latitude: 37.62471885, longitude: -122.42857813), error=reverseGeocodeFailed(Error Domain=NMDeviceConnectionErrorDomain Code=2 "Timed out." UserInfo={NSDescription=Timed out.})
2022-06-25 08:58:59.019561-0500 JumpLog Watch App[72341:1201484] [Database] Attempting to invalidate an assertion that is no longer valid
2022-06-25 08:58:59.724802-0500 JumpLog Watch App[72341:1198856] [WeatherService] Encountered an error when fetching weather data subset; location=<+37.62471885,-122.42857813> +/- 5.00m (speed 34.21 mps / course 332.23) # 6/25/22, 8:56:58 AM Central Daylight Time, error=invalidJWTResponse(Optional(<NSHTTPURLResponse: 0x60000394bf20> { URL: https://weather-data.apple.com/v2/token } { Status Code: 401, Headers {
Connection = (
close
);
"Content-Length" = (
0
);
Date = (
"Sat, 25 Jun 2022 13:58:59 GMT"
);
Server = (
Apple
);
"Strict-Transport-Security" = (
"max-age=31536000; includeSubdomains"
);
"X-Apple-Origin" = (
"8961098f-b238-3714-ba44-5b569c861456"
);
"X-Cache" = (
"TCP_MISS from a23-33-47-144.deploy.akamaitechnologies.com (AkamaiGHost/10.8.2-41841244) (-)"
);
"X-Content-Type-Options" = (
nosniff
);
"X-Frame-Options" = (
SAMEORIGIN
);
"X-REQUEST-ID" = (
"2076edab-2346-4a50-83c1-e62f46aab9eb"
);
"X-XSS-Protection" = (
"1; mode=block"
);
} }))
And I have tried to register bundle id like com.example.MyApp.watchkitapp with my developer account, that results in error:
An attribute in the provided entity has invalid value
An App ID with Identifier 'com.example.MyApp.watchkitapp' is not available. Please enter a different string.
P.S. The real bundle ID is different, specific for my app.

Related

POST "base64 image string" not working in iOS 11

Previously I'm saving "base64imagestring" on server using AFNetworking POST method and it's working fine but now from last couple of days i am facing some issues. I didn't change any thing in the request code but i am not able to upload base64imagestring on server.
Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set., NSUnderlyingError=0x281f25170 {Error Domain= example.com Code=-1011 "Request failed: unacceptable (406)" UserInfo=<NSHTTPURLResponse: 0x2811e4be0> { URL: http://example.com/Api/image_save.php } { Status Code: 406, Headers {
Connection = (
"Keep-Alive"
);
"Content-Length" = (
226
);
"Content-Type" = (
"text/html; charset=iso-8859-1"
);
Date = (
"Wed, 29 May 2019 07:11:52 GMT"
);
"Keep-Alive" = (
"timeout=5, max=75"
);
Server = (
Apache
);
} }}}}

Alamofire doesn't make GET Request but call completion handler with Success

As an object, I have a problem with Alamofire (the same happens with AFNetworking) with an App Distributed internally which I can't debug the real Device; in particular with the iPhone X iOS 12.1.3 and only one device have this problem.
The requests work fine for all Testers, but in one iPhone X, without apparent reason, the Alamofire/AFNetwork, GET/POST, requests stop to come to the Web Service (I have access to real time log of WS and there are no request), but it seems that completion block with Success was called and the App follow the correct flow.
I can't debug this device and I don't know what happens; The Tester does not do any particular action to get this error.
This is one request of the many that do not work; I repeat, all work fine for an hour, after I don't know what happens, kill and reopen the App doesn't work.
Alamofire.request(completePath, method: .get, parameters: nil, encoding: URLEncoding.default, headers: ServiceSupport.sharedInstance.headerAlamofire()).responseJSON { (responseObject) in
if let json = responseObject.result.value {
if(ServiceSupport().headerIsOk(dictResponse: json as! NSDictionary)) {
completion(SUCCESS, "")
} else {
completion(FAIL, "ERROR")
}
} else {
completion(FAIL, "ERROR")
}
}
}
Someone can help me? Has anyone happened?
Thanks to all.
Edit:
The server should return different data when the request stop coming to WebService; Moreover I have the same problem, with the same Device, with AFNetworking.
Edit 2:
Response Header
[Response]: { URL: http://******/configuration } { Status Code: 200, Headers {
Connection = (
"Keep-Alive"
);
"Content-Length" = (
1060
);
"Content-Type" = (
"application/json;charset=UTF-8"
);
Date = (
"Thu, 31 Jan 2019 13:03:23 GMT"
);
"Keep-Alive" = (
"timeout=5, max=100"
);
Server = (
Apache
);
"Set-Cookie" = (
"JSESSIONID=96A0D1E4419A353E6115E34451793951; Path=/; HttpOnly"
);
"X-Frame-Options" = (
SAMEORIGIN
);
"X-XSS-Protection" = (
"1; mode=block"
);
} }
Thanks to all, the problem was the Cache!
URLCache.shared.removeAllCachedResponses()
URLCache.shared = URLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil)
This work for me.

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 .

ReAuthorize Facebook App in Parse ios SDK

I logged into my app using my FB credentials via the standard Parse SDK instructions. All worked fine, until I was playing with the phone settings and decided to switch off the application's fb authorization in the privacy settings in my phone.
I then couldn't log into the app using my FB credentials anymore. So I tried to remove the app from my facebook apps via facebook.com and waited a while, but still I get error:
com.facebook.sdk:ParsedJSONResponseKey={
body = {
error = {
code = 190;
"error_subcode" = 458;
message = "Error validating access token: The user has not authorized application xxxxxx.";
type = OAuthException;
};
};
code = 400;
headers = (
{
name = "Access-Control-Allow-Origin";
value = "*";
},
{
name = "Content-Type";
value = "text/javascript; charset=UTF-8";
},
{
name = Pragma;
value = "no-cache";
},
{
name = Vary;
value = "Accept-Encoding";
},
{
name = "Cache-Control";
value = "no-store";
},
{
name = "WWW-Authenticate";
value = "OAuth \"Facebook Platform\" \"invalid_token\" \"Error validating access token: The user has not authorized
application xxxxxxxxx.\"";
},
{
name = Expires;
value = "Sat, 01 Jan 2000 00:00:00 GMT";
}
); }}
I ended up solving the issue on my phone by resetting my privacy settings. Its an issue with iOS for not flushing the privacy settings once a user de-authorizes the application. It should have just asked for permission but the didn't.

bluemix notification does not receive in iPhone

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.

Resources