Skip to content

Commit 1daac13

Browse files
committed
Add note about manifest having the callback
1 parent 96ccd58 commit 1daac13

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class TwitterClient extends OAuthBaseClient {
3838
public static final String REST_URL = "http://api.twitter.com";
3939
public static final String REST_CONSUMER_KEY = "SOME_KEY_HERE";
4040
public static final String REST_CONSUMER_SECRET = "SOME_SECRET_HERE";
41-
public static final String REST_CALLBACK_URL = "oauth://arbitraryname";
41+
public static final String REST_CALLBACK_URL = "oauth://arbitraryname.com";
4242

4343
public TwitterClient(Context context) {
4444
super(context, REST_API_CLASS, REST_URL,
@@ -58,6 +58,27 @@ public class TwitterClient extends OAuthBaseClient {
5858

5959
Configure the `REST_API_CLASS`, `REST_URL`, `REST_CONSUMER_KEY`, `REST_CONSUMER_SECRET` based on the values needed to connect to your particular API. The `REST_URL` should be the base URL used for connecting to the API (i.e `https://api.twitter.com`). The `REST_API_CLASS` should be the class defining the [service](https://github.com/fernandezpablo85/scribe-java/tree/master/src/main/java/org/scribe/builder/api) you wish to connect to. Check out the [full list of services](https://github.com/fernandezpablo85/scribe-java/tree/master/src/main/java/org/scribe/builder/api) you can select (i.e `FlickrApi.class`).
6060

61+
Make sure that the project's `AndroidManifest.xml` has the appropriate `intent-filter` tags that correspond
62+
with the `REST_CALLBACK_URL` defined in the client:
63+
64+
```xml
65+
<activity ...>
66+
<intent-filter>
67+
<action android:name="android.intent.action.VIEW" />
68+
69+
<category android:name="android.intent.category.DEFAULT" />
70+
<category android:name="android.intent.category.BROWSABLE" />
71+
72+
<data
73+
android:scheme="oauth"
74+
android:host="arbitraryname.com"
75+
/>
76+
</intent-filter>
77+
</activity>
78+
```
79+
80+
If the manifest does not have a matching `intent-filter` then the OAuth flow will not work.
81+
6182
### Creating a LoginActivity
6283

6384
The next step to add support for authenticating with a service is to create a `LoginActivity` which is responsible for the task:

0 commit comments

Comments
 (0)