The URL redirects to another URL which in turn is supposed to redirect back to my app, but it doesn't. Am I missing something here?
Actual redirect URL is: https://mpivchev.github.io/Reddit-App/redirect?state=XXXXXX&code=XXXXXX
Intent filter:
<activity android:name=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="mpivchev.github.io"
android:scheme="https"
android:path="/Reddit-App/redirect" />
</intent-filter>
</activity>
WebView stays on the redirect page instead of returning back to the app:
Related
I am trying read barcod and then get URL from this barcod and then trying to open this URL. it show this page which is open with app or continue with browser . even if select open with app . it will ask me this page next time. how can directly open this url with Autocad a360 app.
this is my code:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(StringURL));
startActivity(intent);
Add this code to manifest.
<activity
android:theme="#style/AppTheme.Launcher"
android:name=".features.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="YOURSITE.com"
android:scheme="http" />
</intent-filter>
</activity>
App will launch when you try to open http://YOURSITE.com
Deep link was correct answer
Below is my code, where
<activity
android:name=".activities.Profile"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="somename"
android:pathPrefix="/league/user"
android:scheme="https" />
</intent-filter>
</activity>
I want to avoid opening the activity when url contains proceed as param. Can anyone point me how to do this.
EDIT
Giving an example
somename/league/user?id=100
somename/league/user?id=100&proceed=4
So, i want to avoid the url pointed out in "2" when proceed as param, from opening the activity.
After clicking verification link on a mail, how it directly redirect to Android app please explain.
Example :
you need to use intent filter in the activity which you want to launch on click of URL like this:
<activity
.
.
.
android:windowSoftInputMode="stateVisible|adjustResize" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="http"
android:host="www.yourdomain.com"
android:pathPrefix="/path/to/resource" />
</intent-filter>
</activity>
in your case
scheme will be https
host will be www.quora.com
pathPrefix will be /signup/confirm_email
#RAHUL TIWARI
this is Register_PAGE AND i wrote the code same of you...
In activity after clicking submit button, a verfication link will be send to email addresss..
(am stuck in) afer cliking verfication link it must came back to myApp..
Manifest.xml
<activity android:name=".Register_User">
android:windowSoftInputMode="stateVisible|adjustResize" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="http"
android:host="scaano.com"
android:pathPrefix="/Welcome/userprofile" />
</intent-filter>
</activity>
this one is email am getting in mail:
[0enter image description here
My Android app can share links via Twitter or Facebook.
If someone clicks on a link that was shared and they already have the app installed, how can I make the app launch directly?
Updated -
Simple Issue Fixed from here -
Make a link in the Android browser start up my app?
You need to add <Intent-filter> under <activity> tag in manifest.xml file like
<activity android:name=".ui.MyActivity" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>
When another application tries to share any of these things by constructing an intent and passing it to startActivity(), your application will be listed as an option in the intent chooser.
If the user selects your application, the corresponding activity (.ui.MyActivity in the example above) will be started. It is then up to you to handle the content appropriately within your code and UI.
And go to this for better understanding: http://developer.android.com/training/sharing/receive.html
Facebbok/twitter
facebook
After facebbok login OnComplete() is called. So, fire your intent in this method.
public void onComplete(Bundle values)
{
# fire desired intent
}
twitter
put this code into your manifest file with activity name and on which activity
want to redirect put the below line so link is created and you will redirect
<activity
android:name="com.example.mainactivity"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="home"
android:scheme="oauth" />
</intent-filter>
</activity>
*********************************************************************
<h6>put this into your mainactivty</h6>
static final String TWITTER_CALLBACK_URL = "oauth://home";
static final String TWITTER_CALLBACK_URL = "oauth://home";
There are many answers in stackoverflow showing how to lauch app from a web browser ,but I am not sure what went wrong with my code, that never seems to be doing the intended.
I am trying to launch my app by a URL from any other app like web browser,initially
my manifest file looks like this
<activity android:name=".Main">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="http" android:host="ebay.com" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
And When I typed http://ebay.com in the browser that never started my app.Obviously,how does the browser know about my app?,then i tried the other way around and added another Activity called MyActivity and altered the manifest file as
<activity android:name=".Main">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MyActivity">
<intent-filter>
<data android:scheme="http" android:host="ebay.com" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
and tried in my Main Activity
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("http://mycityway.com")));
Thus producing the intended result.I can also start another application Activity using this method.
But most of the answers here says that the later is possible.What is the mistake i am doing,I couldn't launch my app from browser.Please guide me.
And When I typed http://ebay.com in the browser that never started my
app.
It gets started when a matching link is clicked not when you type the url in the browser.
Try it by sending yourself an email containing http://ebay.com and click the link in the email application.