CX innovatory storage integration in iphone - iphone

I'm developing an iPhone app where I'm integrating CX cloud storage so that I can store images and audio files. I"m trying to load login page on UIWebView but its giving me error.
here is my code
NSURL *loginUrl=[NSURL URLWithString:[NSString stringWithFormat:#"
https://www.cx.com/mycx/oauth/authorize?client_id=%#&redirect_uri=%#",clientID,redirectURi]];
NSURLRequest *requestObj=[NSURLRequest requestWithURL:loginUrl];
[webview loadRequest:requestObj];
I'm getting following error
Error Domain=WebKitErrorDomain Code=101 "The operation couldn’t be completed. (WebKitErrorDomain error 101.)" UserInfo=0x68102e0 {}

The CX innovatory has been discontinued.
Sorry for the inconvenience!

Related

How to Post an Image to facebook wall?

Using this Tutorail i scceessfully login to Facebook
http://www.raywenderlich.com/1626/how-to-post-to-a-users-wall-upload-photos-and-add-a-like-button-from-your-iphone-app
But i have NO Experience with facebook for iOS .
- (IBAction)rateTapped:(id)sender {
NSURL *url = [NSURL URLWithString:#"YOur Image url"];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[UIImage alloc] initWithData:data];
[variables setObject:img forKey:#"picture"];
FbGraphResponse *fb_graph_response = [fbGraph doGraphPost:#"/me/photos"
withPostVars:variables];
}
But here i confused that how we can pass image url ,bcz my image is on the same page And also when i use this code its gives me following four Errrors.
I have no luck. What's wrong? Thanks in advance
Please see this post - How to share or post by mail, twitter and facebook from the current application?
In this you will found How to share an UIImage to Facebook, Twitter, and Email.
1st error is due to an *undeclared variable.*
You are not added Facebook sdk to your project, that's why you are getting 2,3 & 4th errors.
For using Facebook features in your application you need to integrate Facebook API to your project.
The latest face book API is known as Graph API.
For further reference visit http://developers.facebook.com/docs/reference/api/
How to integrate Facebook sdk to your project:
http://www.raywenderlich.com/77/how-to-post-on-facebook-with-your-iphone-app

Https request is not working in iPhone device

I have to load all the required details from server in my application. eg; I wants to load countries detail from the following URL.
https://sub.domain.com//members/phone/XML_list_countries.php
But I am getting following error. But the same request working in Simulator.
ERROR
Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x3b8d10 {NSErrorFailingURLStringKey=https://secure.nymgo.com//members/softphone/XML_list_countries.php, NSErrorFailingURLKey=https://secure.nymgo.com//members/softphone/XML_list_countries.php, NSLocalizedDescription=The request timed out., NSUnderlyingError=0x3b5090 "The request timed out."}
CODE
NSURL *url=[NSURL URLWithString:#"https://secure.nymgo.com//members/softphone/XML_list_countries.php"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:#"GET"];
NSURLConnection *_connection = [[NSURLConnection alloc] initWithRequest:_request delegate:self];
if(!_connection){
NSLog(#"Can not make this request.");
}
I have implemented all the required delegate methods.
NOTE: My device is working in Wifi with proxy settings.
I don't know what is going wrong. Please help me to resolve this issue.
Have you Implement :
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
Also Refer this SO post.
You can use the ASIHTTPRequest framework also.
I have tested the same code in different iPhone 3G and iPhone 4 devices. it is working fine.
NOTE: I searched lot in google. I got lot of result. One of the result is like "some iPhone 3G is not supporting for HTTPS. So I decided to test it in different devices.

iOS Development: Why do I always get the "A connection failure occurred" on the 1st attempt, but success on the next?

I'm using the ASIHTTPRequest lib in my iOS app to make RESTful requests to my Rails 3 web app. I seeing a weird and somewhat consistent error the 1st time I try to make a POST request to my web app, but then the POST request works fine the on the second attempt. The exact error is...
Error Domain=ASIHTTPRequestErrorDomain Code=1 "A connection failure occurred" UserInfo=0xb513740 {NSUnderlyingError=0xb5135a0 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1005.)", NSLocalizedDescription=A connection failure occurred}
And here's my ASIHTTPRequest code for making the POST request...
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:#"http://myrails3app.heroku.com/tournaments/%d/register.json", tid]];
__block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setRequestMethod:#"POST"];
[request addPostValue:username forKey:#"username"];
[request setCompletionBlock:^
{
NSData *responseData = [request responseData];
NSLog(#"Success!");
}];
// Set the code to be called when the request fails
[request setFailedBlock:^
{
NSError *error = [request error];
NSLog(#"Error: %#", [error localizedDescription]);
}];
// Start the request
[request startAsynchronous];
It's worth mentioning that when it errors out, it errors out incredibly quickly! Also, for what it's worth, my Rail 3 app that I'm making the POST request to is hosted on Heroku. Your thoughts?
Thanks so much for your wisdom!
This issue I had a lot of hard time to figure out why. The problem resides in ASIHTTPRequest itself (iOS), not the rails code.
To make a long story short, the problem is specific to the use of persistent connection for every request sent by ASIHTTPRequest.
While this is good for GET requests, most server implementation does not allow persistent connection to be used with POST request.
I didn't really have time to investigate it deeply on the server side of things but I think that the problem resides with the 100-Continue header that should be sent (and which isn't) with request that has body attached to it (hence PUT/POST). If you want to have a deeper look at what I'm talking about go have a read at the spec sheet: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html
So the persistent connection used by ASIHTTPRequest wait for a 100 response to be sent, which is never sent. so it ends up being timed out.
A fix is to set persistentConnection to NO with your post requests like the following:
ASIHTTPRequest *req = [ASIHTTPRequest requestWithURL:url];
req.shouldAttemptPersistentConnection = NO;
Secure Connection Failed
An error occurred during a connection to login.yahoo.com.
SSL received a record with an incorrect Message Authentication Code.
(Error code: ssl_error_bad_mac_read)
The page you are trying to view can not be shown because the authenticity of the received data could not be verified.
Please contact the web site owners to inform them of this problem. Alternatively, use the command found in the help menu to report this broken site.
On iOS 5.1, even after upgrading ASIHTTPRequest to ASIHTTPRequestVersion = #"v1.8.1-61 2011-09-19" still needed:
ASIHTTPRequest *req = [ASIHTTPRequest requestWithURL:url];
req.shouldAttemptPersistentConnection = NO;
i also had to set response setHeader Connection to "close" in by Java servlet
response.setHeader("Connection", "close");

WebView Failed error in iPhone

I am trying to load website in webview.But i am getting error. Please correct me where i am wrong
URL : http://www.facebook.com/pages/Fresh-Caesar/144860502248864
Error : The operation couldn’t be completed. (WebKitErrorDomain error 101.)
We can resolve this problem by using string encoding
NSString *encodedString=[siteUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL *weburl = [NSURL URLWithString:encodedString];
Maybe look at WebKitErrorDomain error 101 for reference. Need to see more of your code though. Can you provide listing?

Cannot get the MPMoviePlayerViewController to play my media file

Having some issues getting this MPMoviePlayerViewController to work. I have two sample URLs pointing to the same Quicktime movie. The commented out URL doesn't work; the other one works fine.
I've monitored both via Fiddler and I can't see any issues in headers/etc.
Basically I'm trying to figure out a way to play an Azure hosted media file with some sort of security; either via pass through WCF service. Any one have this figured out? I'm pulling my hair out.
//NSString *moviePath = [[NSString alloc] initWithString:#"http://www.nov8rix.com/Services/CPipeline.svc/Media/42"];
NSString *moviePath = [[NSString alloc] initWithString:#"http://nov8rixstorage.blob.core.windows.net/searchpad/tutorial_portrait.mov"];
NSURL *url = [NSURL URLWithString:moviePath];
[url retain];
MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
[self presentMoviePlayerViewControllerAnimated:mp];
[mp release];
[url release];
Update: This is the error I'm receiving:
NSConcreteNotification 0x892e540 {name = MPMoviePlayerPlaybackDidFinishNotification; object = <MPMoviePlayerController: 0x8921570>; userInfo = {
MPMoviePlayerPlaybackDidFinishReasonUserInfoKey = 1;
error = "Error Domain=MediaPlayerErrorDomain Code=-12939 \"The server is not correctly configured.\" UserInfo=0x892ecb0 {NSLocalizedDescription=The server is not correctly configured.}";
A brief search on the web mentions that my problem may be that my media connection doesn't support byte Range Requests. This is probably true. Is there a way to allow Range Requests with WCF?
Yay I finally got this to work! The reason it was not working was because my WCF services didn't support Range Requests. Apparently iPhone Movie streaming requires range requests.
I changed my implementation to make direct requests to the Azure blob storage via SAS URLs. Works so far!
Thanks for posting your answer. I had the same error with my MPMoviePlayerViewController, and my problem was fixed too when I added support for Range Requests to my php mp4 file streamer. Streaming media to the iPHone requires some specific headers, else you get the "The server is not correctly configured" error.
I found some great hints for php Range Requests support here:
fread, (PHP 4, PHP 5), fread — Binary-safe file read