• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Android Facebook SDK for Android

F

Farouk

Guest
Hi
i am trying to create a marketing campaign on Facebook that tracks App installs for my first game maker game
while creating the campaign i got this error message from Facebook:

"To optimize for App Installs, you need to:
  • Add our SDK on IOS or Andriod to your app.


How can i Add this SDK to my game? and which SDK exactly should i add?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Moderator
You need to get the Facebook extension off the Marketplace and then integrate it in your game. If you go to the Android Game Options and then go to the "social" section and check the "Facebook" checkbox, you'll be directed to the download page. Once you've subscribed to it, go to your Library page and then add it to the project from there using the "import" option. You'll need to have set up a facebook listing and supply The App ID and App Name to the Android Game Options, and then use the functions listed here to communicate: http://docs2.yoyogames.com/index.ht...ce/asynchronous functions/facebook/index.html
 
F

Farouk

Guest
Thank you so much
i will give it a try and get back if am stuck :)
 
F

Farouk

Guest
Hi
as soon as i added the extension the build started failing, here is what i Got:
please note that i think i installed all needed SDK eariler

AILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':com.OCTOBOX.game'.
> Could not resolve all dependencies for configuration ':com.OCTOBOX.game:_debugApkCopy'.
> Could not find com.android.support:support-v4:27.0.2.
Required by:
project :com.OCTOBOX.game
> Could not find com.android.support:support-annotations:27.0.2.
Required by:
project :com.OCTOBOX.game > com.facebook.android:facebook-android-sdk:4.30.0 > com.facebook.android:facebook-core:4.30.0
> Could not find com.android.support:support-core-utils:27.0.2.
Required by:
project :com.OCTOBOX.game > com.facebook.android:facebook-android-sdk:4.30.0 > com.facebook.android:facebook-core:4.30.0
> Could not find com.android.support:support-v4:27.0.2.
Required by:
project :com.OCTOBOX.game > com.facebook.android:facebook-android-sdk:4.30.0 > com.facebook.android:facebook-common:4.30.0
> Could not find com.android.support:appcompat-v7:27.0.2.
Required by:
project :com.OCTOBOX.game > com.facebook.android:facebook-android-sdk:4.30.0 > com.facebook.android:facebook-common:4.30.0
project :com.OCTOBOX.game > com.facebook.android:facebook-android-sdk:4.30.0 > com.facebook.android:facebook-login:4.30.0
> Could not find com.android.support:cardview-v7:27.0.2.
Required by:
project :com.OCTOBOX.game > com.facebook.android:facebook-android-sdk:4.30.0 > com.facebook.android:facebook-common:4.30.0
> Could not find com.android.support:customtabs:27.0.2.
Required by:
project :com.OCTOBOX.game > com.facebook.android:facebook-android-sdk:4.30.0 > com.facebook.android:facebook-common:4.30.0
> Could not find com.android.support:support-v4:27.0.2.
Required by:
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Moderator
Okay, you'll need to set the target SDK values in the Android Game Options to Api 25, so they'll look something like this (you may need to set the minimum SDK value to 11 or higher):

upload_2018-2-22_11-25-37.png

Then, in the Facebook Extension itself, you need to force the version of the facebook sdk using the line compile 'com.facebook.android:facebook-android-sdk:4.26.0'
in your "inject to gradle" dependencies rather then the existing line.
 

Attachments

F

Farouk

Guest
thank you so much but can you give more details on this part?

"Then, in the Facebook Extension itself, you need to force the version of the facebook sdk using the line compile 'com.facebook.android:facebook-android-sdk:4.26.0'
in your "inject to gradle" dependencies rather then the existing line."

sorry but am still a beginner
 
F

Farouk

Guest
Ok i managed to do it, thanks for your info :)

here is exactly what i did in case there is a beginner here as well

0- Did the steps Nocturne mentioned to change version numbers from game maker
1- located the Facebook extension folder inside the folder of my game
2- located the file called FacebookExtension.yy
3- Edited the line :

compile 'com.android.support:support-v4:${YYAndroidSupportLibVersion}'\\u000a\\u000d compile 'com.facebook.android:facebook-android-sdk:4.+'",

to

compile 'com.facebook.android:facebook-android-sdk:4.26.0'\\u000a\\u000d compile 'com.facebook.android:facebook-android-sdk:4.26.0'",

note that its changed in two parts and the part after the \\ is not a comment as i first thought


now it's working
also don't forget to do the rest of the instructions Nocturne mentioned

4- also the minimum SDK must be set to 15 for this extension to work
 
F

Farouk

Guest
Ok i sorted it out

when i edited the Facebook extension and added this line :
'com.facebook.android:facebook-android-sdk:4.26.0'\\u000a\\u000d compile 'com.facebook.android:facebook-android-sdk:4.26.0'",

game maker reverted back the old version for some reason

in the future when editing extension files i think game maker studio must be closed first
 
Top