-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove FIR cpp SDK (#11) * fix spaces and doc * Revert "Auxiliary commit to revert individual files from cf8140f" This reverts commit a1f140fa1e45aa2ff1bf34e147eb2ed9b56b7928. * restire options and change documentation * finish android implementation * fix ios * remove cpp flags * fix initialization on android * fix missed context * fix readme * resotre luautils * comment out unused luautils * comment out unused luautils --------- Co-authored-by: Sippul <[email protected]>
- Loading branch information
Showing
105 changed files
with
886 additions
and
21,665 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,16 @@ | ||
[![Actions Status Alpha](https://github.com/defold/extension-firebase/actions/workflows/bob.yml/badge.svg)](https://github.com/defold/extension-firebase/actions) | ||
|
||
![](https://img.shields.io/badge/Firebase%20CPP%20SDK-8.10.0-green) | ||
![](https://img.shields.io/badge/Firebase%20iOS%20SDK-8.13.0-green) | ||
|
||
|
||
# Firebase | ||
Firebase is Google's mobile platform that helps you quickly develop high-quality apps and grow your business. This repository contains the core components required by the various products included in Firebase. It is not intended for use on its own. | ||
|
||
--- | ||
|
||
## Development notes | ||
Use this guide when setting up or upgrading this core extension and the extensions for each of the Firebase products (such as analytics and remote config). The extensions are using the [Firebase C++ SDK](https://firebase.google.com/docs/cpp/setup) and the [Firebase iOS SDK](https://github.com/firebase/firebase-ios-sdk). | ||
|
||
* Firebase C++ SDK download link: https://firebase.google.com/download/cpp | ||
* Firebase C++ SDK direct download link: https://dl.google.com/firebase/sdk/cpp/firebase_cpp_sdk_8.8.0.zip | ||
|
||
### Copy includes | ||
Copy header files from `firebase_cpp_sdk/include`. | ||
|
||
|
||
### Configure Android Gradle dependencies | ||
The Gradle dependencies used by this extension need to match the ones specified in the Firebase C++ SDK. | ||
|
||
The Gradle dependencies used by this extension need to match the ones specified in the [Release Notes](https://firebase.google.com/support/releases) | ||
* Add Gradle dependencies to `extension/manifests/android/build.gradle` | ||
* Specified in `firebase_cpp_sdk/Android/firebase_dependencies.gradle` -> [`firebaseDependenciesMap`](https://github.com/firebase/firebase-cpp-sdk/blob/v7.3.0/release_build_files/Android/firebase_dependencies.gradle) | ||
* Or in [`firebase_cpp_sdk/readme.md`](https://raw.githubusercontent.com/firebase/firebase-cpp-sdk/v7.3.0/release_build_files/readme.md) | ||
|
||
|
||
#### Copy Android C++ library dependencies | ||
Android C++ libraries should be copied from the Firebase C++ SDK to your extension. | ||
|
||
* Copy libs from Firebase C++ SDK | ||
* `firebase_cpp_sdk/libs/android/armeabi-v7a/c++/*` | ||
* `firebase_cpp_sdk/libs/android/arm64-v8a/c++/*` | ||
|
||
|
||
### Configure Cocoapod dependencies | ||
The Cocoapod dependencies used by this extension need to match the ones specified in the Firebase C++ SDK. | ||
The Cocoapod dependencies used by this extension need to match the ones specified in the [Release Notes](https://firebase.google.com/support/releases) | ||
|
||
* Add Cocoapod dependencies to `extension/manifest/ios/Podfile` | ||
|
||
#### Copy iOS C++ library dependencies | ||
iOS C++ libraries should be copied from the Firebase C++ SDK to your extension. | ||
|
||
* Copy libs from the Firebase C++ SDK | ||
* `firebase_cpp_sdk/libs/ios/device-arm64/` -> `extension/lib/arm64-ios/` | ||
* `firebase_cpp_sdk/libs/ios/device-armv7/` -> `extension/lib/armv7-ios/` | ||
* `firebase_cpp_sdk/libs/ios/simulator-x86_64/` -> `extension/lib/x86_64-ios/` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
#***************************************************************************************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,6 @@ | ||
name: "Firebase" | ||
name: "FirebaseExt" | ||
|
||
platforms: | ||
android: | ||
context: | ||
aaptExtraPackages: ['com.google.android.gms.common'] | ||
|
||
arm64-android: | ||
context: | ||
flags: ["-std=c++11"] | ||
|
||
armv7-android: | ||
context: | ||
flags: ["-std=c++11"] | ||
|
||
armv7-ios: | ||
context: | ||
flags: ["-std=c++11"] | ||
|
||
arm64-ios: | ||
context: | ||
flags: ["-std=c++11"] | ||
|
||
x86_64-ios: | ||
context: | ||
flags: ["-std=c++11"] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.