Files
react-native/ReactAndroid/src/androidTest/js/ShareTestModule.js
T
Michael Bolin 0b9ea60b4f Back out "Upgrade Prettier from 1.17 to 2.0.2."
Differential Revision: D20639755

fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd
2020-03-24 21:47:35 -07:00

37 lines
920 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
'use strict';
const React = require('react');
const {NativeModules, Share, View} = require('react-native');
const BatchedBridge = require('react-native/Libraries/BatchedBridge/BatchedBridge');
const {ShareRecordingModule: RecordingModule} = NativeModules;
class ShareTestApp extends React.Component {
render() {
return <View />;
}
}
const ShareTestModule = {
ShareTestApp: ShareTestApp,
showShareDialog: function(content, options) {
Share.share(content, options).then(
() => RecordingModule.recordOpened(),
({code, message}) => RecordingModule.recordError(),
);
},
};
BatchedBridge.registerCallableModule('ShareTestModule', ShareTestModule);
module.exports = ShareTestModule;