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

[Feature] Android Permission - Use Blank Activity #197

Closed
aritchie opened this issue Jan 23, 2016 · 4 comments
Closed

[Feature] Android Permission - Use Blank Activity #197

aritchie opened this issue Jan 23, 2016 · 4 comments

Comments

@aritchie
Copy link

Hey James

I would love to use the permissions plugin, but the hack of dropping in the same block of code per activity just doesn't sit with me. Something I was considering doing was a transparent activity that can request the permission and dialogs while staying under the control of the plugin. You also wouldn't need your top activity plugin any longer to accomplish this. You could do Application.Context.StartActivity(typeof(TransparentPermissionPluginActivity));

I'll do a PR if you're interested.

@jamesmontemagno
Copy link
Owner

My recommendation is that you simply have a base activity with your call in
it. It has to pass up the arguments, and it would only need to be on an
activity that needs to request the permission. This same code would have to
be written if you were implementing permissions. The idea of a transparent
activity is interesting. However I am not sure if adding and launching
adding activities are a great solution and could have odd side effects that
the developer is no longer in control of. Adding 2 lines of code to a base
activity is pretty good personally. However I am open to ideas.
On Jan 23, 2016 11:26 AM, "Allan Ritchie" notifications@github.com wrote:

Hey James

I would love to use the permissions plugin, but the hack of dropping in
the same block of code per activity just doesn't sit with me. Something I
was considering doing was a transparent activity that can request the
permission and dialogs while staying under the control of the plugin. You
also wouldn't need your top activity plugin any longer to accomplish this.
You could do
Application.Context.StartActivity(typeof(TransparentPermissionPluginActivity));

I'll do a PR if you're interested.


Reply to this email directly or view it on GitHub
#197.

@aritchie
Copy link
Author

aritchie commented Feb 4, 2016

I have had several projects pop up lately that have a ton of activities without any sort of base activity. Fixing this is in the long term goals, but in the meantime, I have to get runtime permissions working.

The idea of the transparent activity shouldn't cause any side effects other than pushing/popping an activity like normal. The difference is that the plugin now has the control it needs to display and request things without popping in any code. This will remove the need for all of the top activity stuff as well.

I'll fork and test in any case.

@jamesmontemagno
Copy link
Owner

Hmmm yeah, I would be interested in testing this out. The more I think about it I don't mind it at all. Would probably just get around any common errors when installing NuGets if people don't read docs.

@jamesmontemagno jamesmontemagno changed the title [Feature] Android Permission Hack [Feature] Android Permission - Use Blank Activity Feb 10, 2016
@jamesmontemagno
Copy link
Owner

This issue was moved to jamesmontemagno/PermissionsPlugin#1

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

No branches or pull requests

2 participants