Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Vibrator
Started by Michael W. Sep 15 2015 02:42 PM

36 replies to this topic
release android ios
[TOPIC CONTROLS]
Page 1 of 2 1 2
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Michael W.

[GLOBAL: userInfoPane.html]
Michael W.
  • Contributor

  • 276 posts
  • Alumni

Vibrator

by Spiral Code Studio


View and activate on the Corona Store


The Vibrator plugin provides you a fine control over vibration ability of Android devices. iOS devices, unfortunately, lack such customization.

Documentation

[TOPIC: post.html]
#2

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 484 posts
  • Corona SDK

Thanks! Great work!



[TOPIC: post.html]
#3

ondra.vaic

[GLOBAL: userInfoPane.html]
ondra.vaic
  • Observer

  • 6 posts
  • Corona SDK

Hello, I added the plugin in my build.settings and tried to require it just like in the tutorial, but I'm getting module 'plugin_vibrator' not found. What could be the problem? 

--in build.settings
settings =
{

plugins = 
{  
    ['plugin.vibrator'] = {publisherId = 'com.spiralcodestudio'}
}
--in main.lua
local vibrator = require('plugin.vibrator')


[TOPIC: post.html]
#4

ben.betty

[GLOBAL: userInfoPane.html]
ben.betty
  • Observer

  • 10 posts
  • Corona SDK

Hello,

I activated the vibrator plugin some month ago. Now I changed the Corona SDK version to 2016.2830 and the Corona Simulator don't find the plugin.

I tried to buy another time but the plugin is not downloaded when my app run on Simulator.

 

Other plugin are in folder: C:\Users\MyUser\AppData\Roaming\Corona Labs\Corona Simulator\Plugins.

 

How I can download the plugin or make it clear to Corona that must download it?

 

Thanks

Ben



[TOPIC: post.html]
#5

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,133 posts
  • Corona SDK

I'm not sure the vibrator plugin works in the simulator. Are you getting any messages in your console log?
 

Rob



[TOPIC: post.html]
#6

ben.betty

[GLOBAL: userInfoPane.html]
ben.betty
  • Observer

  • 10 posts
  • Corona SDK

yes, I have the following error message and the app don't start:

 

21:45:07.404

21:45:07.404 Windows simulator build date: Feb 18 2016 @ 02:28:53

21:45:07.404

21:45:10.662

21:45:10.662 Copyright © 2009-2016 C o r o n a L a b s I n c .

21:45:10.662 Version: 3.0.0

21:45:10.662 Build: 2016.2830

21:45:10.662 Platform: GT-I9300 / x64 / 6.3 / Intel® HD Graphics 4600 / 4.2.0 - Build 10.18.10.3540 / 2016.2830 / it_IT | IT | it_IT | it

21:45:10.678 Loading project from: C:\Users\Raul\Documents\Corona Projects\Cells-mania

21:45:10.678 Project sandbox folder: C:\Users\Raul\AppData\Local\Corona Labs\Corona Simulator\Sandbox\cells-mania-DBD20F576FEECC7F5D6B0B4309372EC2\Documents

21:45:11.693 PluginSync: plugin com.coronalabs/plugin.coronaAds needs to be updated for platform win32-sim to build number: 2828

21:45:11.693 PluginSync: downloading plugin: http://plugins.coronasphere.com/com.coronalabs/plugin.coronaAds/2016.2828/win32-sim/plugin.coronaAds.zip

21:45:11.693 PluginSync: plugin com.coronalabs/plugin.fuse needs to be updated for platform win32-sim to build number: 2828

21:45:11.693 PluginSync: downloading plugin: http://plugins.coronasphere.com/com.coronalabs/plugin.fuse/2016.2828/win32-sim/plugin.fuse.zip

21:45:12.240 ERROR: Runtime error

21:45:12.240 module 'plugin_vibrator' not found:

21:45:12.240 no field package.preload['plugin_vibrator']

21:45:12.240 no file 'C:\Users\Raul\AppData\Roaming\Corona Labs\Corona Simulator\Plugins\plugin_vibrator.lua'

21:45:12.240 no file 'C:\Users\Raul\Documents\Corona Projects\Cells-mania\plugin_vibrator.lua'

21:45:12.240 no file 'C:\Program Files (x86)\Corona Labs\Corona SDK\Resources\plugin_vibrator.lua'

21:45:12.240 no file '.\plugin_vibrator.lua'

21:45:12.240 no file 'C:\Program Files (x86)\Corona Labs\Corona SDK\lua\plugin_vibrator.lua'

21:45:12.240 no file 'C:\Program Files (x86)\Corona Labs\Corona SDK\lua\plugin_vibrator\init.lua'

21:45:12.240 no file 'C:\Program Files (x86)\Corona Labs\Corona SDK\plugin_vibrator.lua'

21:45:12.240 no file 'C:\Program Files (x86)\Corona Labs\Corona SDK\plugin_vibrator\init.lua'

21:45:12.240 no file 'C:\Users\Raul\AppData\Roaming\Corona Labs\Corona Simulator\Plugins\plugin_vibrator.dll'

21:45:12.240 no file '.\plugin_vibrator.dll'

21:45:12.240 no file 'C:\Program Files (x86)\Corona Labs\Corona SDK\Resources\plugin_vibrator.dll'

21:45:12.240 no file '.\plugin_vibrator.dll'

21:45:12.240 no file 'C:\Program Files (x86)\Corona Labs\Corona SDK\plugin_vibrator.dll'

21:45:12.240 no file 'C:\Program Files (x86)\Corona Labs\Corona SDK\loadall.dll'

21:45:12.240 no file 'C:\Users\Raul\AppData\Roaming\Corona Labs\Corona Simulator\Plugins\plugin_vibrator.dll'

21:45:12.240 no file '.\plugin_vibrator.dll'

21:45:12.240 no file 'C:\Program Files (x86)\Corona Labs\Corona SDK\Resources\plugin_vibrator.dll'

21:45:12.240 no file '.\plugin_vibrator.dll'

21:45:12.240 no file 'C:\Program Files (x86)\Corona Labs\Corona SDK\plugin_vibrator.dll'

21:45:12.240 no file 'C:\Program Files (x86)\Corona Labs\Corona SDK\loadall.dll'

21:45:12.240 stack traceback:

21:45:12.240 [C]: in function 'error'

21:45:12.240 ?: in function 'gotoScene'

21:45:12.240 C:\Users\Raul\Documents\Corona Projects\Cells-mania\main.lua:25: in main chunk

 

With previous version of Corona Simulator, when I run the app, the plugin is downloaded in folder: 'C:\Users\Raul\AppData\Roaming\Corona Labs\Corona Simulator\Plugins\.

Now only the plugin coronaads and fuse are downloaded.

 

If I insert into this folder the plugin (saved before install new Corona version) I obtain another error message:

 

 

21:52:34.913

21:52:34.913 Copyright © 2009-2016 C o r o n a L a b s I n c .

21:52:34.913 Version: 3.0.0

21:52:34.913 Build: 2016.2830

21:52:34.913 Platform: GT-I9300 / x64 / 6.3 / Intel® HD Graphics 4600 / 4.2.0 - Build 10.18.10.3540 / 2016.2830 / it_IT | IT | it_IT | it

21:52:34.913 Loading project from: C:\Users\Raul\Documents\Corona Projects\Cells-mania

21:52:34.913 Project sandbox folder: C:\Users\Raul\AppData\Local\Corona Labs\Corona Simulator\Sandbox\cells-mania-DBD20F576FEECC7F5D6B0B4309372EC2\Documents

21:52:51.339 WARNING: The 'plugin.vibrator' library is not available on this platform.

21:52:51.339 WARNING: The 'plugin.vibrator' library is not available on this platform.

21:52:51.339 WARNING: The 'plugin.vibrator' library is not available on this platform.

21:52:51.355 WARNING: The 'plugin.vibrator' library is not available on this platform.

21:52:51.355 WARNING: The 'plugin.vibrator' library is not available on this Platform.

 

In Windows 8.1 the vibrator function: hasVibrator() return false (don't work) but with previous version of Corona, when I build the apk for Android the plugin is correctly insert into apk file and the app installed on smartphone works correctly.

 

Now, with new Corona version also on smartphone the app don't start. I obtain en error message similar the first one.

 

How I can solve this issue?

Thanks

Ben



[TOPIC: post.html]
#7

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,133 posts
  • Corona SDK

What files are  located in C:\Users\Raul\AppData\Roaming\Corona Labs\Corona Simulator\Plugins\?

 

Rob



[TOPIC: post.html]
#8

ben.betty

[GLOBAL: userInfoPane.html]
ben.betty
  • Observer

  • 10 posts
  • Corona SDK

In folder there are the followings files:

catalog.json

plugin.coronaAds.zip

plugin.fuse.zip

plugin_coronaads.lua

plugin_fuse.lua

 

The catalog.json contains:

{"com.coronalabs/plugin.coronaAds":{"submitDate":1461645688,"md5":"b44e671ad8ff1dcbe8c40208ce244259","publishDate":1461645688,"url":"http://plugins.coronasphere.com/com.coronalabs/plugin.coronaAds/2016.2828/win32-sim/plugin.coronaAds.zip","filename":"plugin.coronaAds.zip","size":479},"Version":2,"com.coronalabs/plugin.google.play.services":"","com.coronalabs/plugin.fuse":{"submitDate":1456515846,"md5":"d81f7887587ae2e5a9a32496f7331f0d","publishDate":1456515846,"url":"http://plugins.coronasphere.com/com.coronalabs/plugin.fuse/2016.2828/win32-sim/plugin.fuse.zip","filename":"plugin.fuse.zip","size":470},"CoronaBuild":"2016.2830"}

 

Ben



[TOPIC: post.html]
#9

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,133 posts
  • Corona SDK

Can you post your whole build.settings file? Please use the blue <> in the edit bar to help keep your code formatted.

 

Rob



[TOPIC: post.html]
#10

ben.betty

[GLOBAL: userInfoPane.html]
ben.betty
  • Observer

  • 10 posts
  • Corona SDK

The build.settings file:

-- Supported values for orientation:
-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight

settings = {
	orientation = {
		default = "portrait",
		supported = { "portrait", 'portraitUpsideDown' }
		},
-- Android permissions
	android = {
		versionCode = "10",
		usesPermissions = {
            "android.permission.VIBRATE",
			"android.permission.WRITE_EXTERNAL_STORAGE",
			},
		usesPermissions = {
            "android.permission.INTERNET",
            "android.permission.ACCESS_COARSE_LOCATION",
            "android.permission.ACCESS_FINE_LOCATION",
            "android.permission.ACCESS_NETWORK_STATE",
            "com.google.android.providers.gsf.permissions.READ_GSERVICES"
			},
		},
-- Screen supported
    android = {
        supportsScreens = {
            smallScreens  = true,
            normalScreens = true,
            largeScreens  = true,
            xlargeScreens = false,
			},
		},
-- Minimum Android version	(10 = 2.3.3)
    android = {
 		minSdkVersion = "10",
		},
-- Plugins
	plugins = {  
		['plugin.vibrator'] = {publisherId = 'com.spiralcodestudio'}
	},
	plugins = {
        ["plugin.coronaAds"] =
        {
            publisherId = "com.coronalabs",
            supportedPlatforms = { iphone=true, android=true }
        },
        ["plugin.google.play.services"] =
        {
            publisherId = "com.coronalabs",
            supportedPlatforms = { android=true }
        },
    },
}

Ben



[TOPIC: post.html]
#11

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,133 posts
  • Corona SDK

You have to plugin tables in there. The second one overwrites the first one. Try changing it to:

-- Plugins
	plugins = 
        {
            ['plugin.vibrator'] = 
            {
                publisherId = 'com.spiralcodestudio'
            },
            ["plugin.coronaAds"] =
            {
                publisherId = "com.coronalabs",
                supportedPlatforms = { iphone=true, android=true }
            },
            ["plugin.google.play.services"] =
            {
                publisherId = "com.coronalabs",
                supportedPlatforms = { android=true }
            },
        },


[TOPIC: post.html]
#12

ben.betty

[GLOBAL: userInfoPane.html]
ben.betty
  • Observer

  • 10 posts
  • Corona SDK

Great, now works, when the app run on Simulator the vibrator plugin is downloaded.

The apk file is correctly created.

Thanks for your help!!!!!!

In simulator console, I have, now the following error:

WARNING: The 'plugin.coronaads' library is not available on this Platform.

 

when is executed the command line:

 

coronaAds.init( "dec4b41c-...-my correct-apikey", adListener )

 

It is normal?

The coronaAds plugin works in Simulator in Windows 8.1?

 

Ben



[TOPIC: post.html]
#13

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,133 posts
  • Corona SDK

Most plugins do not work in the simulator since we don't have SDK's for OS X and Windows from most providers, so we issue a message letting you know that you need to test on device for those things to work.

 

Rob



[TOPIC: post.html]
#14

ben.betty

[GLOBAL: userInfoPane.html]
ben.betty
  • Observer

  • 10 posts
  • Corona SDK

OK thank you again for your invaluable help, I hope not to disturb more.

 

Ben



[TOPIC: post.html]
#15

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,133 posts
  • Corona SDK

That's what we are here for!



[TOPIC: post.html]
#16

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 532 posts
  • Corona Staff

The plugin now supports Apple's Taptic Engine! You can use the same API as on Android or gain the direct access to the Taptic Engine using vibrator.newHaptic().

See the docs and updated sample app.



[TOPIC: post.html]
#17

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 484 posts
  • Corona SDK

The plugin now supports Apple's Taptic Engine! You can use the same API as on Android or gain the direct access to the Taptic Engine using vibrator.newHaptic().

See the docs and updated sample app.

 

That's great! Until now I've no used this plugin for iOS.

 

But how do I recognize the iPhone 7 versions? Currently I'm using lines like this:

local on_iPhone5     = ( string.find( system.getInfo("architectureInfo"), "iPhone5" ) ~= nil )
local on_iPhone5s    = ( string.find( system.getInfo("architectureInfo"), "iPhone6" ) ~= nil )
local on_iPhone6     = ( string.find( system.getInfo("architectureInfo"), "iPhone7,2" ) ~= nil )

Do you know what the strings are for iPhone 7 / Plus?

 

In fact do you know of a place where all the iOS devices are listed? 



[TOPIC: post.html]
#18

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 532 posts
  • Corona Staff

runewinse, you can find architectureInfo for example here
https://www.theiphonewiki.com/wiki/Models

 

iPhone 7 / Plus would correspond to values from iPhone9,1 to iPhone9,4.



[TOPIC: post.html]
#19

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 484 posts
  • Corona SDK

ok, thanks!



[TOPIC: post.html]
#20

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 484 posts
  • Corona SDK

Unfortunately I have some problems using the latest vibrator plugin. Or I think it is the vibrator plugin. The texttospeech plugins seems to be lurking cose to the error also. 

 

When trying to build the app on a mac I get a:

 

BUILD ERROR: There was a problem linking the app.
                    

Examining the console window I see these lines:


duplicate symbol _OBJC_METACLASS_$_Utils in:
                        /Users/Air/Google Drive/PROGRAMMING/CORONA/Karate Squid/iOS/Karate Squid.app/.build/plugin.texttospeech/libplugin_texttospeech.a(Utils.o)
                        /Users/Air/Google Drive/PROGRAMMING/CORONA/Karate Squid/iOS/Karate Squid.app/.build/plugin.vibrator/libplugin_vibrator.a(Utils.o)
                    ld: 15 duplicate symbols for architecture armv7
                    clang: error: linker command failed with exit code 1 (use -v to see invocation)</result>
okt. 26 11:25:23.168 ERROR: Builder failed: clang: warning: libstdc++ is deprecated; move to libc++
okt. 26 11:25:23.168 duplicate symbol _OBJC_IVAR_$_Scheme._LuaTypeByteArray in:
                        /Users/Air/Google Drive/PROGRAMMING/CORONA/Karate Squid/iOS/Karate Squid.app/.build/plugin.texttospeech/libplugin_texttospeech.a(LuaUtils.o)
                        /Users/Air/Google Drive/PROGRAMMING/CORONA/Karate Squid/iOS/Karate Squid.app/.build/plugin.vibrator/libplugin_vibrator.a(LuaUtils.o)


Not sure what to make out of this, though...



[TOPIC: post.html]
#21

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 484 posts
  • Corona SDK

It's clearly the vibrator plugin and not the texttospeech plugin.

 

I removed the vibrator plugin from the app ->NO SUCCESS

I removed the vibrator plugin from build settings ->SUCCESS

 
I have tried both this:
  plugins =
  {
     ["plugin.vibrator"] = { publisherId = "com.spiralcodestudio", supportedPlatforms = { iphone=false, android=true } },
  },

And this:

  plugins =
  {
     ["plugin.vibrator"] = { publisherId = "com.spiralcodestudio", supportedPlatforms = { iphone=true, android=true } },
  },

Both fails. I have to remove the line completely for the app to build.



[TOPIC: post.html]
#22

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 484 posts
  • Corona SDK

This fails as well:

  plugins =
  {
    ["plugin.vibrator"]     = { publisherId = "com.spiralcodestudio" },
  },

Corona Simulator 2016.2980, freshly deauthorized/reautorized.



[TOPIC: post.html]
#23

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 532 posts
  • Corona Staff

Thanks, for reporting. I am looking into that since yesterday. The problem is that I use same utility files in many plugins, which collide with each other when app is built using several of them. It should be easy to fix, just need to find the right solution.



[TOPIC: post.html]
#24

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 484 posts
  • Corona SDK

Ok, thanks!

[TOPIC: post.html]
#25

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 532 posts
  • Corona Staff

Try now.




[topic_controls]
Page 1 of 2 1 2
 
[/topic_controls]

Also tagged with one or more of these keywords: release, android, ios