Skip to content

Instantly share code, notes, and snippets.

@rafaelpadovani
Last active February 29, 2020 11:11
Show Gist options
  • Save rafaelpadovani/6144f7d0bdd74da41675125ee1f0f2b2 to your computer and use it in GitHub Desktop.
Save rafaelpadovani/6144f7d0bdd74da41675125ee1f0f2b2 to your computer and use it in GitHub Desktop.
//DeviceInfoPackage.java
package com.deviceinfoexample;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import com.smsautomatic.DeviceInfoModule;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class DeviceInfoPackage implements ReactPackage {
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
}
@Override
public List<NativeModule> createNativeModules(
ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
//this is where you register the module
modules.add(new DeviceInfoModule(reactContext));
return modules;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment