Welcome

 
Type Library
Corona Store photoLibPlus
Sample Code View Sample on GitHub
Platforms Android

Overview

The Photo Library Plus plugin is an extension on the existing Corona media library. With this plugin, you are able to access all of the photos from the user's device, retrieve metadata, copy the photos, and use thumbnails created by the operating system.

Corona Store Activation

In order to use this plugin, you must activate the plugin at the Corona Store.

SDK

When you build using the Corona Simulator, the server automatically takes care of integrating the plugin into your project.

All you need to do is add an entry into a plugins table of your build.settings. The following is an example of a minimal build.settings file:

settings =
{
    plugins =
    {
        -- key is the name passed to Lua's 'require()'
        ["plugin.photoLibPlus"] =
        {
            -- required
            publisherId = "com.deleurapps",
        },
    },
}

Android

Before calling the plugin, you must request the android.permission.READ_EXTERNAL_STORAGE and android.permission.WRITE_EXTERNAL_STORAGE permission for android. To do so,call the following function:

native.showPopup( "requestAppPermission", {appPermission = "android.permission.READ_EXTERNAL_STORAGE", urgency = "Critical", } )
native.showPopup( "requestAppPermission", {appPermission = "android.permission.WRITE_EXTERNAL_STORAGE", urgency = "Critical", } )

Syntax

local photoLibPlus = require "plugin.photoLibPlus"