Hello,
I am running into an odd situation. In my app, one of the first things attempted in main.lua is registration with GameThrive, so that push notifications get set up correctly. However, on Android devices, the executing code cannot even find GameThrive.init().
This functionality works for all iOS devices. I have definitely had GameThrive working in the past, bt I have focused heavily on iOS the past several months. Anyway, this functionality is failing for my Android device. When I comment out all GameThrive code, the app runs normally on the Android device.
Here is the attempted code (identifiers changed, of course):
local GameThrive = require "plugin.GameThrivePushNotifications" --line 4 of main.lua --lots of code in between GameThrive.Init("xxxxx-xxxxx-xxxxx-xxxxx-xxxxx", "xxxxx", DidReceiveRemoteNotification) --line 282 of main.lua
On my Android device, I receive the following error message:
I/Corona (12381): Runtime error
I/Corona (12381): C:\xxx\xxx\xxx\src\main.lua:282: attempt to call field ‘Init’ (a nil value)
I tried to attach my build.settings to this post in case that is helpful to look at, but it wouldn’t permit me to upload that kind of file. So I have pasted mine below (identifiers removed). Has anyone else seen this issue? Does anyone have any good insight on what may be causing this or how it might be resolved?
settings = { orientation = { default = landscapeRight, supported = { "landscapeLeft", "landscapeRight" }, }, iphone = { plist= { UIBackgroundModes = {"remote-notification"}, UIStatusBarHidden=true, UIApplicationExitsOnSuspend=false, UIInterfaceOrientation = "UIInterfaceOrientationLandscapeRight", UISupportedInterfaceOrientations = { "UIInterfaceOrientationLandscapeLeft","UIInterfaceOrientationLandscapeRight" }, FacebookAppID = "xxxxx", CFBundleShortVersionString = "1.0", CFBundleURLTypes = { { CFBundleURLSchemes = { "xxxxx", } } }, CFBundleIconFiles = { "Icon-60.png","Icon-60@2x.png","Icon-76.png","Icon-76@2x.png","Icon-Small-40.png","Icon-Small-40@2x.png","Icon.png","Icon@2x.png","Icon-72.png","Icon-72@2x.png","Icon-Small-50.png","Icon-Small-50@2x.png","Icon-Small.png","Icon-Small@2x.png" }, --launch image files table UILaunchImages = { { -- iPhone 4 Portrait ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{320, 480}" }, { -- iPhone 4 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{320, 480}" }, { -- iPhone 4 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{320, 480}" }, { -- iPhone 5 Portrait ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{320, 568}" }, { -- iPhone 5 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{320, 568}" }, { -- iPhone 5 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{320, 568}" }, { -- iPad Portrait ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Portrait", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{768, 1024}" }, { -- iPad LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Landscape", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{768, 1024}" }, { -- iPad LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Landscape", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{768, 1024}" }, { -- iPhone 6 Portrait ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{375, 667}" }, { -- iPhone 6 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{375, 667}" }, { -- iPhone 6 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{375, 667}" }, { -- iPhone 6 Plus Portrait ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-736h", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{414, 736}" }, { -- iPhone 6 Plus LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-Landscape-736h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{414, 736}" }, { -- iPhone 6 Plus LandscapeRight ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-Landscape-736h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{414, 736}" }, }, UIAppFonts = { "Erbos Draco 1st Open NBP.ttf", }, }, }, android = { permissions = { { name = ".permission.C2D\_MESSAGE", protectionLevel = "signature" }, }, usesPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.GET\_ACCOUNTS", "android.permission.RECEIVE\_BOOT\_COMPLETED", "com.google.android.c2dm.permission.RECEIVE", ".permission.C2D\_MESSAGE", }, }, plugins = { -- key is the name passed to Lua's 'require()' ["plugin.GameThrivePushNotifications"] = { -- required publisherId = "com.gamethrive", }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true, }, }, ["facebook"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, }, }, }
Thanks!