This forum topic is outdated, please, take a look this post about Google Play Instant:
Old post is available here (outdated)
https://github.com/AGulev/instantapp
Google Instant Apps
This is Native Extension for the Defold Game Engine implement Google Play Instant API methods.
Here you can find instruction how to build instant app using Defold.
Setup
You can use the InstantApp extension in your own project by adding this project as a Defold library dependency. Open your game.project file and in the dependencies field under project add:
https://github.com/AGulev/instantapp/archive/master.zip
Or point to the ZIP file of a specific release.
API
If you are working on cross-platform application the best practice to check the existence of instantapp
module, this module exists only in android bundle:
if instantapp then
-- call instantapp methods
end
instantapp.is_instant_app()
Original DOC
Returns true if this application is an instant app.
if instantapp.is_instant_app() then
--do something specific for instant app
end
instantapp.show_install_prompt()
Original DOC
Shows a dialog that allows the user to install the current instant app.
if instantapp.is_instant_app() then
instantapp.show_install_prompt() -- if this is instant app then show install prompt
else
-- regular app logic
end
Popup example:
instantapp.get_cookie_max_size()
Original DOC
Gets the maximum size in bytes of the cookie data an instant app can store on the device.
local cookie_size = instantapp.get_cookie_max_size() --number, for example 16384
instantapp.get_cookie()
Original DOC
Gets the instant application cookie for this app. Non instant apps and apps that were instant but were upgraded to normal apps can still access this API.
local cookie_byte_array = instantapp.get_cookie()
instantapp.set_cookie()
Original DOC
Sets the instant application cookie for the calling app. Non instant apps and apps that were instant but were upgraded to normal apps can still access this API.
instantapp.set_cookie(bytes)
Issues and suggestions
If you have any issues, questions or suggestions please create an issue or contact me: me@agulev.com