particle-iot / particle-android

Particle Open Source for Android
Apache License 2.0
37 stars 38 forks source link

React Native integration issue #57

Open jensck opened 5 years ago

jensck commented 5 years ago

Original issue: https://github.com/particle-iot/spark-setup-android/issues/61


I’m having some trouble integrating the Android SDK with my React Native app.

I’m able to inject an access token using the Cloud SDK and then register a device using the Device Setup Library. However, once setup has finished, I can’t seem to hand back control to RN / return to the “main activity”.

In MainApplication.java I’m initialising the setup library:

@Override
  public void onCreate() {
    super.onCreate();
    ...
    ParticleDeviceSetupLibrary.init(this.getApplicationContext(), MainActivity.class);
  }

Then in my native module I call:

ParticleDeviceSetupLibrary.startDeviceSetup(getReactApplicationContext());

I really don’t have much experience writing native code, so any pointers would be much appreciated!