0
\$\begingroup\$

Im developing an app that when you click a button the phone has to vibrate, the issue is that the phone just chashes. Saing that I need permitions to vibrate. I've already set this permition in the build.setting (android manifiest).

Here is the code

build.settings:

settings =
{
orientation = {
    default = "portrait",
    supported = { "portrait", }
},

iphone =
{
    plist=
    {
        CoronaUseIOS7LandscapeOnlyWorkaround = true,
        CoronaUseIOS7IPadPhotoPickerLandscapeOnlyWorkaround = true,
        CoronaUseIOS6LandscapeOnlyWorkaround = true,
        CoronaUseIOS6IPadPhotoPickerLandscapeOnlyWorkaround = true,
        UIApplicationExitsOnSuspend = false,
        UIPrerenderedIcon = true,
        UIStatusBarHidden = false,
        CFBundleIconFile = "Icon.png",
        CFBundleIconFiles = 
        {
            "Icon.png", 
            "Icon@2x.png", 
            "Icon-60.png",
            "Icon-60@2x.png",
            "Icon-72.png", 
            "Icon-72@2x.png",
            "Icon-76.png",
            "Icon-76@2x.png", 
            "Icon-Small.png", 
            "Icon-Small@2x.png",
            "Icon-Small-40.png",
            "Icon-Small-40@2x.png",
            "Icon-Small-50.png", 
            "Icon-Small-50@2x.png", 
        },
    },
},
android =
{
    permissions =
    {
        { name = ".permission.C2D_MESSAGE", protectionLevel = "signature" },
    },
    usesPermissions =
    {
        "android.permission.INTERNET",
        "android.permission.VIBRATE",
    },
},
}

the file that uses the vibration is:

local onButtonEvent = function (event )

        system.vibrate()
end

I read all post in Corona page without success. Can I see the android manifest to see if the permissions are there. I've read that is a Corona issue not sure.

\$\endgroup\$
  • \$\begingroup\$ Some phones just have bugs. I have an old Samsung that runs Android 1.5. It just doesn't play MP3s. You have to deal with it :) \$\endgroup\$ – ashes999 Jun 5 '14 at 21:26
1
\$\begingroup\$

It worked with the following build.settings:

settings =
{
orientation = {
    default = "portrait",
    supported = { "portrait", }
},

iphone =
{
    plist=
    {
        CoronaUseIOS7LandscapeOnlyWorkaround = true,
        CoronaUseIOS7IPadPhotoPickerLandscapeOnlyWorkaround = true,
        CoronaUseIOS6LandscapeOnlyWorkaround = true,
        CoronaUseIOS6IPadPhotoPickerLandscapeOnlyWorkaround = true,
        UIApplicationExitsOnSuspend = false,
        UIPrerenderedIcon = true,
        UIStatusBarHidden = false,
        CFBundleIconFile = "Icon.png",
        CFBundleIconFiles = 
        {
            "Icon.png", 
            "Icon@2x.png", 
            "Icon-60.png",
            "Icon-60@2x.png",
            "Icon-72.png", 
            "Icon-72@2x.png",
            "Icon-76.png",
            "Icon-76@2x.png", 
            "Icon-Small.png", 
            "Icon-Small@2x.png",
            "Icon-Small-40.png",
            "Icon-Small-40@2x.png",
            "Icon-Small-50.png", 
            "Icon-Small-50@2x.png", 
        },
    },
},
android =
{
    permissions =
    {
        { name = ".permission.C2D_MESSAGE", protectionLevel = "signature" },
    },
    usesPermissions =
    {
        "android.permission.INTERNET",
        "android.permission.VIBRATE",
    },
},
}
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.