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

Do not rely on the Activity object when this plugin is instantiated. #14

Merged
merged 1 commit into from
May 17, 2019

Conversation

ened
Copy link
Contributor

@ened ened commented Apr 13, 2019

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Bug fix

⤵️ What is the current behavior?

Plugin is incompatible with background isolates which may be held by a service on Android

🆕 What is the new behavior (if this is a feature change)?

Plugin will depend on the generic Context class and cast to activity (if available) to show the google play services warning fragment.

💥 Does this PR introduce a breaking change?

No

🐛 Recommendations for testing

Setup a background isolate holder Service

📝 Links to relevant issues/docs

🤔 Checklist before submitting

  • All projects build
  • Follows style guide lines (code style guide)
  • Relevant documentation was updated
  • Rebased onto current develop

Copy link
Member

@mvanbeusekom mvanbeusekom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks for contributing

@ened
Copy link
Contributor Author

ened commented Apr 13, 2019

The permission handler plugin seems to rely on the “activeContext” function instead of “context”. Perhaps something this PR should do as well.

@robotsrulz
Copy link

I am interested to have this pull request merged. Can anybody tell me the reason it's not? I looked through logs of failed build and it seems to me that this patch is not reason, there is something else.

@mvanbeusekom mvanbeusekom merged commit 4777347 into Baseflow:develop May 17, 2019
@mvanbeusekom
Copy link
Member

@ened first of all thanks for the PR, we really appreciate it!

Just to reply on your last question, since I recently figured this out for the geolocator and location_permission plugins (see Baseflow/flutter-permission-plugins#1 (comment)).

I think it would be best to keep using the context method here since it will return the ApplicationContext instead of the current Activity or ServiceContext. For more information please have a look at this article.

@mvanbeusekom
Copy link
Member

@robotsrulz, I have just release version 2.0.1 of this plugin which includes this PR

@ened ened deleted the activity-vs-context branch May 17, 2019 13:11
@ened
Copy link
Contributor Author

ened commented May 17, 2019

@mvanbeusekom thx.

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

3 participants