Reputation: 121
I want to send intent value to Java Script from ReactActivity of React Native.
I write following example code. How to send "tag" to JavaScript
public class MainActivity extends ReactActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
Tag tag = (Tag) intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
// I want to send tag data to Javascript
// How to do?
}
Upvotes: 0
Views: 1965
Reputation: 228
public class CustomActivity extends ReactActivity {
@Override
protected String getMainComponentName() {
return "CustomJSScene";
}
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@javax.annotation.Nullable
@Override
protected Bundle getLaunchOptions() {
Bundle initialProps = new Bundle()
initialProps.putString("key", "value");
return initialProps;
}
};
}
Upvotes: 1