React Native PayPal integration without server dependency? - react-native

I have tried with using Web view and having a Node server with paypal-rest-sdk as backend.
The flow seems to be a work around. Is there any way to directly integrate the Paypal with React Native code without any server calls or web views.

This isn't really a React question -- if no server is used, then you would be doing a client-only HTML/JS integration such as this one: https://developer.paypal.com/demo/checkout/#/pattern/client
That's possible to do. It would all be happening in a full mobile web experience, which then becomes the PayPal Checkout.
If your question was whether it's technically possible to do "server"-style REST API calls from a purely native React app, please put that thought out of your mind. Your 'secret' API key should never be in the possession of a client-side App.

Related

Setting the User Context App Insights for React Native

We have a React Native app and we are logging to App Insights using the "applicationinsights-react-native package", this all works fine in a sense, but we are trying to start using the monitoring side of things which uses a User ID. Now I'm pretty sure that whatever the User ID that the (app insights) package is using for a user ID won't cause too many problems if we kept it, but it won't be right.
The ApplicationInsights class has a setAuthenticatedUserContext method, however the comments seem to refer to cookies suggesting it's a React package re-purposed and this GitHub post https://github.com/microsoft/appcenter-sdk-react-native/issues/503 suggests we can't use it, however the response is for the React Natve AppCenter package which we are not using. We are using App Insights direct.
So I was wondering if there was a way to set our user_Id/User context if we are using App Insights directly from a React Native app?
It looks like setAuthenticatedUserContext does work if you talk to App Insights directly and not theough Appcenter, it's possible that it works through Appcenter now as well, I have not tested so I am not sure.
If you want to check that this ends up as on the App Insighst side, it appears as a property called user_AuthenticatedId.

How to implement PayPal in Expo ReactNative app using Webview without Nodejs

I am developing an Ecpo ReactNative app and i looking to integrate PayPal to allow users to purchase some products using Webview, but I don't know how to do it. I came across this article: https://medium.com/#adityasingh_32512/integrating-paypal-in-your-react-native-app-4dcf89e11dd which explains how to do it but he uses a nodejs server and i won't necessarily implement a Nodejs server...
I also came across this article: How to integrate Paypal using React Native expo? where they offer other solutions, but which didn't satisfy me.
If you don't use a server integration (nodejs or otherwise), then obviously only client-side JS will be available. Here is a demo pattern of what you can do: https://developer.paypal.com/demo/checkout/#/pattern/client
There's nothing React-specific about it.

React Native & Cosmos DB - How to get them working together?

There seem to be no direct support for React Native through Cosmos DB SDK or npm packages. The JS package #azure/cosmos while works on React Native for the Web, but does not build for the native apps. It fails to build due to Cryto incompatibility.
While Resource Tokens can serve as a solution for authentication, but App still needs to interact with the DB resources using an API.
So, how to go around this? Is utilizing Azure Functions as a mid-tier the only workaround?
Thanks
If you need basic functionality like querying, creating new items etc, you can get the react-native-azure-cosmos package.
However the functionality is a very limited subset of the full JS SDK.
There is no official SDK for now to target react native applications.
You will need to use an API App or Function app to interact with CosmosDB and call the HTTP endpoints from your device.

RingCentral two way communication

I am building a React Native application for calling using RingCentral APIs.First of all I tried using the webphone RTC via web browser: https://github.com/ringcentral/ringcentral-web-phone. It works perfectly fine in web browsers. But the thing I need is to call via react-native application I am building.
I tried calling via RingCentral using 'ring out call' POST API and 'call control- make callout' post api(beta version).But the problem i am facing is when i integrate these apis to react-native applications : To have a two way communication I need to be online in the web phone .Then when i call from react native it goes to the web phone first.And then when I dial 'answer' it redirects to the number i want to call to.Then only I can have a two-way communication.
So, what do I do if I want to directly call via react-native application to the recipient directly?
P.s. If I am not online in the web phone from browser the call automatically goes to the voicemail.
So hard to understand your question from the title and the detailed description.
I guessed that you want to implement a functional phone using react native where you want to use the RingCentral WebRTC SDK to handle incoming and outgoing phone calls.
First of all, please mind the browser compatibility supported by the WebPhone SDK. Secondly, it is not trivial and I cannot support you on the react-native part. However, RingCentral provides an easy way to embed a RingCentral embeddable phone to any webpage and that app is an open source project. You can use the embeddable as such or clone the project and learn from the code or modify it to meet your requirements.
Click on the links above to find further information.

Can you interact with the app in test using absolute positioning in Detox?

I am trying to test a react native app on android which uses a native library which does oauth-based authentication using a webview. Detox does not support webviews (yet) so I was wondering if I could tap on the keyboard using coordinates in order to get through the auth (bad I know, but gets me unstuck for now).
Since the oauth screen is outside your app, I'd recommend you do the following:
Create E2E tests for your login up to the oauth screen
Get a CLI for your oauth provider or figure out how to authenticate via node.js to get the auth token
Create a deep link path in your app that accepts the token as a param and stores it the way you'd store it normally and trigger a continuation of the login flow (you may need to reverse engineer your native lib slightly)
This is generally the approach you want to take if you are using an external authentication party. If the party providing the auth package doesn't support 2 and 3, you should raise the issue with them.