Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
react-native-contacts-wrapper-pro-ry
Advanced tools
![alt tag](https://github.com/LynxITDigital/Screenshots/blob/master/RN%20Contacts%20Wrapper%20example.gif)
This is a simple wrapper for the native iOS and Android Contact Picker UIs. When calling the API functions, the appropriate picker is launched. If a contact is picked, the promise is resolved with the requested data about the picked contact.
This uses the ContactsContract API for Android, AddressBook library for iOS8 and below and the new Contacts library for ios9+.
The API is currently very basic. This was started just as a way of selecting a contact's email address. The getContact function was added as a more generic way of returning contact data. Currently this returns Name, Phone and Email for picked contact. In future more fields will be added to this, and possibly more specific methods similar to getEmail.
Feel free to extend the functionality so it's more useful for everyone - all PRs welcome!
If you have rnpm installed, all you need to do is
npm install react-native-contacts-wrapper-pro --save
react-native link react-native-contacts-wrapper-pro
in settings.gradle
include ':react-native-contacts-wrapper-pro'
project(':react-native-contacts-wrapper-pro').projectDir = new File(settingsDir, '../node_modules/react-native-contacts-wrapper-pro/android/app')
in android/app/build.gradle
dependencies {
compile project(':react-native-contacts-wrapper-pro')
in MainApplication.java
add package to getPacakges()
import com.lynxit.contactswrapper.ContactsWrapperPackage;
...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
...,
new ContactsWrapperPackage()
);
}
in AndroidManifest.xml
make sure you have the following setting even if you have done react-native upgrade
<application
android:name=".MainApplication"
Also add
<uses-permission android:name="android.permission.READ_CONTACTS" />
##API
getContact
(Promise) - returns basic contact data as a JS object. Currently returns name, first phone number and first email for contact.
getEmail
(Promise) - returns first email address (if found) for contact as string.
##Usage
Methods should be called from React Native as any other promise. Prevent methods from being called multiple times (on Android).
###Example
An example project can be found in this repo: https://github.com/LynxITDigital/react-native-contacts-wrapper-example/tree/master
import ContactsWrapper from 'react-native-contacts-wrapper-pro';
...
if (!this.importingContactInfo) {
this.importingContactInfo = true;
ContactsWrapper.getEmail()
.then((email) => {
this.importingContactInfo = false;
console.log("email is", email);
})
.catch((error) => {
this.importingContactInfo = false;
console.log("ERROR CODE: ", error.code);
console.log("ERROR MESSAGE: ", error.message);
});
FAQs
![alt tag](https://github.com/LynxITDigital/Screenshots/blob/master/RN%20Contacts%20Wrapper%20example.gif)
We found that react-native-contacts-wrapper-pro-ry 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.