Open Url handling - iphone

I have a problem that I am opening the "http://itunes.apple.com/in/app/eft-feel-happy-fast/id474157386?mt=8" type of url on a table view didSelectrowIndexPath, then app store open and user can download my app but the problem is that I want to go back to my application from the app store how is it possible can any one help me?
Thanks in advance.

If you open safari and leave your app, you cannot control what happens next. The user will return to your app when he/she chooses to.

Don't use default browser of device,you can't come back from that. For this create new class and use webBrowser. By the help of this u stay in you app.....

You can use SFSafariViewController class to redirect the links within your apps and make sure that the user doesn't leaves the app. Here is a tutorial on how to do it.
SFSafariViewController Tutorial
PS- It is written in swift.

Related

(Freshplanet Facebook-ANE) How to make the login screen in-app

I am currently using the Freshplanet Facebook-ANE and was wondering about something that is bugging me currently.
I want to implement a simple post to wall feature inside my app, and this ANE does exactly what I want, except for one thing. When I do the actual post to wall dialog, it pops up just like I want it, in a WebView inside my app. The login takes me to Safari or the Facebook app if I have it installed, which is what I want to avoid.
Here's the line I'm using to open the session :
Facebook.getInstance().openSessionWithPublishPermissions(POST_PERMISSIONS, OnSessionOpened, true);
That works perfectly for posting, but takes me outside of the app.
I've tried using the same .dialog() function I use for the post, and it worked, but I can't seem to post to the wall afterwards (maybe I'm not correctly catching the access token or something)
Any help would be appreciated. I believe I've set up everything correctly on my Facebook App page, and that my AS3 project is correctly setup.
Thanks for the help !
If you want to strictly stay into the app, you must use StageWebView. It's something like a wrapper of HTML page inside Flash.
First check if you are logged in (this is code from Facebook.as of FreshPlanet):
/** True if a Facebook session is open, false otherwise. */
public function get isSessionOpen() : Boolean
{
if (!isSupported) return false;
return _context.call('isSessionOpen');
}
If there is no session - start the web view. Otherwise - continue as usual.
You have to keep in mind that StageWebView is pretty.. how to say it.. bad is the kindest thing I could say :) You must implement your own close button, listen for url changing, etc.
You could look into Facebook AS3 SDK, which at least has some kind of 'platform' for the web view..
Good luck!

Typing my app name into the Facebook search bar triggers FBRPC error

Okay, I'm at my wits end - I can't figure this one out. If you go into Facebook in Safari on a desktop/laptop and in the search bar type the name of my app: "Hopple Hop", and then click on the app itself (not the app page), instead of launching the app, it triggers this error message in Safari:
"Safari can't open "fbrpc://nativethirdparty/f?appid="
Followed by hundreds of characters. Basically, it's a big long URL string, in the "fbrpc://" protocol, and it tries to launch directly into the browser as-is.
As you can imagine, this is not the intended functionality of searching for my app. The intended functionality is that they type "Hopple Hop", click on it, and the Facebook canvas game starts. If you go to
https://www.facebook.com/appcenter/hopplehop/
You can see it there. And if you click "Play Now", it launches properly from:
https://apps.facebook.com/hopplehop/
I know it's probably a configuration issue. There is also an iOS app to go with it.
I'm not sure what the end cause was, to be honest. It appears to be a very specific configuration issue with my phone / Facebook account and the way I've authorized the game. It doesn't seem to be an issue for anyone else. I don't unfortunately know the root cause.
But if anyone else sees this error, it's likely only you are seeing it.
Thanks,
Glen

Open link in browser or open app

I have made an iphone app. The app calls the webpage and displays the content. Server side coding is in php. The problem is I have several links in the webpage. When I click on the link in the webpage it opens the entire page and I am no longer able to go back to where I was.
I tried iframe but not all the website support it like google, facebook. What I am looking is someway to open the link in browser or launch the another app, like the app of facebook. I have quite thoroughly searched for the solution without much luck.
Any pointers would be greatly appreciated.
Thanks
To implement navigation for UIWebView you can do the following: create two buttons, one for going forward in history and one for going back. And here is the code for that buttons you must include:
//For going forward
if (yourWebView.canGoForward)
{
yourWebView.goForward();
}
//For going back
if (yourWebView.canGoBack)
{
yourWebView.goBack();
}

iPhone/Objective-C - UIDocumentInteractionController Class Reference when presenting a view and delegates

I am using UIDocumentInteractionController inside my application in order to present the Instagram filter screen as described here from within my application:
http://instagram.com/developer/iphone-hooks/
UIDocumentInteractionController Class Reference documentation:
I'm not quite sure whether it's possible to dismiss the Instagram filter screen and return back to my application with the modified UIImage after it has been uploaded (or maybe after it's been filtered) by Instagram.
As far as I know I don't think this is possible, as there's no delegate method that's available once an application has been spawned and this would most-likely involve a dismiss button from within the Instagram filter screen.
Either way, I'd also like to know whether there's a suitable way to at least return the URL/ID from Instagram once it's been posted so that I can reference the modified image from inside my application using either their API documentation or by just referencing the image url.
Thanks in advance and any help would be greatly appreciated.
My understanding from reading the material you provided is that using UIDocumentInteractionController to do this actually opens Instagram and switches to it. If that's true, then the only way to receive a callback or any kind of information from Instagram would be if they supported it explicitly. I encourage you to ask them by email (contact#instagr.am) or on the Google group (perhaps you already did?).
(If they did support it, I'd imagine you might be able to call up Instagram with a URL like instagram://[regular options]?callback=myapp://callback_url, which they would then open when finished.)

titanium webview - go to default browser when clicking links

in titanium, i'm using the webview to display a wordpress blog page, that is already formatted for mobile browser. instead of writing my own interface, this works as a good work around. the apps sole focus isn't the browser.
but my issue lies, when the user clicks a link outside of the initial displayed domain. i only want the main domain to be displayed in the apps browser. if any other link is clicked, that takes the user outside of that domain, i want to have it open in the phones default browser.
can anyone point me in a direction for this. i tried adding a listener to try and catch link clicks, however, i've been unsuccessful.
thanks
in this blog posting I show how to find links in a webpage and change the link behavior. Using the same method, you can intercept the links and redirect to opening the URL in the devices default browser
One solution would be to catch the onclick() Event by Javascript inside the WebView (your blog code) and handle this by a custom handler. Maybe you can inject the javascript event handler code into the running WebView through Titanium.
Another solution is to make your blogposts readable for app technology and create a new data interface. This is the way I would do. For that I would use some kind of JSON data format and a simple REST Interface to get the data.
I don't think bove solutions are that simple. If you want an app with "great feeling", you'll have to handle the events by your own. Maybe Phonegap would be a better solution four your problem. But there you will still need a kind of REST/JSON interface for your blog data. The idea behind an app is, that the main code is in your app and you get the content from a remote source. This way you'll get an advantage compared to a simple browser optimized site.