Get app group info (app.group_info)
Declaration
group_info = app.group_info(bid)
Parameters
- bid
String. App bundle identifier. You can find it inXXT App -> More -> App List.
Returns
- group_info
Table. App group info represented as key-value pairs like{group_id = data_path, ...}. Empty table if not exists.
Description
- App Group is available since iOS 8. iOS 7 does not have this concept.
Example
local function clear_dir(path)
for fn in ipairs(file.list(path) or {}) do
local full_path = path .. '/' .. fn
file.remove(full_path)
end
end
--
local info = app.group_info("com.tencent.mqq") -- Get QQ's app group info
--
-- Loop through and delete all contents in app group directories
for _,p in pairs(info) do
for _,v in ipairs(file.list(p) or {}) do
local path = p .. '/' .. v
if file.exists(path) == 'directory' then
clear_dir(path)
elseif v ~= '.com.apple.mobile_container_manager.metadata.plist' then
file.remove(path)
end
end
end