use of com.facebook.react.bridge.ReactMethod in project react-native-fbads by callstack.
the class InterstitialAdManager method loadAd.
@ReactMethod
public void loadAd(String placementId, Promise p) {
ReactApplicationContext reactContext = this.getReactApplicationContext();
mViewAtOnce = true;
mPromise = p;
mInterstitial = new InterstitialAd(reactContext, placementId);
mInterstitial.loadAd();
}
use of com.facebook.react.bridge.ReactMethod in project react-native-fbads by callstack.
the class NativeAdManager method init.
/**
* Initialises native ad manager for a given placement id and ads to request.
* This method is run on the UI thread
*
* @param placementId
* @param adsToRequest
*/
@ReactMethod
public void init(final String placementId, final int adsToRequest) {
final ReactApplicationContext reactContext = this.getReactApplicationContext();
UiThreadUtil.runOnUiThread(new Runnable() {
@Override
public void run() {
final NativeAdsManager adsManager = new NativeAdsManager(reactContext, placementId, adsToRequest);
adsManager.setListener(NativeAdManager.this);
mAdsManagers.put(placementId, adsManager);
adsManager.loadAds();
}
});
}
use of com.facebook.react.bridge.ReactMethod in project native-navigation by airbnb.
the class NavigatorModule method pushNative.
@SuppressWarnings({ "UnusedParameters", "unused" })
@ReactMethod
public void pushNative(String name, ReadableMap props, ReadableMap options, Promise promise) {
Activity activity = getCurrentActivity();
if (activity == null) {
return;
}
Intent intent = coordinator.intentForKey(activity.getBaseContext(), name, props);
startActivityWithPromise(activity, intent, promise, options);
}
use of com.facebook.react.bridge.ReactMethod in project native-navigation by airbnb.
the class NavigatorModule method presentNative.
@SuppressWarnings({ "UnusedParameters", "unused" })
@ReactMethod
public void presentNative(String name, ReadableMap props, ReadableMap options, Promise promise) {
Activity activity = getCurrentActivity();
if (activity == null) {
return;
}
Intent intent = coordinator.intentForKey(activity.getBaseContext(), name, props);
startActivityWithPromise(activity, intent, promise, options);
}
use of com.facebook.react.bridge.ReactMethod in project react-native-twilio-programmable-voice by hoxfon.
the class TwilioVoiceModule method initWithAccessToken.
@ReactMethod
public void initWithAccessToken(final String accessToken, Promise promise) {
if (accessToken.equals("")) {
promise.reject(new JSApplicationIllegalArgumentException("Invalid access token"));
return;
}
TwilioVoiceModule.this.accessToken = accessToken;
if (BuildConfig.DEBUG) {
Log.d(TAG, "initWithAccessToken ACTION_FCM_TOKEN");
}
registerForCallInvites();
WritableMap params = Arguments.createMap();
params.putBoolean("initialized", true);
promise.resolve(params);
}
Aggregations