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 plugin and AngularJS + Ionic #29

Closed mariohmol closed 9 years ago

mariohmol commented 9 years ago

Hy there,

could not make it work on AngularJS and Ionic.

I'm always getting this message:

Installed using cordova plugin add, and included the call on read for ionic

app.run(function($rootScope, $ionicLoading,$ionicPopup,$ionicPlatform) {
    var failureLoginCallback = function (user) {
        console.log("ERRROOOO failureCallback");
        console.log(user);
    };

    var successLoginCallback = function (user) {
        console.log("SUCESSO LOGIN");
        alert(user.alias);
        // user.alias, user.playerID, user.displayName
    };

    $ionicPlatform.ready(function() {

        gamecenter.auth(successLoginCallback, failureLoginCallback);

    });

Any ideas?

leecrossley commented 9 years ago

I've just run this code and it works with a fresh install. It sounds like the plugin is not installed properly (perhaps try it again).

If you can create a demo project that reproduces this issue I will reopen. Thanks.

mariohmol commented 9 years ago

I had to copy GameCenter.m and GameCenter.h manually to plugins/uk.co.ilee.gamecenter/src/ios/, cause add and remove plugin were not doing.

leecrossley commented 9 years ago

Perhaps you had filesystem permissions issues or an issue with your setup. Glad it's at least working.