Facebook as an extension

The podfile seems to be ignored. Before I investigate further, is Cocoapod support available on build.defold.com or only build-stage.defold.com? I’m not sure which branch maps onto which server.

Correct, the functionality isn’t available yet, as it arrived after the last beta period started. Sorry for the confusion!
We will have a new beta server on monday (or sooner if @britzl releases one)

2 Likes

Indeed. My apologies! I mixed up our releases and thought we had this included in the last release. I will start preparing extensions this week so that they are ready for testing next week. I’ll include the Facebook extension in this work.

3 Likes

I saw the post about problems with Swift. Shall I proceed with a traditional (non-cocoapods) Facebook SDK upgrade or might Swift be supported soon?

1 Like

Yes, I think that will have to be our approach to this update until we make the required changes on the extender server.

I have a Draft PR but need someone to give me the Facebook Client Token for the sample project, to allow me to test the API features that our game doesn’t use.

1 Like

Sorry about the delay here @AarrrBee ! I’ll provide it later today.

1 Like

Added to the GitHub ticket!

1 Like

Hi. how to require facebook module in code, since it is not native extension.
im getting error “attempt to index global ‘facebook’ (a nil value)”
Defold 1.4.6
facebook-extension 7.2.0
@britzl

Since the facebook extension is only supported on iOS/Android, you should write your code like so:

if facebook then
    Do stuff
end

Hi. so this extension is not available on defold editor build?

Correct. The extension integrates the Facebook SDK for Android and iOS. And when you run your game using Project-Build it runs a desktop version of your game, for which there is no Facebook SDK.

1 Like

I’d like to use this extension and upon following the guide here, I am stuck in this part:

go into the project settings of your Defold game. Open the game.project file from the Assets pane and scroll to the Facebook section and add the App ID to the Appid field

There is no Facebook section in the game.project file. I have updated to the latest verison of the Editor (1.9.0), added the https://github.com/defold/extension-facebook/archive/master.zip to the dependencies section and fetched the libraries. Restarted the Editor still can’t see.

What am I doing wrong?

EDIT: Running on Windows.

It was removed at some point. Those extensions had a built-in setting before. The guide should be updated.
I’m not familiar with this extension, but since the game.project file is just an ini (text) format, you can easily add these values to it. Open the game.project file with your preferred text editor, add these lines, and edit the values. When you open this file in Defold, you will be able to see them.

[facebook]
appid = 1609643756005877
autoinit = 0
clienttoken = ffb21570434787084bbdd8d6042bc9a1
2 Likes

Perfect, will give it a try. Thanks Selim.

1 Like

Yes, this is the correct way to add it.

2 Likes

Updated it: Update index.md · defold/extension-facebook@1f4d76d · GitHub

1 Like