defold / extension-fbinstant

Facebook Instant Games extension for the Defold game engine
https://defold.com/extension-fbinstant/
MIT License
38 stars 20 forks source link

Improve how supported APIs can be checked #33

Closed britzl closed 6 years ago

britzl commented 6 years ago

Returning a set makes it easier to check if a certain function is supported or not:

local supported_apis = fbinstant.get_supported_apis()
if supported_apis["getInterstitialAdAsync"] then
   -- load/show interstitial
end

Or maybe even utility functions such as fbinstant.is_ads_supported() would be event better?

subsoap commented 6 years ago

Both would be good. Easy helper functions for specific API features that are unique to some platforms like ads, and to be able to check in a cleaner way any API feature.