Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
react-native-send-intent
Advanced tools
React Native Android module to use Android's Intent actions for send sms, text to shareable apps or make phone calls
React Native Android module to use Android's Intent actions for send text to shareable apps or make phone calls.
This module is useful when you need to share some text between apps in Android device and if you have a valid phone number make some call directly (if you ask for permission in AndroidManifest.xml).
E.g.: You have and short text and want to share in a SMS or Whatsapp.
npm install react-native-send-intent --save
android/setting.gradle
...
include ':RNSendIntentModule', ':app'
project(':RNSendIntentModule').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-send-intent')
android/app/build.gradle
...
dependencies {
...
compile project(':RNSendIntentModule')
}
import com.burnweb.rnsendintent.RNSendIntentPackage; // <--- import
public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
......
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReactRootView = new ReactRootView(this);
mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModuleName("index.android")
.addPackage(new MainReactPackage())
.addPackage(new RNSendIntentPackage()) // <------ add this line to yout MainActivity class
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();
mReactRootView.startReactApplication(mReactInstanceManager, "AndroidRNSample", null);
setContentView(mReactRootView);
}
......
}
var SendIntentAndroid = require('react-native-send-intent');
SendIntentAndroid.sendText({
title: 'Please share this text',
text: 'Lorem ipsum dolor sit amet, per error erant eu, antiopam intellegebat ne sed',
type: SendIntentAndroid.TEXT_PLAIN
});
Thanks to @pedro ;)
var SendIntentAndroid = require('react-native-send-intent');
SendIntentAndroid.sendSms('+55 48 9999-9999', 'SMS body text here');
It's very important ask for permission in your AndroidManifest.xml file if you need to use Phone Calls directly.
Please add this line to your XML before using this example:
<uses-permission android:name="android.permission.CALL_PHONE" />
And them you can call in your JavaScript files:
var SendIntentAndroid = require('react-native-send-intent');
SendIntentAndroid.sendPhoneCall('+55 48 9999-9999');
For this use you doesn't need to ask any permission.
var SendIntentAndroid = require('react-native-send-intent');
SendIntentAndroid.sendPhoneDial('+55 48 9999-9999');
MIT
FAQs
React Native Android module to use Android's Intent actions for send sms, text to shareable apps, open custom apps, make phone calls and etc
The npm package react-native-send-intent receives a total of 6,825 weekly downloads. As such, react-native-send-intent popularity was classified as popular.
We found that react-native-send-intent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.