From 5c07d59ea4564d7a590959db852e79c0442e6512 Mon Sep 17 00:00:00 2001 From: Andrea Busi Date: Sat, 25 Jul 2020 10:35:52 +0200 Subject: [PATCH] refactor: Use existing macro for IAP identifiers --- .../ViewController/MasterViewController.m | 31 +++++++------------ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/Sources/Earthquake Network/ViewController/MasterViewController.m b/Sources/Earthquake Network/ViewController/MasterViewController.m index faa57bb..ea89ce7 100644 --- a/Sources/Earthquake Network/ViewController/MasterViewController.m +++ b/Sources/Earthquake Network/ViewController/MasterViewController.m @@ -111,27 +111,18 @@ } } --(void)annullaAcquisitiInApp{ - - - [[NSUserDefaults standardUserDefaults] setBool:NO - forKey:@"com.finazzi.distquake.ProPrezzoPieno"]; - - [[NSUserDefaults standardUserDefaults] setBool:NO - forKey:@"com.finazzi.distquake.VersioneProScontata"]; - [[NSUserDefaults standardUserDefaults] setBool:NO - forKey:@"com.finazzi.distquake.Abbonamento10k.mensileAutomatico"]; - [[NSUserDefaults standardUserDefaults] setBool:NO - forKey:@"com.finazzi.distquake.Abbonamento10k.annualeAutomatico"]; - [[NSUserDefaults standardUserDefaults] setBool:NO - forKey:@"com.finazzi.distquake.Abbonamento10k.annualeAutomaticoScontato"]; - [[NSUserDefaults standardUserDefaults] setBool:NO - forKey:@"com.finazzi.distquake.Abbonamento100k.mensileAutomatico"]; - [[NSUserDefaults standardUserDefaults] setBool:NO - forKey:@"com.finazzi.distquake.Abbonamento100k.annualeAutomatico"]; - [[NSUserDefaults standardUserDefaults] setBool:NO - forKey:@"com.finazzi.distquake.Abbonamento100k.annualeAutomaticoscontato"]; +- (void)annullaAcquisitiInApp +{ + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + [defaults setBool:NO forKey:AQUISTO_PRO]; + [defaults setBool:NO forKey:AQUISTO_PRO_SCONTATO]; + [defaults setBool:NO forKey:@"com.finazzi.distquake.Abbonamento10k.mensileAutomatico"]; + [defaults setBool:NO forKey:@"com.finazzi.distquake.Abbonamento10k.annualeAutomatico"]; + [defaults setBool:NO forKey:@"com.finazzi.distquake.Abbonamento10k.annualeAutomaticoScontato"]; + [defaults setBool:NO forKey:@"com.finazzi.distquake.Abbonamento100k.mensileAutomatico"]; + [defaults setBool:NO forKey:@"com.finazzi.distquake.Abbonamento100k.annualeAutomatico"]; + [defaults setBool:NO forKey:@"com.finazzi.distquake.Abbonamento100k.annualeAutomaticoscontato"]; } -(void)registraNotifiche{