Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove FIR cpp SDK #12

Merged
merged 13 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,23 @@ $ ./generate_xml_from_google_services_json.py -i google-services.json -o google-
function init(self)
-- use firebase only if it is supported on the current platform
if firebase then
local ok, err = firebase.init()
if not ok then
print(err)
return
end

-- firebase is ready to use!

-- installation auth token can be used for configuring test devices for A/B tests
firebase.get_installation_auth_token(function(self, token)
print("installation auth token is " .. token)
firebase.set_callback(function(self, message_id, message)
if message_id == firebase.MSG_INITIALIZED then
-- firebase is ready to use!

-- installation auth token can be used for configuring test devices for A/B tests
firebase.get_installation_auth_token()
-- retrieve Firebase installation ID for example, to create segments of app installs for BiqQuery import,
-- or toperform testing during Firebase In-App Messaging development,
-- you can identify and target the correct devices using the corresponding Firebase installation IDs.
firebase.get_installation_id()
elseif message_id == firebase.MSG_INSTALLATION_ID then
print("id:", message.id)
elseif message_id == firebase.MSG_INSTALLATION_AUTH_TOKEN then
print("token:", message.token)
elseif message_id == firebase.MSG_ERROR then
print("ERROR:", message.error)
end
end)
end
end
Expand Down
19 changes: 18 additions & 1 deletion example/example.collection
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,24 @@ name: "default"
scale_along_z: 0
embedded_instances {
id: "go"
data: ""
data: "components {\n"
" id: \"example\"\n"
" component: \"/example/example.script\"\n"
" position {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
" property_decls {\n"
" }\n"
"}\n"
""
position {
x: 0.0
y: 0.0
Expand Down
18 changes: 15 additions & 3 deletions example/example.script
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
function init(self)
if firebase then
firebase.init()
end
if firebase then
firebase.set_callback(function(self, message_id, message)
if message_id == firebase.MSG_INITIALIZED then
firebase.get_installation_auth_token()
firebase.get_installation_id()
elseif message_id == firebase.MSG_INSTALLATION_ID then
print("id:", message.id)
elseif message_id == firebase.MSG_INSTALLATION_AUTH_TOKEN then
print("token:", message.token)
elseif message_id == firebase.MSG_ERROR then
print("ERROR:", message.error)
end
end)
firebase.initialize()
end
end
128 changes: 95 additions & 33 deletions firebase/api/firebase.script_api
Original file line number Diff line number Diff line change
@@ -1,33 +1,95 @@
- name: firebase
type: table
desc: Functions and constants for interacting with Firebase

members:
- name: init
type: function
desc: Initialise Firebase

parameters:
- name: options
optional: true
type: table
desc: Optional table with initialisation parameters to use instead of those specified in google-services.xml/plist
When passing this, disable creation of the default Firebase App by specifying firebase.no_auto_init in game.project
Valid keys in the table are api_key, app_id, database_url, messaging_sender_id, project_id, storage_bucket. All values are strings.

return:
- name: success
type: boolean
desc: Indicates if initialisation was successful
- name: error
type: string
desc: Error message if initialisation failed

- name: get_installation_auth_token
type: function
desc: Get the Firebase Installation auth token

parameters:
- name: callback
type: function
desc: Function to invoke with the auth token (self, token)
- name: firebase
type: table
desc: Functions and constants for interacting with Firebase

#*****************************************************************************************************

members:
- name: initialize
type: function
desc: Initialise Firebase

parameters:
- name: options
optional: true
type: table
desc: Optional table with initialisation parameters to use instead of those specified in google-services.xml/plist
When passing this, disable creation of the default Firebase App by specifying firebase.no_auto_init in game.project
Valid keys in the table are api_key, app_id, database_url, messaging_sender_id, project_id, storage_bucket. All values are strings.

return:
- name: success
type: boolean
desc: Indicates if initialisation was successful
- name: error
type: string
desc: Error message if initialisation failed

#*****************************************************************************************************

- name: get_installation_auth_token
type: function
desc: Get the Firebase Installation auth token

#*****************************************************************************************************

- name: set_callback
type: function
desc: Sets a callback function for receiving events from the SDK. Call `firebase.set_callback(nil)`
to remove callback
parameters:
- name: callback
type: function
desc: Callback function that is executed on any event in the SDK.

parameters:
- name: self
type: object
desc: The calling script instance

- name: message_id
type: number
desc: "One of message types:
`firebase.MSG_INITIALIZED`
`firebase.MSG_INSTALLATION_AUTH_TOKEN`
`firebase.MSG_INSTALLATION_ID`
`firebase.MSG_ERROR`"

- name: message
type: table
desc: A table holding the data
fields:
- name: token
type: number
desc: for MSG_INSTALLATION_AUTH_TOKEN

- name: id
type: number
desc: for MSG_INSTALLATION_ID

- name: error
type: string
optional: true
desc: The error message (if an error occurred or `nil` otherwise)

#*****************************************************************************************************

- name: get_installation_id
type: function
desc: Get the Firebase Installation id

#*****************************************************************************************************

- name: MSG_ERROR
type: number

- name: MSG_INITIALIZED
type: number

- name: MSG_INSTALLATION_AUTH_TOKEN
type: number

- name: MSG_INSTALLATION_ID
type: number

#*****************************************************************************************************
2 changes: 1 addition & 1 deletion firebase/ext.manifest
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Firebase"
name: "FirebaseExt"

platforms:
android:
Expand Down
6 changes: 0 additions & 6 deletions firebase/include/firebase.h

This file was deleted.

157 changes: 0 additions & 157 deletions firebase/include/firebase/admob.h

This file was deleted.

Loading
Loading