How to close a childbrowser in Phonegap build application of Android - javascript

I have built an Android application using PhoneGap and for tweeting I have used the ChildBrowser Plugin and now when I hit my tweet button I am able to tweet my post. Now the problem is after that the twitter mobile website gets open and I'm unable to go back to my application.
What I want is as soon as I post, I should get a back button on the childbrowser onclicking which childbrowser gets closed and i get redirected to my application....
I have used this function
window.plugins.childBrowser.showWebPage('http://twitter.com/home?status=\'abcdefg\'');

window.plugins.childBrowser.onLocationChange=TwitterLocationChanged;
window.plugins.childBrowser.onClose=TwitterClosed;
window.plugins.childBrowser.showWebPage(TwitterUrl,{showLocationBar:true});
I use these three methods with the ChildBrowser plugin. It really enhances the control for the app. I can grab the URL from the browser and parse it. This is useful especially for Twitter Integration where I can load the message just tweeted and save it to a database.
You can also modify the .java file and hide the 'prev' and 'next' buttons, so that the user only sees the 'Exit' button. This will return the user to your app (quiet simply the ChildBrowser disappears) but you have a history of the URLs that were visited during that session, and with the QueryString data you can analyse some of how the user interacted.

I don't think its possible. When you open another page on a different domain, you have no more control over it. the users has to exit buy them self

Related

How can I open a mobile app (eg Facebook) via a browser redirect?

I've been searching for the past few hours for this and decided I'd just try asking.
I have a URL that people will visit, it loads a PHP page which checks a database for a specific Facebook link, and then instantly redirects them. I want it to open the app if they have it, otherwise it will go to the browser version.
The issue I'm facing is that I can't get the Facebook app to open when it's a redirect. If I instead create a button or a link and I tap on it, it will launch the app correctly, but navigating to that same link without the user interaction will not work.
I know it's possible because I've seen it done elsewhere, but I guess there is something I'm missing.
I've tried using headers("Location: fb://profile/username") and have also tried other Javascript options such as window.open, window.location, window.location.href and window.location.replace
So far I've only tested this an on android phone. The link initially launches in the chrome app.
If you have a look at this Youtube video, you'll see it's doing what I want to do. It goes to a website and then straight away launches the app.
https://youtu.be/Acl7JnRFxzI?t=17
Thanks!
I think you talked about Deep linking.
Deep linking is not supported on Web so there aren’t the same functionalities as on Android and iOS. You still need to guide your users in the right direction, so we recommend adding a link to your login page.

returning to cordova app from browser

I have a simple app built with ionic framework. The app at some point opens a browser (system browser) for payment (external payment gateway) and post payment, there is a success button displayed by a script on my server i.e the script sends a html page to the browser post successful payment.
The html contains a 'button' saying go back to application. I want user to have the app reopened on clicking of that button.
How to achieve this?
You need to look at the childbrowser/inappbrowser to deal with this. This is a perfect application.
You open the inappbrowser and take care of the payment forms on success you can then close the inappbrowser.
http://ngcordova.com/docs/plugins/inAppBrowser/

Like button that opens Facebook app

I know it is not possible to directly like something through any Facebook API, but since I can create a like-button on my website that the user can click, is it possible to create a like button that likes a page through the iOS facebook App?
I know you can include the functionality to like using the facebook app if you are developing iOS apps, but is it possible (using javascript?) to make a "like" button that likes through the facebook app, instead of through the browser?
It is not possible to force a like trough the facebook app, it still needs a second interaction of the user (a press on the like button).
A workaround would be to let the user like your page trough the webbrowser and after the like has been processed you redirect the user to the facebook app.
Read more about the events of a like button here:
https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/v2.4

Facebook Feed Dialog simplified?

I'm trying to add a share button or "feed dialog" as Facebook now seem to be pushing, to posts on my website. I'm basically looking for a way to simply allow users to click the button and be sent to the share preview page to post to their timeline or a friend's timeline etc.
The problem is that I don't really need an app (or at least I don't see the need in an app) and I'd like to avoid using their deprecated sharer url method.
What are my options? Can I use the feed dialog method without creating an app? I've tried going through their documentation but it just confuses me.
I'm not fussed whether it's JavaScript that opens a popup or if it redirects to a separate page (provided a redirect url can be provided to return users to the original page on my website).
you definitely need an app for the FB.ui feed dialog, but the user does not have to be logged in. Without an app, you can either use the sharer.php in a javascript popup, or you can use a like and/or send button. Just make sure to include Open Graph metadata in your page.
https://developers.facebook.com/docs/reference/plugins/send/
Be aware that you should also use an app (id) with the like or send button.

How to logout facebook - using code in rails application (Ruby on Rails Omniauth)

I tried to add more than one twitter and facebook accounts from my page via omniauth in rails.
Twitter working fine using force_login parameter.
But, facebook not supporting this.
i can add only one facebook account using /auth/facebook. After i tried to add new facebook account using /auth/facebook path then it returns to my home page only.
If i browse www.facebook.com in same browser then the login page not appearing. The lastly added facebook account page is opening.
when i logout from facebook in browser then i tried /auth/facebook path. its working fine.
So,
need to logout already opened facebook accounts in browser tabs, before i hit add facebook link in my page.
Can anyone help?
thanks.
by deafult, you cannot log in multiple facebook account within one browser unless you have a method to trigger browser(like private browsing-mozilla, incognito Window-chrome ) to let your user sign in. websites uses cookies to track their status.
however, facebook do provide auth_type=reauthenticate.
which the doc is here.
https://developers.facebook.com/docs/howtos/login/client-side-re-auth/
Any correct me if im wrong.

Categories