Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-message-composer

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-message-composer - npm Package Compare versions

Comparing version 0.0.5 to 0.1.0

index.js

3

package.json
{
"name": "react-native-message-composer",
"version": "0.0.5",
"version": "0.1.0",
"description": "React Native module bridge to iOS MFMessageComposeViewController",

@@ -19,2 +19,3 @@ "main": "index.js",

"iMessage",
"attachments",
"MFMessageComposeViewController",

@@ -21,0 +22,0 @@ "ios",

@@ -19,4 +19,24 @@ # react-native-message-composer

messageText - string
attachments - an array of objects
presentAnimated - boolean (animate the appearance of the message composer - true by default)
dismissAnimated - boolean (animate the closing of the message composer - true by default)
```
attachments array:
```js
[
{
url: 'http://...', // required
typeIdentifier: 'public.jpeg', // required
filename: 'pic.jpg', // optional
}
]
```
The url can be a web url to an image, video etc but be careful as by default http urls will not work without making changes to the info.plist in the native project. The url can also be a file path on the device, you could for example use https://facebook.github.io/react-native/docs/cameraroll.html to retrieve info on photos stored on the device.
For `typeIdentifier` see https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html
For further info on attachments view https://developer.apple.com/reference/messageui/mfmessagecomposeviewcontroller/1614069-addattachmentdata
The following shows an example args object

@@ -29,4 +49,4 @@

],
'subject':'Sample message subject',
'messageText':'Sample message text'
'messageText':'Sample message text',
'dismissAnimated': false
}

@@ -70,6 +90,6 @@ ```

### rnpm
### rnpm (react-native link)
1. From inside your project run `npm install react-native-message-composer --save`
2. run `rnpm link`
2. run `react-native link`

@@ -79,5 +99,9 @@ ## Usage Example

```js
var React = require('react-native');
var Composer = require('NativeModules').RNMessageComposer;
import React from 'react';
import Composer from 'react-native-message-composer';
// old way of accessing module is still supported too although no longer recommended
// import { NativeModules } from 'react-native';
// const Composer = NativeModules.RNMessageComposer;
Composer.messagingSupported(supported => {

@@ -94,3 +118,5 @@ // do something like change the view based on whether or not messaging is supported

'subject':'My Sample Subject',
'recipients':['0987654321', '0123456789']
'recipients':['0987654321', '0123456789'],
'presentAnimated': true,
'dismissAnimated': false
},

@@ -121,3 +147,3 @@ (result) => {

- [ ] Add support for message attachments
- [x] Add support for message attachments
- [ ] Fix issue with a second MFMessageComposeViewController seeming to be present if rotate device whilst MFMessageComposeViewController is open

@@ -124,0 +150,0 @@ - [ ] Look at implementing MFMessageComposeViewControllerTextMessageAvailabilityDidChangeNotification to listen for changes to the MFMessageComposeViewController `canSendText` class method

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc