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) );
Related
I made an Android application in which I want to implement deep linking (example: http://myApp/seeMore?id=123456)
When I send a sms via intent, I receive it, and the link is clickable, and it opens the content of the application I want to see!
What's the problem? If I send myself the link via whatsapp (or messenger), I receive it, but this same link in the whatsapp message is not clickable!
I also tried the format myApp://seeMore?id=123456 (with the Manifest xml updated as it should be), but nothing happens, the link sent is not clickable, even via SMS.
The only time I had a clickable link in whatsapp and messenger, it's with the http://myApp.com/seeMore?id=123456 format. But when I click on the link, it opens the browser saying that the page does not exist.
And I saw that in this case, I have to link my app to my website but I don't have a website... And I don't want to have one!
Questions :
Is there a way to make "myApp://seeMore?id=123456" clickable in SMS, Whatsapp, Messenger apps? By forcing in the code to say that it's a hyperlink? something else? :) )
Is it possible to make the link "http://myapp.com/seeMore?id=123456" work to point directly to my apk and not to the browser? (Did I configure my intent-filter wrong?) I saw a style attribute verifyAuto=true in the xml manifest, but when I tried, it didn't work...
Is it possible to generate a clickable link (even if it's not a url?) via intent send to messenger/whatsapp?
Does anyone have any idea whatsoever for my concern? :)
Here it is, if you have any idea, I'm interested! Thanks for reading and possibly helping me :)
Translated with www.DeepL.com/Translator (free version)
My current AndroidManifest:
<activity
android:exported="true"
android:name=".vue.activity.GraphActivity"
android:screenOrientation="landscape"
android:launchMode="singleTask"
android:parentActivityName=".vue.activity.MainActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "http://speedchyps/course” -->
<data android:scheme="http"
android:host="speedchyps"
android:pathPrefix="/course" />
<!-- note that the leading "/" is required for pathPrefix-->
</intent-filter>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".vue.activity.MainActivity" />
</activity>
Config when i try "maJolieAppli://seeMore?id=123456":
<intent-filter android:label="#string/filter_view_example_gizmos">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "speedchyps://course” -->
<data android:scheme="speedchyps"
android:host="course" />
</intent-filter>
I have followed tutorials from Deep Links to App Content.
However my app can't intercept the links. The app can't be launched at all.
Here is part of my Android manifest:
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
<data android:scheme="http"
android:host="www.example.com"
android:pathPrefix="/gizmos" />
<!-- note that the leading "/" is required for pathPrefix-->
</intent-filter>
</activity>
Here is the test page index.html i put on my web server.
<a id="applink1" href="http://www.example.com/gizmos/sss">
Open Application</a>
I have tried hours and still can't figure out why it doesn't work.
Ps:
If I change scheme to some random stuff, it will work.
However I want to intercept the http link.
I also tried change the order of action, category, data, it makes no difference.
Additionally to the Android portion, you need to verify that you are indeed allowed to intercept links for the given URL on the web server serving the URL. To do that, you need to create and upload a JSON file to the given URL (under .well-known/assetlinks.json) that contains verification information about your app, effectively allowing your app to intercept links.
See https://developer.android.com/training/app-links/verify-site-associations.html for the details.
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.
Request OAuth (when twitter button cliked)
final String TW_CALLBACK_URL_STRING = "http://test.com/callback";
final Uri TW_CALLBACK_URI = Uri.parse(TW_CALLBACK_URL_STRING);
twitter4j.auth.RequestToken twRequestToken =
twitter.getOAuthRequestToken(TW_CALLBACK_URI.toString());
Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse(twRequestToken.getAuthorizationURL()));
activity.startActivityForResult(intent, TWITTER_REQUEST_CODE);
Manifest
<activity android:name=".TwitterLinkActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data
android:scheme="http"
android:host="test.com" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Twitter Developer App Settings
Clicking twitter button on my app, Web Browser (chrome android) is opened.
And I log in twitter account and click "accept app" button ("애플리케이션 승인" in below image, UZTest is my test twitter app name.)
I am not native English speaker. So I do not know exactly words in English...
I think browser link to http://test.com/callback?~~~~. And My app catch this url, and start activity.
But my app can not... It just link http://www.test.com in chrome android browser.
I tried change callback url = "myapp://test.com", but only http(or https) is only available. (Twitter Developer)
How can I receive oauth token?
I did sovle it!
Below two value is not same value (?)
final String TW_CALLBACK_URL_STRING = "http://test.com/callback";
Callback URL: http://test.com/callback (OAuth Setting in Twitter Developer)
1 is only use my app. So I change to "myscheme://myhost" in java code and manifest file.
2 is not oauth request callback url (I do not know exactly what.)
Then It works fine.
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.