Fixed a google play connection crash
This commit is contained in:
parent
4832ccd5ee
commit
d45a49f809
4 changed files with 10 additions and 7 deletions
|
@ -111,13 +111,16 @@ namespace Android {
|
|||
this.activity.StartActivity(new Intent(Intent.ActionView, Uri.Parse("https://play.google.com/store/apps/details?id=de.ellpeck.touchytickets")));
|
||||
}
|
||||
|
||||
public override void GainAchievement(Achievement achievement) {
|
||||
if (this.GoogleApi != null)
|
||||
public override bool GainAchievement(Achievement achievement) {
|
||||
if (this.GoogleApi != null && this.GoogleApi.IsConnected) {
|
||||
GamesClass.Achievements.Unlock(this.GoogleApi, AchievementIds[achievement.Name]);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void ShowAchievements() {
|
||||
if (this.GoogleApi == null)
|
||||
if (this.GoogleApi == null || !this.GoogleApi.IsConnected)
|
||||
return;
|
||||
var intent = GamesClass.Achievements.GetAchievementsIntent(this.GoogleApi);
|
||||
this.activity.StartActivityForResult(intent, ShowAchievementsRequest);
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace TouchyTickets {
|
|||
return;
|
||||
if (!this.condition.Invoke(GameImpl.Instance))
|
||||
return;
|
||||
GameImpl.Instance.Platform.GainAchievement(this);
|
||||
if (GameImpl.Instance.Platform.GainAchievement(this))
|
||||
this.unlocked = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace TouchyTickets {
|
|||
|
||||
public abstract void OpenRateLink();
|
||||
|
||||
public abstract void GainAchievement(Achievement achievement);
|
||||
public abstract bool GainAchievement(Achievement achievement);
|
||||
|
||||
public abstract void ShowAchievements();
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace iOS {
|
|||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public override void GainAchievement(Achievement achievement) {
|
||||
public override bool GainAchievement(Achievement achievement) {
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue