Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

User can't login if there is a default application for github url #132

Closed
eliseealex opened this issue Jun 10, 2015 · 14 comments
Closed

User can't login if there is a default application for github url #132

eliseealex opened this issue Jun 10, 2015 · 14 comments
Assignees
Labels

Comments

@eliseealex
Copy link
Collaborator

Now when user is trying to log in, application creates an implicit intent to redirect user to github url, but if there is any application that processes all github url intents (for example forkhub) he will fail to login.

I think it will be better to use WebView instead of implicit intent.

@eliseealex eliseealex added this to the 2.4.0 milestone Jun 10, 2015
@eliseealex eliseealex self-assigned this Jun 10, 2015
@alorma
Copy link
Contributor

alorma commented Jun 10, 2015

NO!

I used webviews before, and had several problems with that.

Maybe, a better aproach, is creating a custom intent, deleting other applications like forkhub, octodroid, or modernhub)

@eliseealex
Copy link
Collaborator Author

Ok, so you think it will be better to simply exclude applications by their names?

@alorma
Copy link
Contributor

alorma commented Jun 10, 2015

Ok, so you think it will be better to simply exclude applications by their names?

No by their names...

Maybe, a better aproach, is get the apps that can receive github.com and remove them :D

@eliseealex
Copy link
Collaborator Author

Remove them from phone?) How?

@alorma
Copy link
Contributor

alorma commented Jun 10, 2015

nooo XD

From intent.
Query activities with packagemanager, that can get links from github.com, and not use them in th eintent

@eliseealex
Copy link
Collaborator Author

Aha, i agree, i meant it when i said "by names".

@alorma
Copy link
Contributor

alorma commented Jun 10, 2015

ok :D

@eliseealex
Copy link
Collaborator Author

I think, it will be better to make it vice versa, like there, find user browsers like that:

Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://someurl.com"));
List<ResolveInfo> list = context.getPackageManager().queryIntentActivities(i, 0);

And then use them to limit intent like that:

Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
ComponentName comp = new ComponentName("com.android.browser", "com.android.browser.BrowserActivity");
i.setComponent(comp);

What do you think?

@alorma
Copy link
Contributor

alorma commented Jun 10, 2015

Uhm...

As an example, i use Lolipop in Nexus 5, native one, so i don't have the default android browser.

Quering for any url is not good, because we want to know which apps are filtering github.com

You tried that? Intent intercept ? With this one, you can se how intent is launched, and make the correct filter on Intent.

I did something similar in Interceptor.class (under activites) to re-send the intent that App cannot match

@eliseealex
Copy link
Collaborator Author

I meant, that there:

ComponentName comp = new ComponentName("com.android.browser", "com.android.browser.BrowserActivity");

Should be all users browser, which we can get by this command:

Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://someurl.com"));
List<ResolveInfo> list = context.getPackageManager().queryIntentActivities(i, 0);

@alorma
Copy link
Contributor

alorma commented Jun 10, 2015

Uhmm ok

But, why not query for http://github.com, and then filter by apps that are browsers? hen, show a custom Dialog to be redirected to, not let system do the work?

@eliseealex
Copy link
Collaborator Author

In this case we should always had an actual browser list. I want to use custom url to get all browsers list.
And then we can do intersection of all browsers (all applications, that can process custom url) and apps that can process http://github.com.

@alorma
Copy link
Contributor

alorma commented Jun 10, 2015

Ok, settings the component name seems to be the best option.

Try that! :D

alorma added a commit that referenced this issue Jun 17, 2015
@alorma
Copy link
Contributor

alorma commented Jun 25, 2015

Closed by PR

@alorma alorma closed this as completed Jun 25, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants