Plugin for authorization with Facebook for Godot Game Engine (iOS)

Overview

GodotFacebookAuth

Plugin for authorization with Facebook for Godot Game Engine (iOS)

  • Supports iOS deployment target >= 10.0
  • Supports Godot version >= 3.3
  • FacebookSDK 12.0.2
  • Supports simulator

Installation

  1. Download Plugin for your version of Godot, unzip and copy files to your Godot project's res://ios/plugins/godot_facebook_auth directory.

  2. You can find and activate plugin by going to Project -> Export... -> iOS and in the Options tab, scrolling to the Plugins section.

    img
  3. After exporting, you must configure an Info.plist file with an XML snippet that contains data about your app.

  • Right-click Info.plist, and choose Open As โ–ธ Source Code.

    img
  • Copy and paste the following XML snippet into the body of your file ( <dict>...</dict>).

    img
  • XML snippet

<key>CFBundleURLTypes</key>
<array>
  <dict>
  <key>CFBundleURLSchemes</key>
  <array>
    <string>fbAPP-ID</string>
  </array>
  </dict>
</array>
<key>FacebookAppID</key>
<string>APP-ID</string>
<key>FacebookClientToken</key>
<string>CLIENT-TOKEN</string>
<key>FacebookDisplayName</key>
<string>APP-NAME</string>

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>fbapi</string>
  <string>fbauth</string>
  <string>fbauth2</string>
</array>
  1. In <array><string> in the key [CFBundleURLSchemes], replace APP-ID with your App ID.
  2. In <string> in the key FacebookAppID, replace APP-ID with your App ID.
  3. In <string> in the key FacebookClientToken, replace CLIENT-TOKEN with the value found under Settings > Advanced > Client Token in your App Dashboard.
  4. In <string> in the key FacebookDisplayName, replace APP-NAME with the name of your app.

Description

  • Methods
# Check the status of authentication
credential() -> void
# Sign in with facebook
sign_in() -> void
# Sign out with facebook
sign_out() -> void
  • Signals
credential(result: Dictionary)
authorization(result: Dictionary)

Samples and Example Usage

  • Initialization
var godot_facebook_auth: Object

func _ready():
	if Engine.has_singleton("GodotFacebookAuth"):
		godot_facebook_auth = Engine.get_singleton("GodotFacebookAuth")
		godot_facebook_auth.connect("credential", self, "_on_credential")
		godot_facebook_auth.connect("authorization", self, "_on_authorization")
  • Checking credential status
# 1. Call the method anywhere in the code
godot_facebook_auth.credential()
# 2. Wait for the answer in the method below
func _on_credential(result: Dictionary):
	if result.has("error"):
		print(result.error)
	else:
		print(result.state)
		# "authorized" <- user ID is in good state
		# "not_found" <- user ID was not found
		# "revoked" <- user ID was revoked by the user
  • Sign In
# 1. Call the method anywhere in the code
godot_facebook_auth.sign_in()
# 2. Wait for the answer in the method below
func _on_authorization(result: Dictionary):
	if result.has("error"):
		print(result.error)
	else:
		# Required
		print(result.token)
		print(result.user_id)
		# Optional (can be empty)
		print(result.email)
		print(result.name)
  • Sign Out
# Call the method anywhere in the code
godot_facebook_auth.sign_out()

Build from Source

  • Just run scripts/build.sh -v 3.3.4 where -v is desired Godot version

    You will find the ready-to-use archive with the plugin in the bin directory.

Created by Oleksandr Kurtsev (Copyright ยฉ 2021) LICENSE

You might also like...
OAuth2 framework for macOS and iOS, written in Swift.
OAuth2 framework for macOS and iOS, written in Swift.

OAuth2 OAuth2 frameworks for macOS, iOS and tvOS written in Swift 5.0. โคต๏ธ Installation ๐Ÿ›  Usage ๐Ÿ–ฅ Sample macOS app (with data loader examples) ๐Ÿ“– Tec

Swift based OAuth library for iOS
Swift based OAuth library for iOS

OAuthSwift Swift based OAuth library for iOS and macOS. Support OAuth1.0, OAuth2.0 Twitter, Flickr, Github, Instagram, Foursquare, Fitbit, Withings, L

A simple OAuth library for iOS with a built-in set of providers
A simple OAuth library for iOS with a built-in set of providers

SwiftyOAuth is a small OAuth library with a built-in set of providers and a nice API to add your owns. let instagram: Provider = .instagram(clientID:

๐ŸŒ A zero-dependency networking solution for building modern and secure iOS, watchOS, macOS and tvOS applications.
๐ŸŒ A zero-dependency networking solution for building modern and secure iOS, watchOS, macOS and tvOS applications.

A zero-dependency networking solution for building modern and secure iOS, watchOS, macOS and tvOS applications. ๐Ÿš€ TermiNetwork was tested in a produc

iOS network debugging, like a wizard ๐Ÿง™โ€โ™‚๏ธ
iOS network debugging, like a wizard ๐Ÿง™โ€โ™‚๏ธ

Start debugging iOS network calls like a wizard, without extra code! Wormholy makes debugging quick and reliable. What you can do: No code to write an

Websockets in swift for iOS and OSX
Websockets in swift for iOS and OSX

Starscream is a conforming WebSocket (RFC 6455) library in Swift. Features Conforms to all of the base Autobahn test suite. Nonblocking. Everything ha

SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)
SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)

SwiftSoup is a pure Swift library, cross-platform (macOS, iOS, tvOS, watchOS and Linux!), for working with real-world HTML. It provides a very conveni

The civilized way to write REST API clients for iOS / macOS
The civilized way to write REST API clients for iOS / macOS

The elegant way to write iOS / macOS REST clients Drastically simplifies app code by providing a client-side cache of observable models for RESTful re

Fast Websockets in Swift for iOS and OSX
Fast Websockets in Swift for iOS and OSX

SwiftWebSocket Conforming WebSocket (RFC 6455) client library for iOS and Mac OSX. SwiftWebSocket passes all 521 of the Autobahn's fuzzing tests, incl

Comments
  • AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver'

    AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver'

    Hi

    I am getting an error while using this plugin. Did all the configuration. I am able to get the Facebook login dialog and when I give consent, I get the following error in the console

    2022-04-27 19:52:04.769052+1000 TurnBlast[22715:13455502] [AXRuntimeCommon] AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:21861 (
    	0   AXRuntime                           0x00000001ab10aa9c 7A975793-0055-365F-A61A-C16EF91F55E2 + 338588
    	1   AXRuntime                           0x00000001ab0bfe30 _AXGetPortFromCache + 704
    	2   AXRuntime                           0x00000001ab0c175c AXUIElementPerformFencedActionWithValue + 564
    	3   UIKit                               0x00000001f670d234 2EAAE3FE-BFB1-3E62-B103-6B14136D43AE + 934452
    	4   libdispatch.dylib                   0x000000011231cc6c _dispatch_call_block_and_release + 32
    	5   libdispatch.dylib                   0x000000011231e7bc _dispatch_client_callout + 20
    	6   libdispatch.dylib                   0x00000001123268a4 _dispatch_lane_serial_drain + 984
    	7   libdispatch.dylib                   0x00000001123275e0 _dispatch_lane_invoke + 428
    	8   libdispatch.dylib                   0x0000000112334168 _dispatch_workloop_worker_thread + 908
    	9   libsystem_pthread.dylib             0x00000001f63de0bc _pthread_wqthread + 288
    	10  libsystem_pthread.dylib             0x00000001f63dde5c start_wqthread + 8
    )
    

    Not sure if you can point me in the right direction.

    Thanks

    opened by dariuspranskus 2
Owner
Oleksandr Kurtsev
๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป I'm a Mobile Developer
Oleksandr Kurtsev
Tiny http server engine written in Swift programming language.

What is Swifter? Tiny http server engine written in Swift programming language. Branches * stable - lands on CocoaPods and others. Supports the latest

null 3.6k Dec 31, 2022
Plugin and runtime library for using protobuf with Swift

Swift Protobuf Welcome to Swift Protobuf! Apple's Swift programming language is a perfect complement to Google's Protocol Buffer ("protobuf") serializ

Apple 4.1k Jan 6, 2023
A new Flutter plugin that uses OpenVpn

flutter_openvpn A new Flutter plugin that uses OpenVpn. Installation Depend on it Add this to your package's pubspec.yaml file: dependencies: flutte

Vladislav Len 4 Dec 26, 2022
Shawn Frank 2 Aug 31, 2022
Approov-service-ios-swift-grpc - Approov service layer for iOS clients using GRPC

Approov Service for GRPC A wrapper for the Approov SDK to enable easy integratio

Approov Integration Examples 0 Jan 21, 2022
Approov Integration Examples 0 Jan 26, 2022
iONess is HTTP Request Helper for iOS platform used by HCI iOS App

iONess iONess (iOS Network Session) is HTTP Request Helper for the iOS platform used by Home Credit Indonesia iOS App. It uses Ergo as a concurrent he

OSFE Homecredit Indonesia 1 Mar 28, 2022
๐ŸŒธ Powerful Codable API requests builder and manager for iOS.

This lib is about network requests with blackjack, roulette and craps! Using it you will be able to convert your massive API layer code into an awesom

CodyFire 251 Jan 8, 2023
Easy to use OAuth 2 library for iOS, written in Swift.

Heimdallr Heimdallr is an OAuth 2.0 client specifically designed for easy usage. It currently supports the resource owner password credentials grant f

trivago N.V. 628 Oct 17, 2022
A lightweight, one line setup, iOS / OSX network debugging library! ๐ŸฆŠ

Netfox provides a quick look on all executed network requests performed by your iOS or OSX app. It grabs all requests - of course yours, requests from

Christos Kasketis 3.4k Dec 28, 2022