当前位置: 首页>>代码示例>>Java>>正文


Java ReactApplicationContext.getApplicationContext方法代码示例

本文整理汇总了Java中com.facebook.react.bridge.ReactApplicationContext.getApplicationContext方法的典型用法代码示例。如果您正苦于以下问题:Java ReactApplicationContext.getApplicationContext方法的具体用法?Java ReactApplicationContext.getApplicationContext怎么用?Java ReactApplicationContext.getApplicationContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.react.bridge.ReactApplicationContext的用法示例。


在下文中一共展示了ReactApplicationContext.getApplicationContext方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RNPushNotificationModule

import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
RNPushNotificationModule(ReactApplicationContext reactContext) {
        super(reactContext);

        reactContext.addActivityEventListener(this);

        Application applicationContext = (Application) reactContext.getApplicationContext();
        // The @ReactNative methods use this
        mRNPushNotificationHelper = new RNPushNotificationHelper(applicationContext);
        // This is used to delivery callbacks to JS
        mJsDelivery = new RNPushNotificationJsDelivery(reactContext);

        registerNotificationsRegistration();

//        //必须要设置默认的通知回调或者订阅一个频道,否则接收不到通知
//        PushService.setDefaultPushCallback(reactContext.getApplicationContext(), mRNPushNotificationHelper.getMainActivityClass());
//        //this.subscribeChannel("public");
    }
 
开发者ID:zzzkk2009,项目名称:react-native-leancloud-sdk,代码行数:18,代码来源:RNPushNotificationModule.java

示例2: BeaconsAndroidModule

import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
public BeaconsAndroidModule(ReactApplicationContext reactContext) {
    super(reactContext);
    Log.d(LOG_TAG, "BeaconsAndroidModule - started");
    this.mReactContext = reactContext;
    this.mApplicationContext = reactContext.getApplicationContext();
    this.mBeaconManager = BeaconManager.getInstanceForApplication(mApplicationContext);
    // Detect iBeacons ( http://stackoverflow.com/questions/25027983/is-this-the-correct-layout-to-detect-ibeacons-with-altbeacons-android-beacon-li )
    addParser("m:0-3=4c000215,i:4-19,i:20-21,i:22-23,p:24-24");
    mBeaconManager.bind(this);
}
 
开发者ID:MacKentoch,项目名称:react-native-ibeacons,代码行数:11,代码来源:BeaconsAndroidModule.java

示例3: handleRemotePushNotification

import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
private void handleRemotePushNotification(ReactApplicationContext context, Bundle bundle) {

        // If notification ID is not provided by the user for push notification, generate one at random
        if (bundle.getString("id") == null) {
            Random randomNumberGenerator = new Random(System.currentTimeMillis());
            bundle.putString("id", String.valueOf(randomNumberGenerator.nextInt()));
        }

        Boolean isForeground = isApplicationInForeground();

        RNPushNotificationJsDelivery jsDelivery = new RNPushNotificationJsDelivery(context);
        bundle.putBoolean("foreground", isForeground);
        bundle.putBoolean("userInteraction", false);
        jsDelivery.notifyNotification(bundle);

        // If contentAvailable is set to true, then send out a remote fetch event
        if (bundle.getString("contentAvailable", "false").equalsIgnoreCase("true")) {
            jsDelivery.notifyRemoteFetch(bundle);
        }

        Log.v(LOG_TAG, "sendNotification: " + bundle);

        if (!isForeground) {
            Application applicationContext = (Application) context.getApplicationContext();
            RNPushNotificationHelper pushNotificationHelper = new RNPushNotificationHelper(applicationContext);
            pushNotificationHelper.sendToNotificationCentre(bundle);
        }
    }
 
开发者ID:zzzkk2009,项目名称:react-native-leancloud-sdk,代码行数:29,代码来源:RNLeanCloudPushReceiver.java

示例4: ANModule

import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
public ANModule(ReactApplicationContext reactContext) {
    super(reactContext);
    anHelper = new ANHelper((Application) reactContext.getApplicationContext());
}
 
开发者ID:emekalites,项目名称:react-native-alarm-notification,代码行数:5,代码来源:ANModule.java

示例5: ImageCompressModule

import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
public ImageCompressModule(ReactApplicationContext reactContext) {
    super(reactContext);
    mContext = reactContext.getApplicationContext();
    uriPath = new UriPath((Application) mContext);
}
 
开发者ID:emekalites,项目名称:react-native-compress-image,代码行数:6,代码来源:ImageCompressModule.java

示例6: SmsModule

import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
public SmsModule(ReactApplicationContext reactContext) {
    super(reactContext);
    mReactContext = reactContext;
    smsList = new HashMap<Long, String>();
    context = reactContext.getApplicationContext();
}
 
开发者ID:briankabiro,项目名称:react-native-get-sms-android,代码行数:7,代码来源:SmsModule.java

示例7: BaseModule

import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
public BaseModule(ReactApplicationContext reactContext) {
    super(reactContext);
    mReactContext = reactContext;
    mContext = reactContext.getApplicationContext();
}
 
开发者ID:zzzkk2009,项目名称:react-native-leancloud-sdk,代码行数:6,代码来源:BaseModule.java


注:本文中的com.facebook.react.bridge.ReactApplicationContext.getApplicationContext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。