Search Unity

IOS Achievements not unlocking

Discussion in 'iOS and tvOS' started by Hipno, Jul 15, 2015.

  1. Hipno

    Hipno

    Joined:
    Apr 1, 2013
    Posts:
    2
    Hello,
    I have a problem unlocking achievements on IOS with "Social" class.
    I try to use Social.ReportProgress but nothing happens (opposed to Android - which there everything work fine).
    The same for incremental and normal achievements.

    I looked at similar threads and used the GKAchievementReporter. It seems it fixed the problem for everybody, but not for me.
    The problem happens in sandbox and production as well.
    I know that connection to Game Center is established as leaderboard is working fine.

    this is the code:
    Code (CSharp):
    1. //                        Social.ReportProgress (achievement100LessInTheAir, (enemyPlanesDestroyed / 100D) * 100D, null);
    2. //                        Social.ReportProgress (achievement500LessInTheAir, (enemyPlanesDestroyed / 500D) * 100D, null);
    3. //                        Social.ReportProgress (achievementClearSky, (enemyPlanesDestroyed / 2000D) * 100D, null);
    4.  
    5.                         GKAchievementReporter.ReportAchievement (achievement100LessInTheAir, ((float)enemyPlanesDestroyed / 100f) * 100f, true);
    6.                         GKAchievementReporter.ReportAchievement (achievement500LessInTheAir, ((float)enemyPlanesDestroyed / 500f) * 100f, true);
    7.                         GKAchievementReporter.ReportAchievement (achievementClearSky, ((float)enemyPlanesDestroyed / 2000f) * 100f, true);
    8. //                      
    9. #endif
    10. //                        Social.ReportProgress (achievementSurvivor, (PlayerPrefs.GetFloat ("BestTime", 0) >= 120) ? 100d : 0, null);
    11. //                        Social.ReportProgress (achievementTheUltimateSurvivor, (PlayerPrefs.GetFloat ("BestTime", 0) >= 300) ? 100d : 0, null);
    12. //                        Social.ReportProgress (achievementWelcomeBackCannoneer, (PlayerPrefs.GetInt ("LevelReached", 1) > 1) ? 100d : 0, null);
    13. //                        Social.ReportProgress (achievementFireBreath, (PlayerPrefs.GetInt ("RedDragon", 0) == 1) ? 100d : 0, null);
    14.  
    15.                         GKAchievementReporter.ReportAchievement (achievementSurvivor, (PlayerPrefs.GetFloat ("BestTime", 0) >= 120) ? 100f : 0, true);
    16.                         GKAchievementReporter.ReportAchievement (achievementTheUltimateSurvivor, (PlayerPrefs.GetFloat ("BestTime", 0) >= 300) ? 100f : 0, true);
    17.                         GKAchievementReporter.ReportAchievement (achievementWelcomeBackCannoneer, (PlayerPrefs.GetInt ("LevelReached", 1) > 1) ? 100.0 : 0, true);
    18.                         GKAchievementReporter.ReportAchievement (achievementFireBreath, (PlayerPrefs.GetInt ("RedDragon", 0) == 1) ? 100f : 0, true);
    19.  
    20.  
    21.                         int threeStars = StoreManager.Instance.SumLevelThreeStars ();
    22.  
    23. //                        Social.ReportProgress (achievementAhui1, threeStars >= 10 ? 100d : 0, null);
    24. //                        Social.ReportProgress (achievementAhui2, threeStars >= 20 ? 100d : 0, null);
    25. //                        Social.ReportProgress (achievementAhui3, threeStars >= 30 ? 100d : 0, null);
    26.  
    27.                         GKAchievementReporter.ReportAchievement (achievementAhui1, threeStars >= 10 ? 100f : 0, true);
    28.                         GKAchievementReporter.ReportAchievement (achievementAhui2, threeStars >= 20 ? 100f : 0, true);
    29.                         GKAchievementReporter.ReportAchievement (achievementAhui3, threeStars >= 30 ? 100f : 0, true);
    Hope someone can shed some light what am i doing wrong.

    Thank you,
    Lior.
     
  2. Hipno

    Hipno

    Joined:
    Apr 1, 2013
    Posts:
    2
    Someone? Still no luck with this.
     
  3. timmy2702

    timmy2702

    Joined:
    Mar 14, 2015
    Posts:
    3