Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use screen_name instead of user_id #64

Merged
merged 1 commit into from
Mar 8, 2018
Merged

Use screen_name instead of user_id #64

merged 1 commit into from
Mar 8, 2018

Conversation

ItsCalebJones
Copy link
Contributor

@ItsCalebJones ItsCalebJones commented Mar 8, 2018

Potential fix for issue #63

I will be using @SpaceLaunchNow (user_id= 841696172259606528) as the example account. The code as is first tries the URI - if a package is not available to handle the twitter:// URI then it falls back to the web URL.

As is the URI works ONLY with the user_id - however the web url ONLY works with the screen name.

Relevant intent logic here.

	public Intent openTwitter (String user) {
		try {
			tryPackage(R.string.id_twitter_app);
			return intent(R.string.uri_twitter_app, user);
		} catch (Exception e) {
			return intent(R.string.url_twitter_website, user);
		}
	}

Example A - URI doesn’t work but weblink does:
twitter://user?user_id= SpaceLaunchNow
https://twitter.com/SpaceLaunchNow

Example B - URI works but weblink doesnt:
twitter://user?user_id=841696172259606528
https://twitter.com/841696172259606528

The obvious solution is to use just the screen_name or just the user_id for the URI and fallback link. From what I can see the web url only accepts screen names so changing the URI to screen_name makes more sense.

Example:
I will be using @SpaceLaunchNow (user_id= 841696172259606528) as the
example account. The code as is first tries the URI - if a package is
not available to handle the twitter:// URI is available then it falls
back to the web URL.

As is the URI works ONLY with the user_id - however the web url ONLY
works with the screen name.

Example A - URI doesn’t work but weblink does:
twitter://user?user_id= SpaceLaunchNow
https://twitter.com/SpaceLaunchNow

Example B - URI works but weblink doesnt:
twitter://user?user_id=841696172259606528
https://twitter.com/841696172259606528

The obvious solution is to use just the screen_name or just the user_id
for the URI and fallback link. From what I can see the web url only
accepts screen names so changing the URI to screen_name makes more
sense.
@jrvansuita jrvansuita merged commit f26a747 into jrvansuita:master Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants