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

Android thirdparty SDK needs initalized in OnCreate(). OnCreate not directly accessable when making plugin #25256

Closed
inquisitev opened this issue Dec 12, 2018 · 3 comments
Labels
engine flutter/engine repository. See also e: labels.

Comments

@inquisitev
Copy link

So i am working with Particle devices, Particle is a batteries included Internet of Things platform that basically takes an Arduino style micro controller and connects it to the cloud. They offer Android and IOS sdks but to no surprise, nothing for dart/flutter. I have written apps that go through the method channels and it is getting quite cumbersome. i want to solve this problem once and not again if you know what i mean. Therefore i want to make a plugin to expose the Particle SDK to flutter/dart. The issue is that the Particle SDK requires an init command that must be ran in the OnCreate() Method and requires context as a param.

I have been able to find the activity context and try to init in methods available within the plugin framework, but it must be initialized during the OnCreate Sequence. I have found some things like PluginRegistry.Registrar and Flutter plugin Registrar but im not sure how to use them to solve my issue. I noticed how the GeneratedPluginRegistrar is ran in the OnCreate method of all flutter apps. so i think that if i can add my app init to the GeneratedPluginRegistrar my issue may be solved. I feel that i cannot be the only person to have attempted to create a plugin that needs to be initialized during the OnCreate sequence, I am just not able to find the solution through google or stack overflow up to this point.

Any assistance is very appreciated. i am relatively new to flutter so please forgive me if there is some easy fix that i just need to open my eyes to see.

@zoechi
Copy link
Contributor

zoechi commented Dec 12, 2018

Please consider asking support questions in one of the other channels listed at http://flutter.io/support .

@zoechi zoechi added engine flutter/engine repository. See also e: labels. p: framework labels Dec 12, 2018
@zoechi zoechi added this to the Goals milestone Dec 12, 2018
@jmagman jmagman added this to Awaiting triage in Mobile - Android engine review Feb 25, 2020
@xster
Copy link
Member

xster commented May 13, 2020

Our Android engine code has been refactored in 1.12. The new plugin APIs offer more lifecycle hooks. See details in https://flutter.dev/go/android-plugin-migration.

@xster xster closed this as completed May 13, 2020
Mobile - Android engine review automation moved this from Awaiting triage to Engineer reviewed May 13, 2020
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
engine flutter/engine repository. See also e: labels.
Projects
Mobile - Android engine review
  
Engineer reviewed
Development

No branches or pull requests

3 participants