I want to use the AdServices framework in my app but I keep getting an error.
I've added AdServices as a framework
I've imported it
I try calling let token = try AAAttribution.attributionToken()
When running on device, this fails with the internalError code, saying Error posting to Attribution server.
Why? Nowhere online explains why this could be or how to fix it. I'm running in debug mode, could it be that?
On the simulator it's even worse and can't generate a token, but I'm not too bothered about that.
Related
In my iOS app, I am using the Alamofire library.
For all the post requests I am using in my app, I am seeing the same issue: most of the times it works, but sometimes(seems randomly) I am getting an error like this:
I wanted to debug this, so I activated CFNETWORK_DIAGNOSTICS(3) which gave me more info about the issue, but I am not able to see what is going wrong.
The console message when the httprequest fails:
The console message when the httprequest completes succesfully:
Could anyone help me out please?
I'm working on iPhone application using Appcelerator .Every thing in app working fine .but now one alert shows in this.
A quick google search should bring you to the list of error codes
(https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Constants/index.html#//apple_ref/doc/constant_group/URL_Loading_System_Error_Codes)
In here, we can find the following
NSURLErrorServerCertificateUntrusted = -1202
Meaning that there seems to be a problem with the server certificates.
A quick search on this error gives us a possible cause:
The time of the phone might be wrong
(One of my iPhone users gets an NSURLErrorServerCertificateUntrusted error)
EDIT
I have no experience with appcelerator. This workaround is for native only, however, the idea should be the same.
And a workaround, if you were using NSUrlConnection:
Which makes use of
NSUrlConnection -connection:didReceiveAuthenticationChallenge:
HTTPS with NSURLConnection - NSURLErrorServerCertificateUntrusted
Does anyone know anything about this error: "Error: Failed to load skin for error: NSURLError Domain"
After trying to open a download link in order to reskin an app on an iPad, I get the above error. The interesting/annoying thing about this is that it is not followed by any error code, which is making it difficult to search for in the forums as all of the results that I get include an error code e.g.: "NSURLErrorDomain error -1012"
The re-skinning has worked for another skin, but not for the one I'm working on now.
Any ideas? Any recommendations for diagnostic tests etc.?
NSURLErrorDomain error -1012 is kCFURLErrorUserCancelledAuthentication, meaning that the server issued an authentication challenge that was subsequently rejected. Causes for rejection vary, but could be invalid password supplied, or because the authentication challenge was not handled at all. It's hard to say without seeing the code.
Have resolved this now. Turned out that the URL I was using was simply incorrect.
I'm trying to test in Dartium browser using the Geolocation API. In particular I try doing the following
window.navigator
.geolocation.getCurrentPosition()
..then((pos) {
window.alert(pos.toString());
})
..catchError((PositionError error) {
window.alert("Error code: ${error.code}, Error message: ${error.message}");
})
..whenComplete(() => window.alert("complete"))
;
Ignoring the fact I'm using window.alert here, All I get is an error with the following message "Error code: 2, Error message: Network location provider at 'https://www.googleapis.com/' : Returned error code 400."
However the same code works in Google Chrome when I use "pub serve". It also works with Firefox. How do I overcome this error, and get it to work in Dartium? Is it even possible?
UPDATE
I took a look at the 403 bug and tried using the fix specified on this page http://www.chromium.org/developers/how-tos/api-keys, and when I first tried this, I got my credentials and setting wrong, I was getting a 403 error, but once that was resolved, and all the APIs enabled, plus the environment settings of
GOOGLE_API_KEY
GOOGLE_DEFAULT_CLIENT_ID
GOOGLE_DEFAULT_CLIENT_SECRET
I was back to "Network location provider at 'https://www.googleapis.com/' : Returned error code 400.", so I conclude it isn't the same issue. Though if someone can prove me wrong, I'd be happy.
FURTHER UPDATE
This is a bug. I've answered my own question below.
Maybe you are running into this issue
Geolocation giving 403 error
Should be fixable by providing Google API keys for Dartium
This is a bug.
I posted this question on https://groups.google.com/a/dartlang.org/forum/#!topic/web/UMJHJlQH7wc, where Seth Ladd asked me to open a bug.
I've opened a bug for this, https://code.google.com/p/dart/issues/detail?id=15866. So hopefully this will be resolved soon.
We already have Facebook working on our main desktop app without an issue. When I added the same setup code to our mobile site I received an error from the JavaScript SDK:
Received message of type object from https://s-static.ak.facebook.com, expected a string
Then, I changed the setup code to an exact replica from here: https://developers.facebook.com/docs/guides/mobile/web/ and received the exact same message.
This error only shows when the user-agent is iOS or Android in Chrome Developer Tools or in the iOS Simulator. When it's running from the desktop, we aren't seeing this error.
Any idea what's going on here?
Thanks :)
With all due respect, I believe that bokonic's answer is missing the point. The immediate reason of the message you're receiving is most likely javascript postMessage method. It is used to communicate your website with an object returned by window.open or an iframe's embedded website.
window.parent.postMessage(message, targetOrigin);
You might want to have a look at this article to see how it works.
According to MDN reference first argument of the postMessage method can be of any type. Still, Prior to Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3), the message parameter must be a string.
I tested the method on Chrome 28.0.1500.72 (latest version when writing this answer) and it works fine when passing an object but still throws the warning message to the console. I believe that facebook feels uncomfortable with passing some rich data as a string so they pass it as an object and simply doesn't care about the warning. Or, since there is a workaround (e.g. JSON.stringify), they have a bug they don't know about.
I had the same error. This isn't necessarily the reason you're getting it, but I ended up looking at the packets being received by my iphone simulator, and here's the error from s-statick.ak:
[truncated] <span>Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one o
For me, the error is that on my device(s), I'm accessing the site through an ip address (192.168.xx etc) and on local development I have hosts routing localhost to a url that is in my facebook app config... so the IP isn't configured for the app.
Facebook won't let me use an IP address, so it seems like the only option is a test deploy or a DNS server. Hope this helps you out.