Skip to content

Commit a588e9d

Browse files
Twigzlng-stripe
authored andcommitted
Update NativeOnrampSdkModuleSpec.java (#2141)
1 parent 96a771e commit a588e9d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

android/src/oldarch/java/com/reactnativestripesdk/NativeOnrampSdkModuleSpec.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import com.facebook.react.bridge.ReactContextBaseJavaModule;
1919
import com.facebook.react.bridge.ReactMethod;
2020
import com.facebook.react.bridge.ReadableMap;
21+
import com.facebook.react.modules.core.DeviceEventManagerModule;
2122
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
2223
import javax.annotation.Nonnull;
2324

@@ -33,8 +34,14 @@ public NativeOnrampSdkModuleSpec(ReactApplicationContext reactContext) {
3334
return NAME;
3435
}
3536

37+
private void invoke(String eventName, Object params) {
38+
getReactApplicationContext()
39+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
40+
.emit(eventName, params);
41+
}
42+
3643
protected final void emitOnCheckoutClientSecretRequested(ReadableMap value) {
37-
mEventEmitterCallback.invoke("onCheckoutClientSecretRequested", value);
44+
invoke("onCheckoutClientSecretRequested", value);
3845
}
3946

4047
@ReactMethod

0 commit comments

Comments
 (0)