1

I want to startActivityForResult with a custom Intent's, but I think react native doesn't supported it.

what is the best solution to implement it?

my startActivityForResult function:

        Intent intent = new Intent(Intent.ACTION_MAIN); // set payment parameters
        intent.setComponent(new ComponentName(pakageName, "wish.*.*"));
        intent.putExtra("paymentId", paymentId);
        this.getActivity().startActivityForResult(intent,RETURN_PAYMENT);
1

2 Answers 2

-1

The question is 2 years old but I could give you a suggestion if anyone still need a solution.

In React we do have React hooks, React context that allowed you to share data between react components.

Besides that you able to use redux/mobx to handle data flow but I do not recommend it because of using the complex things to solve a small issue.

In cases of using react-navigation, you able to combine react hooks with react-navigation hooks to receive callback data.

Sign up to request clarification or add additional context in comments.

1 Comment

I cannot understand your answer. How can I get the result on Js funcation?
-2

You can write a custom module for starting the activity and you can use callbacks to send activity result to the react side. https://facebook.github.io/react-native/docs/native-modules-android

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.