I am new to Firebase and I’m trying to get it working.
I followed the documentation and created a new app on the Firebase website and got the plist file. I then got the dependency in my projects list. I then added the initialization to the main init(). when I run I get a Lua error “attempt to index global ‘firebase’ (a nil value)” on the set callback line.
firebase.set_callback(function(self, message_id, message)
if message_id == firebase.MSG_INITIALIZED then
firebase.analytics.set_callback(firebase_analytics_callback)
firebase.analytics.initialize()
-- log data
firebase.analytics.log_string("TestEvent", "Test", "Test Good")
end
end)
firebase.initialize()
If you see this output I assume you added library as dependency and fetched it, so this is weird - are you sure you didn’t overwritten “firebase” somewhere by mistake? If not, I will look into this tomorrow Please send me a repro project if possible
Are you testing this on device? The firebase.* namespace is only available on iOS and Android. You can check this before trying to interact with firebase:
function init(self)
if firebase then
firebase.set_callback(....)
else
print("Firebase is not available")
end
Actually I’m running into an new problem: I can’t get my iOS app sent up to TestFlight. It is rejecting it due to the MinimumOSVersion (looks lit it’s set to 11). Looking around online it looks like maybe the minimum version is now 15.
It looks like it’s hard-coded into your builtins. Is there an easy way for me to change that? Or should I make my own?
OK, testing on the correct platform it seems to be working. My debug print is showing that it’s setup at least. I now have to figure out what’s going on with firebase. But I am moving forward. Sorry to have you waste time with my stupid mistake.
As to the info.plist: I couldn’t just copy the version from builtins. It has some special tags. presumably so that the build system fills in the correct data from the project file. These tags show up as a malformed plist file. I was able to take the filled in plist out of the app file (right clicking and choosing “Show Package Contents”) and copy and change that.