react-native-message-composer
Advanced tools
Comparing version 0.0.5 to 0.1.0
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
24048
9
1
150