I had a trial enterprise account. In my project I used Notification plugin. It worked fine until I paid the account. Now “notification” event is not work.
I try to use sample code (plugins-source-notifications) but result is same.
Lua code is:
local notifications = require("plugin.notifications") local launchArgs = ... local json = require("json") print("launchArgs: ", json.encode(launchArgs)) local function listener(event) print("notification: ", json.encode(event)) end Runtime:addEventListener("notification", listener) local asdf = display.newCircle( 100, 100, 100 ) local function l(event) notifications.registerForPushNotifications() end asdf:addEventListener( "tap", l )
I tap on circle then I see alert, but print("notification: ", json.encode(event)) is not happens.
I know before Corona SDK went free, the Enterprise trial did not include the ability to use our plugins. I don’t know if that would be the reason or not but that seems to make sense given that you were able to build while in the trial. The other reason would not be having the plugin’s .a file in the project to build with.
Can you put some print statements in your code to make sure your tap handler is getting called?
local function l(event) print("tap"); notifications.registerForPushNotifications() end asdf:addEventListener( "tap", l )
“tap” is printed but Notifications are not working.
I noticed that in my xcode project in the Linked Frameworks and Libraries libnotificarions.a is highlighted in red. I removed them and tried to add it again, but it is not listed. I downloaded new copy of plugin but result the same.
You’re kind of getting over my expertise level with this. Engineering will need to see your project so the best thing to do is to make a simple project that is focused on the problem at hand. CTRL-Click on the folder and choose Compress this will produce a .zip file. Use the “Report a Bug” link at the top of the page. Provide clear language as to what the problem is and what the desired result it. Also make sure the project you submit is one they can double click on the project file and hit run and see the problem Include all necessary resources including config.lua.
When you file the bug report you will get an email with a Case ID # in it. Please post that number back here for reference. When I have that number, I’ll ask the engineers to look at it.
Can we see your actual, working Lua code? You say you have it working, but the code you posted appears to be from the Enterprise sample. The sample in the repo is for testing the repo, not for production use. The code in the guide is a better representation of what should be happening on the Lua side.
I resolved problem with libplayer.a library. You need remove this from Linked Frameworks and Libraries and add again from Applications/CoronaEnterprise/Corona/ios/lib/
It should work in AdHoc mode. Personally I’ve never had much luck using the sandbox test platform. I just use the production servers, it’s not like you’re going to generate a ton of test messages or annoy users… at least not until you go live.
So, I downloaded the documentation and found something. The documentation I have downloaded contains one key point — build.settings file should contain:
[lua]settings =
{
iphone =
{
plist =
{
CoronaDelegates = { “CoronaNotificationsDelegate” }
},
},
} [/lua]
I added these lines and Notifications event has earned for iOS. For Android Notifications event still does not working.
Why is it?
However, the latest version of the Corona Enterprise does not build iOS application with architecture arm64. On the advice of nappa I downloaded version 2015.2617 and building successful.
I know before Corona SDK went free, the Enterprise trial did not include the ability to use our plugins. I don’t know if that would be the reason or not but that seems to make sense given that you were able to build while in the trial. The other reason would not be having the plugin’s .a file in the project to build with.
Can you put some print statements in your code to make sure your tap handler is getting called?
local function l(event) print("tap"); notifications.registerForPushNotifications() end asdf:addEventListener( "tap", l )
“tap” is printed but Notifications are not working.
I noticed that in my xcode project in the Linked Frameworks and Libraries libnotificarions.a is highlighted in red. I removed them and tried to add it again, but it is not listed. I downloaded new copy of plugin but result the same.