I'm searching for a cross-platform chat service that supports mobile (Android and iOS), and Desktop. I've looked into a few sites that offer chat services, but none of them seem to be what I'm looking for in terms of features. So I've decided to try to create an iOS application that will connect to a service that we will use for the desktop version.
That was just a bit of background info, but here's the question:
I am creating a url request in order to send information to the server that will handle and store my url request like so:
-(IBAction)clickedSendButton:(id)sender
{
urlReq = [NSString stringWithFormat:#"%#/mobile/PrivateChatMsgSending/?sid=%#&skey=%#&rid=%#&msg=%#",domain,((ApplicationAppDelegate *) [UIApplication sharedApplication].delegate).loggedProfileID,((ApplicationAppDelegate *) [UIApplication sharedApplication].delegate).loggedSessionID,receipientProfileId,txtFldChat.text];
NSURL *url = [NSURL URLWithString:[urlReq stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSURLRequest *urlrequest = [NSURLRequest requestWithURL:url];
connection = [[[NSURLConnection alloc] initWithRequest:urlrequest delegate:self] autorelease];
[self ShowIndicatorView:#"Sending..."];
}
So would I be able to pass these parameters to my php script on the server side all while being compatible with my desktop version? Is there anything within my application that could potentially inhibit my user's from receiving messages from desktop users? What might be a better solution to creating a multi-platform messaging service?
Related
I am trying to load a URL using webView in Objective C. I tried "https://www.tidecleaners.com/cincinati-pricing" and it works fine for all devices. But not working only in iPhone X.
Here its my code,
NSString *fullURL = #"https://www.tidecleaners.com/cincinati-pricing";
NSURL *url = [NSURL URLWithString:fullURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
self.WebView_O.delegate = self;
[self.WebView_O loadRequest:requestObj];
According to the Apple docs, error -1007 means NSURLErrorHTTPTooManyRedirects, i.e. the HTTP connection failed due to too many redirects.
Maybe the WebView implementation of the iOS version on your iPhone X is less tolerant to redirects than on older devices. However, this seems to be a server issue, and you probably won't be able to do much about it on the client side.
However, to get more information about the issue, you can enable a more verbose network log:
Open your scheme in Xcode.
Select Runon the left, and the Arguments tab on the right.
Add CFNETWORK_DIAGNOSTICS to the environment variables, and add 1, 2, or 3 as a value (depending on the verbosity you want).
Hopefully, the logs will then tell you a bit more about the error.
I am using the socket.io framework for a chat module in Objective-C code base. The connection however loses very frequently, sometimes right after the connection is made, it's disconnected. I have looked for background app and incoming call scenarios as answered in SO, but here it happens even if app is active and chat is in process.
Here is how I make the connection:
NSURL* url = [[NSURL alloc] initWithString:#"http://domainAddress:port"];
self.socket = [[SocketIOClient alloc] initWithSocketURL: url config: #{#"connectParams": #{#"user_id": [NSNumber numberWithInt:user_id]}}];
[self.socket setReconnects:YES];
I used the setReconnects: method as initially the socket was not reconnecting itself.
Please let me know how to resolve the issue and how can I debug more further.
I am developing a content reading app in which some data is displayed in a tale view and respective detail views.
Now I have already completed the app but there is a small bug.
I am using AFNetworking library for online data load and offline caching.
I have defined caching policy as described by following code.
Reachability *reach = [Reachability reachabilityWithHostname:#"google.com"];
if ([reach isReachable])
{
// Reachable
request = [NSMutableURLRequest requestWithURL:url
cachePolicy:NSURLRequestReloadIgnoringLocalCacheData
timeoutInterval:60.0];
}
else
{
request = [NSMutableURLRequest requestWithURL:url
cachePolicy:NSURLRequestReturnCacheDataDontLoad
timeoutInterval:60.0];
}
But I am having a small problem that if I load some data online and then turn off the internet connection and close the app.
And afterwords if I restart the app again in offline mode, the cached data should load but it is not happening.
I also have tried changing the caching policies as defined in the following link:
http://blog.originate.com/blog/2014/02/20/afimagecache-vs-nsurlcache/
app deployment target : iOS 6.0
devices : universal
xcode version : 6.1
AFNetworking lib version : 2.0
Any suggestion is appreciated, thanks in advanced
I am developing a content reading app in which some data is displayed in a tale view and respective detail views.
I have already completed the app but there is a small bug.
I am using AFNetworking library for online data load and offline caching.
I have defined caching policy as described by following code:
Reachability *reach = [Reachability reachabilityWithHostname:#"google.com"];
if ([reach isReachable]) {
// Reachable
request = [NSMutableURLRequest requestWithURL:url
cachePolicy:NSURLRequestReloadIgnoringLocalCacheData
timeoutInterval:60.0];
}
else{
request = [NSMutableURLRequest requestWithURL:url
cachePolicy:NSURLRequestReturnCacheDataDontLoad
timeoutInterval:60.0];
}
But, I am having a small problem that if I load some data online and then turn off the internet connection and close the app, and afterwords if I restart the app again in offline mode, the cached data should load but it is not happening.
I also have tried changing the caching policies as defined in this link.
app deployment target : iOS 6.0
devices : universal
xcode version : 6.1
AFNetworking lib version : 2.0
Replace all of the code you posted and just set the request cache policy to NSURLRequestUseProtocolCachePolicy.
As it stands, you're currently making a synchronous reachability query on every request. Either that or worse—it's returning immediately, but always returning before a real reachability state can be determined.
I want to implement Skype Instant Message sending/sharing on my iOS app. I just want to share certain link on skype.
Following is the code is am using:
//skype sharing
BOOL installed = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:#"skype:"]];
NSString * msg = [NSString stringWithFormat:#"Hi. Check it out.\n %# %#",[[self Detail] objectForKey:#"title"],self.shareLink];
NSString * urlSkype = [NSString stringWithFormat:#"skype:?chat=%#",msg];
NSURL * SkypeURL = [NSURL URLWithString:[urlSkype stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
if(installed)
{
[[UIApplication sharedApplication] openURL:SkypeURL];
}
else
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"http://itunes.com/apps/skype/skype"]];
}
If skype is installed, then also the above code isn't working as wanted. I want that the message-msg should automatically be sent(as Instant Message) to the Skype contact I select from the iOS app.
How do I implement this?
This is not possible, as written here in, Skype URI API Reference Documentation.
Or direct link, Skype URI API reference for Chat
And here is, Skype URI tutorial: iOS apps
They also added a note there,
With the recent redesign of the Skype for iOS client, URIs are not currently supported on the Skype for iOS 5.x branch.
It seems to me that the user is able to start a new chat with the selected Skype contact, but not able to send a message immediately.
To start a new chat with a given user:
NSString * urlSkype = [NSString stringWithFormat:#"skype:skype.test.user.1?chat",msg];
Check the Skype URI API reference (Chat) for more info.