mirror of
https://github.com/status-im/react-native.git
synced 2025-02-12 17:36:27 +00:00
Summary: This PR adds the ability to export videos to the CameraRoll on both Android and iOS (previously only photos were possible, at least on iOS). The API has changed as follows: ``` // old saveImageWithTag(tag: string): Promise<string> // new saveToCameraRoll(tag: string, type?: 'photo' | 'video'): Promise<string> ``` if no `type` parameter is passed, `video` is inferred if the tag ends with ".mov" or ".mp4", otherwise `photo` is assumed. I've left in the `saveImageWithTag` method for now with a deprecation warning. **Test plan (required)** I created the following very simple app to test exporting photos and videos to the CameraRoll, and ran it on both iOS and Android. The functionality works as intended on both platforms. ```js // index.js /** * Sample React Native App * https://github.com/facebook/react-native * flow */ import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, CameraRoll, } from 'react-native'; import FS fro Closes https://github.com/facebook/react-native/pull/7988 Differential Revision: D3401251 Pulled By: nicklockwood fbshipit-source-id: af3fc24e6fa5b84ac377e9173f3709c6f9795f20