Android thirdparty SDK needs initalized in OnCreate(). OnCreate not directly accessable when making plugin #25256
Labels
engine
flutter/engine repository. See also e: labels.
Projects
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.
The text was updated successfully, but these errors were encountered: