Notification plugin ios problem

Hello,
 
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.

Any ideas?

Are you doing an SDK build or an Enterprise build?

Hello Rob,

If I doing an Enterprise build Notifications are not working. But if I doing SDK build Notifications works fine.

What could be wrong?

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?

Rob

I add print to my l function:

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.

Can be a problem in xcode?

I added next code to delegate file in xcode:
 

- (void)application:(UIApplication \*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData\*)deviceToken { NSLog(@"My token is: %@", deviceToken); }

 
When I tap on circle in console I see
 

My token is: \<fdc49bc4 0f5cc67b ...\>

It means that device is got token. However, onNotification event in Runtime:addEventListener(‘notification’, onNotification) doesn’t work.

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.

Thanks

Rob

Case 40448

Thanks

Anton

Engineering is wanting to know a bit more about your app and the things you’ve tried.  They want a fuller picture of whats going on.

What are you using for an push provider?  Are you using something like PushWoosh?  Have you set the Lua side up like listed in our guide:  http://docs.coronalabs.com/guide/events/appNotification/index.html ??

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.

Rob

Maybe Notification event doesn’t work because I use it in development mode? Maybe should use it in Ad Hoc mode?

Now I try to build my app & I get next error in xcode: Lipo error: can’t open input file: …

Also I have error:

... /Users/komkov/Documents/Applications/myApp/ios/CoronaEnterprise/Corona/ios/lib/libplayer.a(Rtt\_CameraPaint.o) ld: 210 duplicate symbols for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

If I remove libnotifications.a library from my project build is successful.

Any ideas?

I have the same problem…

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/

But Notifications event doesn’t work in Ad Hoc mode too.

Any ideas?

Thanks, Anton. I did that as you said, the “duplicate symbols” error no longer occur.

and this problem has occured in v2015.2618 or later. I don’t have any other choice so I’m using v2015.2617 :frowning:

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.

Rob

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.

Are you doing an SDK build or an Enterprise build?

Hello Rob,

If I doing an Enterprise build Notifications are not working. But if I doing SDK build Notifications works fine.

What could be wrong?

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?

Rob

I add print to my l function:

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.

Can be a problem in xcode?