public void ShowLeaderBoardAtIndex(int leaderboardIndex) { if (NPBinding.GameServices.LocalUser.IsAuthenticated) { NPBinding.GameServices.ShowLeaderboardUIWithID(NPSettings.GameServicesSettings.LeaderboardMetadataCollection [leaderboardIndex].GetCurrentPlatformID(), eLeaderboardTimeScope.ALL_TIME, null); } else { NPBinding.GameServices.LocalUser.Authenticate((bool _success, string _error) => { if (_success) { Debug.Log("Sign-In Successfully"); Debug.Log("Local User Details : " + NPBinding.GameServices.LocalUser.ToString()); AndroidDebug.debug("Sign-In Successfully = Local User Details : " + NPBinding.GameServices.LocalUser.ToString()); isGameCenterLocalUserAuthenticated = true; LoadAchievements(); NPBinding.GameServices.ShowLeaderboardUIWithID(sLeaderboardID [leaderboardIndex], eLeaderboardTimeScope.ALL_TIME, null); } else { AndroidDebug.debug("Sign-In Failed with error " + _error); Debug.Log("Sign-In Failed with error " + _error); } }); } }
private void OnDidFinishProductPurchase(BillingTransaction _transaction) { if (_transaction.TransactionState == eBillingTransactionState.PURCHASED) { AndroidDebug.debug("OnDidFinishProductPurchase - Purchased - " + _transaction.ProductIdentifier); CallDelegateForPurchasedProductIdentifier(_transaction.ProductIdentifier, PURCHASED); } else if (_transaction.TransactionState == eBillingTransactionState.FAILED) { AndroidDebug.debug("OnDidFinishProductPurchase - FAILED - " + _transaction.ProductIdentifier); ShowAlertview("Sorry!!!", "Something wrong."); } }
// CallBack private void AuthenticateCompletion(bool _success, string _error) { if (_success) { isGameCenterLocalUserAuthenticated = true; LoadAchievements(); Debug.Log("Sign-In Successfully"); Debug.Log("Local User Details : " + NPBinding.GameServices.LocalUser.ToString()); AndroidDebug.debug("Sign-In Successfully"); } else { Debug.Log("Sign-In Failed with error " + _error); AndroidDebug.debug("Sign-In Failed with error " + _error); } }
private void OnDidFinishRestoringPurchases(BillingTransaction[] _transactions, string _error) { if (_error == null) { foreach (BillingTransaction _eachTransaction in _transactions) { AndroidDebug.debug("OnDidFinishRestoringPurchases - Purchased - " + _eachTransaction.ProductIdentifier); CallDelegateForPurchasedProductIdentifier(_eachTransaction.ProductIdentifier, RESTORED); } ShowAlertview("Congratulations!", "You have suceessfully Restored"); } else { AndroidDebug.debug("OnDidFinishRestoringPurchases - Purchased - " + _transactions [0].ProductIdentifier); ShowAlertview("Sorry!!!", _error); } }
public void OpenRateUsURL() { AndroidDebug.debug("IP OpenRateUsURL"); NPBinding.Utility.OpenStoreLink(NPSettings.Application.StoreIdentifier); }
private void BuyItemFromStore(BillingProduct _product) { AndroidDebug.debug("BuyItemFromStore -" + _product.ProductIdentifier); NPBinding.Billing.BuyProduct(_product); }