I am trying to export the Send Button from Facebook Messenger as a Native UI Component in react native. I am not getting any errors, but I am also not seeing the button.
my references for this are: https://facebook.github.io/react-native/docs/native-components-ios.html and https://developers.facebook.com/docs/messenger/ios#messenger_buttons
Here is what I have so far:
RCTFBMessengerButtonManager.m
#import "RCTViewManager.h"
#import <FBSDKMessengerShareKit/FBSDKMessengerShareKit.h>
@interface RCTFBMessengerButtonManager : RCTViewManager
@end
@implementation RCTFBMessengerButtonManager
RCT_EXPORT_MODULE()
- (UIView *)view
{
return [FBSDKMessengerShareButton rectangularButtonWithStyle:FBSDKMessengerShareButtonStyleBlue];
}
@end
FBMessengerButton.js is where I get the Native component:
var { requireNativeComponent } = require('react-native');
module.exports = requireNativeComponent('RCTFBMessengerButton', null);
and my send component where I implement the FBMesssengerButton component:
'use strict';
var React = require('react-native');
var {
View,
} = React;
var FBMessengerButton = require('../Components/FBMessengerButton');
class Send extends React.Component{
constructor(props){
super(props);
}
render() {
return (
<View>
<FBMessengerButton />
</View>
);
}
}
module.exports = Send;