mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Differential Revision: D20639755 fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd
37 lines
920 B
JavaScript
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;
|