leecrossley / cordova-plugin-game-center

Cordova / PhoneGap Game Center Plugin for Apache Cordova >= 3.0.0
http://ilee.co.uk
78 stars 29 forks source link

gamecenter.getAchievements #7

Closed mrnebbi closed 10 years ago

mrnebbi commented 10 years ago

I've been trying to use the getAchievements function, but not having any luck. I've stripped back to just trying to get a success or error call, but still no joy.

gamecenter.getAchievements(function(){ navigator.notification.alert("gc success"); }, function(){ navigator.notification.alert("gc fail"); });

Also I've noticed that the readme lists the getAchievements function as reportAchievement.

Also tried applying this fix (https://github.com/leecrossley/cordova-plugin-game-center/commit/39641d67ad0338e7098c3718ca199bdd45ec783d), but it doesn't seem to have patched the problem.

Love the plugin, and hope you can find a fix. If I can get anything working myself, I'll submit.

Thanks

leecrossley commented 10 years ago

I'll look into this - it will be a couple of days before I get the chance to set it up properly (and in iTunes connect), unless @clockwisemusic knows what's wrong?

rocklan commented 10 years ago

Actually I do. Sorry about this, fixed in my copy of the code but not submitted to github. The issue is that sendPluginResult() call is in the wrong spot - it needs to be inside the loadAchievementsWithCompletionHandler() function. I'll submit a fix if I can work out how to do it :)

leecrossley commented 10 years ago

Thanks @clockwisemusic :) I've made the fix.

@ianisted - let us know if you still have problems and I'll reopen

rocklan commented 10 years ago

Line 218 still looks like it's a problem though, don't you need to use achievement.identifier instead of @"achievement.identifier" ?

leecrossley commented 10 years ago

Apologies, I reverted my previous fix as that was in the original PR, does this look right now 9f5df5a9a8d06b4a68c59c5389c26627047ba27f ?

rocklan commented 10 years ago

Yep, looks good, good job.

leecrossley commented 10 years ago

Thanks for your help, I'll give this whole plugin a through test soon - I also plan to update it to remove the build warnings for iOS6 compatibility too, there are a number of deprecation messages now!

mrnebbi commented 10 years ago

Thanks, I'll try to test it tonight and let you know.

On 29 Apr 2014, at 12:08, Lee Crossley notifications@github.com wrote:

Thanks for your help, I'll give this whole plugin a through test soon - I also plan to update it to remove the build warnings for iOS6 compatibility too, there are a number of deprecation messages now!

— Reply to this email directly or view it on GitHub.