函数:whoAmI 检测触动产品类型

函数名称:检测触动产品类型

函数功能:用于判断当前运行的触动产品类型

引擎版本:iOS v2.3.2,Android v2.0.3 以上

函数方法

ret1,ret2 = whoAmI()

返回值 类型 说明
ret1 number 0 - 触动精灵;
1 - 帮你玩;
2 - 企业版;
3 - 小精灵
ret2 number 当 ret1 为 0 时,如果 ret2 为 1 时表示为安卓或者 iOS 标准版,ret2 为 2 时表示为 iOS 专业版;
当 ret1 为 2 时,如果 ret2 为 1 时表示为安卓或者 iOS 企业版,
ret2 为 2 时表示为安卓扣费版(安卓企业版仅支持 v3.0.3 及其以上版本)

函数用例

ret1,ret2 = whoAmI()
if  ret1 == 0  then
    if ret2 == 1 then
        kind = getDeviceType()
        if kind == 0 or kind == 1 or kind == 2 then
            dialog("iOS 标准版")
        else
            dialog("安卓标准版")
        end
    else
        dialog("iOS 专业版")        
    end
elseif ret1 == 1  then
    dialog("帮你玩")
elseif ret1 == 2  then
    kind = getDeviceType()
    if kind == 0 or kind == 1 or kind == 2 then
        dialog("iOS 企业版")
    elseif ret2 == 1 then
        dialog("安卓企业版")
    elseif ret2 == 2 then 
        dialog("安卓扣费版")    
    end
elseif ret1 == 3  then
    kind = getDeviceType()
    if kind == 0 or kind == 1 or kind == 2 then
        dialog("iOS 小精灵")
    else
        dialog("安卓小精灵")
    end
end
Copyright 北京帮你玩科技有限公司 2023 all right reserved,powered by Gitbook该文章修订时间: 2024-03-06 17:50:18

results matching ""

    No results matching ""