How to deep link to an app without asking user? - javascript

There is a website called url genius.
How it works: you choose Instagram for example, you write your profile link, and then it creates a deep link, when you click on it either you're on iPhone or Android, it open directly the app WITHOUT ASKING "DO YOU WANT TO OPEN THIS LINK IN THE APP"
I tried to replicate this with some JS, my code first detect which device the user is on, then :
if the user is on Android it redirects with a window.location.replace to intent://www.instagram.com/profile/#Intent;package=com.instagram.android;scheme=https;end
if the user is on iPhone it redirects with a window.location.replace to instagram://user?username=profile
MY PROBLEM:
The link doesn't open directly in the app, it first asks to the user "do you want to open the link Instagram app". So how does URL Genius manage to redirect directly the user?

Related

How to launch an android app from website

I have an android application, which I want to launch from the website.
Here is the condition: If user had installed that app previously then give the option to open it, if not then go to the play store.
I used this code in my website:
Click me
It is working fine.
Now what I want that when a user searches my website on Google and the link appears, if someone clicks on that link it will open the app.
As well as this code:
Click me
is not working if I put this into a function like:
launchApp:function(){
$window.location.href='myapp://link';
}
this is not working.
How do I fix these issues?
Create an Intent filter for the main activity/ the activity which you want to open, something like this: https://stackoverflow.com/a/31404717/7527995

Can't connect with facebook through facebook app on ios

My problems is kind a strange. I created facebook app, to which I connect via js through iFrame. dummy link : http://kvizblic.com/test/koliko-staro-izgledas
I plugged that iFrame on other subdomain of the same site, and everything works fine. But when someone share my quiz on facebook, and you try to open the quiz through facebook app(not browser), and click on "Login with Facebook" nothing happens. This happen only on iPhone. If I try to do the same thing on android or desktop, everything works fine.
Maybe this is confusing, so once again.
My quiz is loading through iFrame on other subdomain of the same site. Quiz have Login with facebook button. When you click on that button, I contact facebook for your data via js "FB.login" and everything works fine.
But if you visit the same link through facebook app(after someone share it), and not browser, Login with facebook doesn't work. That happens only on iPhone(haven't check iPad). On android everything works fine.

web app opening external URL without leaving web app

I have a web app. The web app is added to home screen on iPhone. I have many external resources(Links) in my web app. Every time a link is clicked, it opens the web browser because target is set to _blank and there is no way for the user to go back. is it possible that the user will be able to open any of these resources without leaving my web app?
I was thinking of doing the following:
creating an iframe and have the links open within that iframe. I am hoping that there is something better out there.
If you still not sure what is it that I want?
a good example would be, if you look at facebook's native app for iPhone when you click on an article that someone posted, it opens the link within a frame that allow you to go back to your last page. In other words, you never leave their app. I understand that it is a native app and it is completely different but I believe that with JQuery Mobile or just JQuery it is possible. Am I wrong?

Facebook authentication

I have an application which displays canvas page, even though the user clicks "Dont allow" button in a request dialog. Here is my issue:
Load the page http://174.123.24.242/fb_leagle/fbhome.aspx
Login my application through facebook login page of my application.
Click on "Dont Allow" button in a request permission dialog.
In issue #3, if he clicks "Dont Allow" button it will also display the canvas page, and when I click the "BACK BUTTON" of the browser the next dialog appears. Actually I need to skip the canvas page from displaying when user clicks "Don't Allow" button and redirects to the next dialog.
This is my login URL of my application: pls review it and guide me where i need to change it.
Blockquote
**https://www.facebook.com/login.php?api_key=************&skip_api_login=1&display=page&cancel_url=https%3A%2F%2Fapps.facebook.com%2Fleaglecases%2F%3Ferror_reason%3Duser_denied%26error%3Daccess_denied%26error_description%3DThe%2Buser%2Bdenied%2Byour%2Brequest.&next=http%3A%2F%2Fwww.facebook.com%2Fdialog%2Fpermissions.request%3F_path%3Dpermissions.request%26app_id%3D***************%26redirect_uri%3Dhttp%253A%252F%252Fapps.facebook.com%252Fleaglecases%252F%26display%3Dpage%26response_type%3Dcode%26canvas%3D1%26perms%3Dpublish_stream%252Cemail%26from_login%3D1&rcount=1**
pretty format of this url:
https://www.facebook.com/login.php?api_key=************
skip_api_login=1
display=page
cancel_url=https%3A%2F%2Fapps.facebook.com%2Fleaglecases%2F%3Ferror_reason%3Duser_denied%26error%3Daccess_denied%26error_description%3DThe%2Buser%2Bdenied%2Byour%2Brequest.
next=http%3A%2F%2Fwww.facebook.com%2Fdialog%2Fpermissions.request%3F_path%3Dpermissions.request%26app_id%3D***************%26redirect_uri%3Dhttp%253A%252F%252Fapps.facebook.com%252Fleaglecases%252F%26display%3Dpage%26response_type%3Dcode%26canvas%3D1%26perms%3Dpublish_stream%252Cemail%26from_login%3D1
rcount=1
According to the OAuth Dialog Documentation, the user will be redirected to the original app-page.
If the user clicks "Don't Allow", the browser will redirect to
http://www.example.com/response?error=access_denied&
error_description=The+user+denied+your+request.
I suggest you use the $_GET['error'] variable to recognize users that denied the request!
The different errors can be found here

Getting Facebook Authentication Dialog to redirect to the original browser window running my application

I'm really new to the Facebook API and am having trouble getting the Facebook authentication dialog to redirect to the original browser window of my application. Here's the current process via client-side flow:
User is logged into my application (Ruby on Rails Application with Javascript/Jquery scripting).
User clicks on button in my application to log into his/her Facebook account.
The Facebook Authentication Dialog pops up in a 2nd window, asking user to log in.
User logs into Facebook
The Facebook Authentication Dialog asks the user if he/she wants to grant my application permission.
User clicks ok to share profile information.
The Facebook Authentication Dialog redirects the 2nd window to also open an instance of my application with the access token in the URL.
My questions are the following:
How can I get Facebook Authentication Dialog window to close after the user successfully logs into his/her Facebook account?
How can I gain access to the Facebook Access token after closing the second window?
The best way to illustrate what I'm ultimately trying to do is when somebody is signing into ESPN's site (1st window). Notice, that a modal window (2nd window) opens where you can click "sign in" (upper right corner) on ESPN's site. In this modal window, you can sign in with your Facebook account. Clicking on the "Sign in with Facebook Account" link will open a 3rd window which will take you through the Facebook Authentication process. When finished with signing into Facebook, the 3rd window will close and the modal window is updated based on the status of the 3rd window that closed.
How can I get the Facebook Authentication Dialog window to close and redirect to a preceding window?
Thanks!
Here is what I did in a similar situation. For the facebook dialog, have it redirect to a page on your site then simply grabs the access token and whatever other data you need. (In my case I just sessionized some of the user info). In the output of that page, include some javascript in your document.ready that will close this second window, and redirect to whatever page you want in the first window. It looks somthing like this.
window.opener.location.href = '/redirect_url_for_first_window'; //set url of the main window
window.close(); //close the popup
You can use window.opener in a popup window to refer to the window it came from. You can even have your popup window access variables and call functions of the main window as well.
Hope this helps!

Categories

Resources