Hello,
I would like to share a plugin i was working for my games. It integrates some basic functionality for Facebook sdk. Currently supports only Android. Some of you might find it useful for your projects too.
You can get the plugin here: https://github.com/PandoraEntertainment/Facebook
To use the plugin you have to setup minimum SDK version at Android settings to 21 and NDK LEVEL API to android-23.
…\Documents\Unreal Projects\YourProject\Plugins\FacebookSDK\lib\Android\res\values, you have to open FacebookID.xml and and use your Facebook APP_ID from facebook dashboard:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="facebook_app_id"></string><!-- Replace with your Facebook APP_ID -->
</resources>
At FacebookSDK_APL file you have to add yoUR APP_ID at the following manifest additions:
<!-- Replace with your Facebook APP_ID -->
<provider android:authorities="com.facebook.app.FacebookContentProvider${APP_ID}"
android:name="com.facebook.FacebookContentProvider"
android:exported="true" />
and then at gameActivityClassAdditions section replace the strings with your applinkUrl and previewImageUrl.
String appLinkUrl = "";//Replace with your applinkUrl
String previewImageUrl = "";////Repplace with your previewImageUrl
Don’t forget to follow all the instructions at Facebook dashboard and complete all required information and settings.
Bellow are few images showing the blueprint nodes available:
In order to use the Login Events create an actor blueprint, add Facebook sdk component and add it to your level.
With the App Invite node you can invite your Facebook friends to your game.
With the share photo you can share a photo from your game. You need to specify the AppName, it is the same as what you have on your package name, com.yourcompany.yourgame and the name of the file. For example MyScreenshot.png
To get a screenshot i am using the Screenshot method at my sharing plugin:https://github.com/PandoraEntertainment/Sharing
If you want to target devices with minimum target sdk below 21 you can try using the facebook 4.10.1 aar, but i haven’t tested it with this version, I think i have fix some errors during packaging regarding the aar res files, but i abandoned and start working with 4.18.0 version of facebook sdk.
In the FacebookSDK_APL file:
<AARImports>
<insertValue value="repository $S(PluginDir)/../../ThirdParty/repository"/>
<insertNewline/>
<insert>com.facebook,Facebook,4.18.0</insert>
<insertNewline/>
</AARImports>
replace with:
<AARImports>
<insertValue value="repository $S(PluginDir)/../../ThirdParty/repository"/>
<insertNewline/>
<insert>com.facebook,Facebook,4.10.1</insert>
<insertNewline/>
</AARImports>
For those that will like to get profile images, friends lists, or have leaderboards, achievements i won’t integrate those from Facebook, but i can achieve this functionality already and with a much more flexibility, in my opinion, by using Playfab
By just getting the facebook access token, i can get info about user profile and their friends, download user profile picture and those of their friends etc.
I will update this thread too: https://forums.unrealengine.com/showthread.php?127487-FREE-AdColony-AppLovin-Chartboost-UnityAds-Vungle-Sharing-OneSignal-Facebook-Everyplay