React native share:-how to use share functionality with different message for different app - react-native

I have a requirement in share functionality in which i want to share different different messages for facebook twitter and other apps. But in react native share i have only one message variable in which we pass the data. Can anyone help me about how to pass different message in different apps. Like how i can identify that facebook is selected or twitter is selecr or other app is selected and then send specific message to. That app in react native.
Please help me i am new to react native. It will be a great help.

Related

React Native Linking simultaneously for mail AND sms

Is it possible to Linking.openUrl() for both mail and sms ? I'd like my user to choose between those app and prefill information in the body.
Linking.openURL('mailto:support#example.com?subject=SendMail&body=Description')
does suggest mail apps
Linking.openURL('sms:number?body=Description')
does suggest sms apps
Is there a way to have both app proposed to the user while being prefilled with Description ?
Sounds like you are looking for "Share" functionality.
See the official React Native Share Docs, or this popular third party library.
FOR mail
Linking.openURL('mailto:example#example.com?subject=SendMail&body=Description')
FOR sms
Linking.openURL('sms:number?body=yourMessage?subject=SendMail&body=Description')
If this information not enough; you should be 3.part package like;
https://github.com/flexible-agency/react-native-email-link
or
React Native Share.

Website replicating in React Native, WebView vs code, notifications needed

first time asking here as i am looking for some guidance before i start coding.
I have been developing websites mostly in PHP/MySQL/Jquery for years. As I was requested to port a website to an app, I selected React Native in order not to learn 2 different languages for IOS-Android.
I subscribed to some react native lessons, as I found it very clear and fun to follow, and it indeed is.
But here I am finding that to replicate the website is a truly difficult task for me. A temporary version exists at https://app.thallo.care/app.php?language=en (view on mobile if you like). There are many fixed positioned things and floating menus that i cannot easily program on react native.
I tried webview, it works wonderfully, but i am not positive i will be able to implement notifications the way i want to, or custom app styling with inject javascript i am unsure it will work.
The only app difference comparing to the desktop version, is that the user will receive notifications. The website will have a calendar where he will add events, and i need to send notifications to the user device on the event datetime that he has set.
Now the question... Should i use webview and manage notifications on a third party app like amazon SNS or anything else, will i get per-user notifications on events with webview? (I dont need to open a specific page on the app, but it would be nice). Or should i insist on react native coding and try to replicate as much as possible, to be able to have proper notifications? Reminder - the events won't be sent by the app. they are stored in MySQL and should be stored on some other service as well (that i dont know of yet). I don't know also if the webview can handle the website programmed login-logout with $_SESSION php parameters.
I would really appreciate some guidance.
Thanks in advance,

How to read data in background in React Native

I have an app in React Native, that uses the bluetooth connection to read data from external devices.
I need a way to continue to read this data in background when, for example, the user starts a reading session and put the app in background.
What should I use to do this?
My code is divided in two parts:
Scan and Connect
Reading Data from external devices.
You need a background service for this. The following link for Android will help you.
github => react-native-foreground-service
If you want, you can do it yourself as described on the RN official site. But you'll have to write Java code for it.
React Native => Native Module

What is Instagram deep link in React Native for iOS and Android

I need to open the Instagram Direct Message from React Native app and send a text to a selected contact after opening in Instagram.
I already found the way to open Whatsapp and send a message to selected contact using:
Linking.openURL('whatsapp://send?text='+text);
Also I found this for Instagram which is not working:
Linking.openURL('instagram://library?OpenInEditor=1&LocalIdentifier=${identifier}');
Does anyone know how to do that? (I know there are some sharing tools but I don't need to use them)

Google Places Web Api

I am working on a project to create a Uber clone. I will need to have a text input which will list predicted addresses like in the actual Uber app when user types in the text input. Once user selects the location, a map will be automatically updated.
Can I achieve this using the Google places web api alone, without touching native code? I know this can be achieved using react native google places (which needs to touch native code) but I am not comfortable toying with native codes.
If possible to achieve using Google places web api, anyone can share samples of how this is done? Tutorials online only show how to set markers for certain types only eg hotels which is not what I want to achieve. I m not sure what is the 'type' I should set when using Google places web api.
I use react native init to initialize my react native app
Thanks