///
/// MunimBluetoothOnLoad.cpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#ifndef BUILDING_MUNIMBLUETOOTH_WITH_GENERATED_CMAKE_PROJECT
#error MunimBluetoothOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
#endif

#include "MunimBluetoothOnLoad.hpp"

#include <jni.h>
#include <fbjni/fbjni.h>
#include <NitroModules/HybridObjectRegistry.hpp>

#include "JHybridMunimBluetoothSpec.hpp"
#include <NitroModules/DefaultConstructableObject.hpp>

namespace margelo::nitro::munimbluetooth {

int initialize(JavaVM* vm) {
  using namespace margelo::nitro;
  using namespace margelo::nitro::munimbluetooth;
  using namespace facebook;

  return facebook::jni::initialize(vm, [] {
    // Register native JNI methods
    margelo::nitro::munimbluetooth::JHybridMunimBluetoothSpec::registerNatives();

    // Register Nitro Hybrid Objects
    HybridObjectRegistry::registerHybridObjectConstructor(
      "MunimBluetooth",
      []() -> std::shared_ptr<HybridObject> {
        static DefaultConstructableObject<JHybridMunimBluetoothSpec::javaobject> object("com/munimbluetooth/HybridMunimBluetooth");
        auto instance = object.create();
        return instance->cthis()->shared();
      }
    );
  });
}

} // namespace margelo::nitro::munimbluetooth
