SetListener question

Is it possible to change an achievement listener during execution of the app?

I tried to do a [lua]achievements.setListener(newListener)[/lua] and the old listener was still called.  I didn’t spend too much time checking into this, since I wanted to be sure it is first possible.

thanks!

After playing around a bit, I noticed that for some reason, setting a new listener just doesn’t work for me.  The old listener is called.

But, I created a new var and set a listener and I can call that one.

[lua]

local achievements_2 = cloud.achievements

achievements_2.setListener(anotherListener)

[/lua]

This seems to allow me to call a second listener (local listener, not my global achievements listener).

Reason?  I have an achievements page in storyboard that lists all achievements and I populate the event.response into a list.  I need to know when the call has finished returning results before populating the list.

So… question for the cloud team.  Is this the preferred method, or is there another way to allow using a second listener inside a storyboard scene when needed?

In looking at the cloud.lua file, it should work as you expect it to.  Make sure something else isn’t setting it back.

Thanks Rob, I am a bit confused why it wasn’t working for me here, and I also looked at the cloud.lua code and could not find a reason. As my previous message stated, I did find a solution, but I do want to go back to this at some point in the future to figure out exactly why.

After playing around a bit, I noticed that for some reason, setting a new listener just doesn’t work for me.  The old listener is called.

But, I created a new var and set a listener and I can call that one.

[lua]

local achievements_2 = cloud.achievements

achievements_2.setListener(anotherListener)

[/lua]

This seems to allow me to call a second listener (local listener, not my global achievements listener).

Reason?  I have an achievements page in storyboard that lists all achievements and I populate the event.response into a list.  I need to know when the call has finished returning results before populating the list.

So… question for the cloud team.  Is this the preferred method, or is there another way to allow using a second listener inside a storyboard scene when needed?

In looking at the cloud.lua file, it should work as you expect it to.  Make sure something else isn’t setting it back.

Thanks Rob, I am a bit confused why it wasn’t working for me here, and I also looked at the cloud.lua code and could not find a reason. As my previous message stated, I did find a solution, but I do want to go back to this at some point in the future to figure out exactly why.