it.near.sdk.reactnative.rnnearitsdk.RNNearItPackage.java Source code

Java tutorial

Introduction

Here is the source code for it.near.sdk.reactnative.rnnearitsdk.RNNearItPackage.java

Source

/*
 * Copyright (c) 2017 Mattia Panzeri <mattia.panzeri93@gmail.com>
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

package it.near.sdk.reactnative.rnnearitsdk;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;

import java.util.Collections;
import java.util.List;

import it.near.sdk.NearItManager;

public class RNNearItPackage implements ReactPackage {

    @Override
    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
        return Collections.<NativeModule>singletonList(new RNNearItModule(reactContext));
    }

    // Deprecated. Kept for backward-compatibility
    // https://github.com/facebook/react-native/issues/15232
    public List<Class<? extends JavaScriptModule>> createJSModules() {
        return Collections.emptyList();
    }

    @Override
    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
        return Collections.emptyList();
    }

    public static void disableDefaultRangingNotifications() {
        NearItManager.getInstance().disableDefaultRangingNotifications();
    }
}