Trying the following tutorial
http://www.androidsdkforum.com/android-sdk-development/3-oauth-twitter.html
i am having trouble understanding callback URL
my twitter app name is "faisal-android" and my call back url i defined in code is
myapp://wozzon-android
and having entry in xml file as
<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="myapp" android:host="faisal-android" />
</intent-filter>
m i way to defining callback url is correct ??
when i run the code it gives me error "Authorization failed (server replied with a 401). This can happen if the consumer key was not correct or the signatures did not match"
my twitter app account settings as following
alt text http://www.freeimagehosting.net/uploads/a0c2689c73.png
I think you need to check browser and not client if you use a callback url
I read something about this :
http://blog.sogeti.com/mobile/2010/03/twitter-oauth-for-android.html
(dead link)
Android – OAuth updates to Twitter
http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/#awp::2009/07/16/android-oauth-twitter-updates/
Check your callback UL in twitter . Enter any dummy URL not kept empty .
You can write google.com, it work in my case.
Related
Fitbit API doesn't support webview anymore.
So, I studied chrome custom tabs and applied in my app.
But after login, when I pressed this pink button(allow button), nothing happened.(Image below)
How can I receive access token and store it in app?
Please help me.
Thanks.
When authorizing agains the Fitbit API, you need to provide a redirect_uri, which is where the user will be taken after logging in. You need to provide a uri that will take the user back to your application.
To achieve that, create an intent filter and add a data tag with a custom scheme, such as myapplication://logincallback to the Activity you want to handle the login.
The intent filter will look something like this:
<intent-filter . . . >
<data android:scheme="myapplication" android:host="logincallback" />
. . .
</intent-filter>
Now, set the redirect_uri as mypplication://logincallback to the authorization step of the flow, and when the user clicks the pink button, it should open the Activity you added the intent filter.
You will be able to retrieve the parameters inside your activity by calling getData on the Intent.
<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="logincallback"
android:pathPattern=".*"
android:scheme="myapp" />
</intent-filter>
Suppose you have redirect_uri myapp://logincallback, then add above code in your activity in Manifest xml file and it will work.
I am trying to implement a new feature for my android application.
scenario :
when some event occurs, the camera sends an email to my (Gmail) account.
on opening the mail, it will have a link (html).
when user clicks on that link, it should launch my application Home activity.
I need to understand :
how to create that html link.
how can i make the link to launch my application Home activity.
kindly help me to understand what all things i need to do in my application.
I used "Blackbelt's" user comment and i was able to get the intent html link working.
But my problem is : i want to use a custom scheme "mobile" instead of "http"
I am using Gmail to use the link. But when i send using custom scheme. Gmail doesnt recogonise as hyperlink. So i cannot click on the link.
Please help me how to use a custom scheme. with gmail
you need to register an intent-filter for your Activity on the AndroidManifest.xml file, defining a custom url. . E.g.
<activity android:name="path.to.YourActivity" >
<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="https"
android:host="it.is.my.app" />
</intent-filter>
</activity>
So if you press on a link like https://it.is.my.app, you should be prompted with the android intent chooser, with your app
I am making an application which contain spotify integration, I was followed this link https://developer.spotify.com/technologies/spotify-android-sdk/tutorial/
by the reference of this link I was put "festevo://callback" as callback redirect URI
when I was trying login into spotify every time I was getting same error.
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="callback"
android:scheme="festevo" />
Please tell me why this happen...
Thank you.
I see a couple of possible things that could've gone wrong:
It's as simple as that you didn't save the redirect URI after you typed it in. (Double-check My Applications.)
You didn't specify it properly in your application's manifest. (Double-check the manifest part in the tutorial)
You didn't change the REDIRECT_URI value to festevo://callback as specified in the tutorial.
Hope this solves your issue!
Before about 2 month, I create android app and add twitter app in twitter developers.
And I did oauth with twitter.
strings.xml
<string name="twitter_sign_in_scheme">myappname</string>
<string name="twitter_sign_in_host">twitter</string>
AndroidMenifest
<activity android:name=".TwitterLinkActivity" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data
android:scheme="#string/twitter_sign_in_scheme"
android:host="#string/twitter_sign_in_host" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
It did and does work fine.
Now I need to modify scheme and host. But I can not find where to modify.
In my memory, callback url contains oauth scheme and host.
But my twitter app setting does not contain. (See below image) But Oauth works.
My eyes are crazy...? I can not find where...
Please let me know where to modify twitter oauth scheme and host.
Oh my god....
Twitter Oauth url settings are not in online...
I set in code when get request token...
TwitterFactory.getSingleton().getOAuthRequestToken(
context.getString(R.string.twitter_sign_in_scheme)+"://"
+context.getString(R.string.twitter_sign_in_host) );
I have a tabActivity (.Tabs) in which one of the tabs has twitter integration (.TwitterTab). From that tab, you can click a button to login to twitter. Once you authenticate with twitter on their mobile web portal, you are returned back to the app... but it goes to the twitter activity (.TwitterTab), NOT the tab activity (.Tabs).
How can i make it return to the .Tabs with the .TwitterTab tab selected?
<activity android:name=".service.oath.PrepareRequestTokenActivity" android:launchMode="singleTask">>
<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="x-oauthflow-twitter" android:host="callback" />
</intent-filter>
</activity>
When you set Scheme and Host for an activity in the Android Manifest, it tells android that all requests involving that particular Scheme and Host should be handled by that activity.
When you are authenticating using oAuth and Twitter4j, you have to provide a callback URL that is used once authentication is complete. According to your manifest excerpt above, yours would be something like: x-oauthflow-twitter://callback. When the authentication process is finished, android is told to go to the activity that handles the callback you provided. (In your case, .service.oath.PrepareRequestTokenActivity)
So, set the scheme and host for your tabActivity so that android goes back there after authenticating, and override onResume to handle the return. I'm sure there is a programmatic way to have the Twitter tab opened once you get to that point.
You can check out this post for more examples on scheme/host and twitter4j authenticating.