Skip to content

Instantly share code, notes, and snippets.

@SkyTreasure
Created June 24, 2019 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SkyTreasure/9025f1b1fbfc6781c20c0ef4f0c5707c to your computer and use it in GitHub Desktop.
Save SkyTreasure/9025f1b1fbfc6781c20c0ef4f0c5707c to your computer and use it in GitHub Desktop.
CustomPackage
package com.yourpackagename;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
public class CustomPackage implements ReactPackage {
@Nonnull
@Override
public List<NativeModule> createNativeModules(@Nonnull ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
//If any other custom modules are there then you can declare it here
modules.add(new BackgroundScanModule(reactContext));
return modules;
}
@Nonnull
@Override
public List<ViewManager> createViewManagers(@Nonnull ReactApplicationContext reactContext) {
return Collections.emptyList();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment