Skip to content

Commit

Permalink
Added relevant code in the java file for GamerInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
joonjoonjoon committed Jan 30, 2014
1 parent b71e9a5 commit af4795b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/java/com/jarnik/iaptest/OUYA_IAP.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,31 @@ public static void init(final HaxeObject callback, OuyaFacade ouyaFacade, String
Log.e("IAP", "Unable to create encryption key", e);
}
}
// ======================================== GAMER INFO ======================================
public static void requestGamerInfo()
{
mOuyaFacade.requestGamerInfo(new GamerInfoLister());
}

public static class GamerInfoLister implements OuyaResponseListener<GamerInfo>
{
@Override
public void onSuccess(GamerInfo gamerInfoResponse) {
mCallback.call("onGamerInfoReceived", new Object[] { gamerInfoResponse.getUsername() } );
}

@Override
public void onFailure(int errorCode, String errorMessage, Bundle optionalData) {
mCallback.call("onGamerInfoFailed", new Object[] { errorCode+": "+errorMessage } );
}

@Override
public void onCancel() {
mCallback.call("onGamerInfoCanceled", new Object[] {} );
}
}


// ======================================= PRODUCT LIST =====================================================

public static void requestProductList(String[] products)
Expand Down

0 comments on commit af4795b

Please sign in to comment.