use of com.facebook.share.model.GameRequestContent in project react-native-fbsdk by facebook.
the class FBGameRequestDialogModule method show.
/**
* Shows a GameRequestDialog to send a request.
* @param gameRequestContentMap must be a valid {@link GameRequestContent}.
* @param promise Use promise to pass the game request dialog result to JS.
*/
@ReactMethod
public void show(ReadableMap gameRequestContentMap, Promise promise) {
if (getCurrentActivity() != null) {
GameRequestDialog gameRequestDialog = new GameRequestDialog(getCurrentActivity());
GameRequestContent gameRequestContent = Utility.buildGameRequestContent(gameRequestContentMap);
gameRequestDialog.registerCallback(getCallbackManager(), new GameRequestDialogCallback(promise));
gameRequestDialog.show(gameRequestContent);
} else {
promise.reject("No current activity.");
}
}
Aggregations