fix: Properly handle new subscriptions also in detail page

This commit is contained in:
Andrea Busi
2021-04-23 14:00:35 +02:00
parent 7611e3eb15
commit cf97c3cb61
9 changed files with 31 additions and 17 deletions
@@ -56,34 +56,32 @@ class SubscriptionDetailViewController: UIViewController {
private func updateUI() {
guard let product = product, isViewLoaded else { return }
productImageView.image = VersioneProProducts.image(for: product.productIdentifier)
productTitleLabel.text = product.localizedTitle
productDescriptionLabel.text = product.localizedDescription
var purchaseRecapString = ""
var subscriptionDetailsString = ""
switch product.productIdentifier {
case VersioneProProducts.Identifier.Subscription10kMonthly:
productImageView.image = UIImage.init(named: "top_10k")
case VersioneProProducts.Identifier.Subscription10kMonthly,
VersioneProProducts.Identifier.Subscription100kMonthly:
purchaseRecapString = "inapp_monthly_payment"
case VersioneProProducts.Identifier.Subscription100kMonthly:
productImageView.image = UIImage.init(named: "top_100k")
purchaseRecapString = "inapp_monthly_payment"
case VersioneProProducts.Identifier.Subscription100kYearly, VersioneProProducts.Identifier.Subscription100kYearlyDiscounted:
productImageView.image = UIImage.init(named: "top_100k")
subscriptionDetailsString = "inapp_detail_description"
case VersioneProProducts.Identifier.Subscription100kYearly,
VersioneProProducts.Identifier.Subscription100kYearlyDiscounted,
VersioneProProducts.Identifier.Subscription10kYearly,
VersioneProProducts.Identifier.Subscription10kYearlyDiscounted:
purchaseRecapString = "inapp_yearly_payment"
case VersioneProProducts.Identifier.Subscription10kYearly, VersioneProProducts.Identifier.Subscription10kYearlyDiscounted:
productImageView.image = UIImage.init(named: "top_10k")
purchaseRecapString = "inapp_yearly_payment"
subscriptionDetailsString = "inapp_detail_description"
case VersioneProProducts.Identifier.Subscription10kPerpetual,
VersioneProProducts.Identifier.Subscription100kPerpetual:
purchaseRecapString = "inapp_lifetime_payment"
subscriptionDetailsString = "inapp_lifetime_detail_description"
default:
break
}
subscriptionDetailsLabel.text = NSLocalizedString("", comment: "")
subscriptionDetailsLabel.text = NSLocalizedString(subscriptionDetailsString, comment: "")
openPrivacyButton.setTitle(NSLocalizedString("network_pro_privacy_disclaimer", comment: ""), for: .normal)
openTermsButton.setTitle(NSLocalizedString("network_pro_terms_conditions", comment: ""), for: .normal)
@@ -209,6 +209,7 @@
"network_pro_terms_conditions" = "Όροι και συνθήκες";
"network_pro_paying" = "Πληρώνετε:";
"inapp_detail_description" = "• Η πληρωμή σας θα χρεωθεί στο λογαριασμό σας στο iTunes κατά την επιβεβαίωση της αγοράς\n• η συνδρομή ανανεώνεται αυτόματα εκτός εάν η αυτόματη ανανέωση απενεργοποιείται τουλάχιστον 24 ώρες πριν από το τέλος της τρέχουσας περιόδου\n• η συνδρομή θα χρεωθεί για ανανέωση εντός 24 Ώρες πριν από το τέλος της τρέχουσας περιόδου και το κόστος ανανέωσης που εντοπίστηκαν\n• Οι συνδρομές μπορούν να διαχειριστούν από τον χρήστη και η αυτόματη ανανέωση μπορεί να απενεργοποιηθεί με την πρόσβαση στις ρυθμίσεις του λογαριασμού του χρήστη μετά την αγορά.";
"inapp_lifetime_detail_description" = "• Η πληρωμή σας θα χρεωθεί στο λογαριασμό σας στο iTunes κατά την επιβεβαίωση της αγοράς";
"inapp_purchase" = "ΕΓΓΡΑΦΕΊΤΕ ΣΤΗΝ ΥΠΗΡΕΣΊΑ";
"official_select_country_placeholder" = "Επιλέξτε τη χώρα";
"inapp_lifetime_subscriptions" = "Συνδρομές διάρκειας ζωής";
@@ -216,6 +217,7 @@
"inapp_monthly_subscriptions" = "Μηνιαίες συνδρομές";
"inapp_monthly_payment" = "θα πληρώσετε ανά μήνα:";
"inapp_yearly_payment" = "θα πληρώσετε ετησίως:";
"inapp_lifetime_payment" = "θα πληρώσετε:";
"ok" = "Εντάξει";
"critical_alerts_setting" = "Κρίσιμες ειδοποιήσεις. Κάντε έναν ήχο επίσης, δεν διαταράσσετε τη λειτουργία";
"attention" = "Προσοχή";
@@ -209,6 +209,7 @@
"network_pro_terms_conditions" = "Terms and conditions";
"network_pro_paying" = "You are paying:";
"inapp_detail_description" = "• Your payment will be charged to your iTunes account upon confirmation of purchase\n• The subscription is automatically renewed unless the automatic renewal is deactivated at least 24 hours before the end of the current period\n• Subscription will be charged for renewal within 24 hours before the end of the current period and the renewal cost identified\n• Subscriptions can be managed by the user and automatic renewal can be deactivated by accessing the user's account settings after the purchase.";
"inapp_lifetime_detail_description" = "• Your payment will be charged to your iTunes account upon confirmation of purchase";
"inapp_purchase" = "SUBSCRIBE TO SERVICE";
"official_select_country_placeholder" = "Select the country";
"inapp_lifetime_subscriptions" = "Lifetime subscriptions";
@@ -216,6 +217,7 @@
"inapp_monthly_subscriptions" = "Monthly subscriptions";
"inapp_monthly_payment" = "you will pay per month:";
"inapp_yearly_payment" = "you will pay per year:";
"inapp_lifetime_payment" = "you will pay:";
"ok" = "Ok";
"critical_alerts_setting" = "Critical alerts. Make a sound also in do not disturb mode";
"attention" = "Attention";
@@ -209,6 +209,7 @@
"network_pro_terms_conditions" = "Términos y condiciones";
"network_pro_paying" = "Estas pagando:";
"inapp_detail_description" = "• Su pago se cargará a su cuenta de iTunes tras la confirmación de la compra\n• La suscripción se renueva automáticamente a menos que la renovación automática se desactive al menos 24 horas antes del final del período actual\n• La suscripción se cobrará por la renovación dentro de las 24 horas antes del final del período actual y el costo de renovación identificado\n• Las suscripciones pueden ser administradas por el usuario y la renovación automática se puede desactivar accediendo a la configuración de la cuenta del usuario después de la compra.";
"inapp_lifetime_detail_description" = "• Su pago se cargará a su cuenta de iTunes tras la confirmación de la compra";
"inapp_purchase" = "SUSCRÍBETE AL SERVICIO";
"official_select_country_placeholder" = "Seleccione el pais";
"inapp_lifetime_subscriptions" = "Suscripciones de por vida";
@@ -216,6 +217,7 @@
"inapp_monthly_subscriptions" = "Suscripciones mensuales";
"inapp_monthly_payment" = "pagarás por mes:";
"inapp_yearly_payment" = "pagarás por año:";
"inapp_lifetime_payment" = "pagarás:";
"ok" = "OK";
"critical_alerts_setting" = "Alertas críticas. Emite un sonido también en el modo no molestar";
"attention" = "Atención";
@@ -209,6 +209,7 @@
"network_pro_terms_conditions" = "Termes et conditions";
"network_pro_paying" = "Vous payez:";
"inapp_detail_description" = "• Votre paiement sera débité de votre compte iTunes lors de la confirmation de l'achat\n• L'abonnement est automatiquement renouvelé sauf si le renouvellement automatique est désactivé au moins 24 heures avant la fin de la période en cours\n• L'abonnement sera facturé pour le renouvellement dans les 24 heures avant la fin de la période en cours et le coût de renouvellement identifié\n• Les abonnements peuvent être gérés par l'utilisateur et le renouvellement automatique peut être désactivé en accédant aux paramètres du compte de l'utilisateur après l'achat.";
"inapp_lifetime_detail_description" = "• Votre paiement sera débité de votre compte iTunes lors de la confirmation de l'achat";
"inapp_purchase" = "ABONNEZ-VOUS AU SERVICE";
"official_select_country_placeholder" = "Sélectionnez le pays";
"inapp_lifetime_subscriptions" = "Abonnements à vie";
@@ -216,6 +217,7 @@
"inapp_monthly_subscriptions" = "Abonnements mensuels";
"inapp_monthly_payment" = "vous paierez par mois:";
"inapp_yearly_payment" = "vous paierez par an:";
"inapp_lifetime_payment" = "vous paierez:";
"ok" = "OK";
"critical_alerts_setting" = "Alertes critiques. Émettre un son également en mode Ne pas déranger";
"attention" = "Attention";
@@ -209,6 +209,7 @@
"network_pro_terms_conditions" = "Uvjeti i odredbe";
"network_pro_paying" = "Plaćate:";
"inapp_detail_description" = "• Vaša će uplata biti naplaćena na vaš iTunes račun nakon potvrde kupnje\n• Pretplata se automatski obnavlja, osim ako se automatska obnova ne deaktivira najmanje 24 sata prije kraja tekućeg razdoblja\n • Pretplata će se naplatiti za obnovu u roku od 24 sati prije kraja tekućeg razdoblja i utvrđenih troškova obnove\n • Korisnikom može upravljati pretplatama, a automatskim obnavljanjem može se deaktivirati pristupom postavkama korisničkog računa nakon kupnje.";
"inapp_lifetime_detail_description" = "• Vaša će uplata biti naplaćena na vaš iTunes račun nakon potvrde kupnje";
"inapp_purchase" = "PRETPLATITE SE NA SERVIS";
"official_select_country_placeholder" = "Odaberite zemlju";
"inapp_lifetime_subscriptions" = "Doživotne pretplate";
@@ -216,6 +217,7 @@
"inapp_monthly_subscriptions" = "Mjesečne pretplate";
"inapp_monthly_payment" = "ćete platiti po mjesecu:";
"inapp_yearly_payment" = "ćete platiti godišnje:";
"inapp_lifetime_payment" = "ćete platiti:";
"ok" = "OK";
"critical_alerts_setting" = "Kritična upozorenja. Dajte zvuk i u načinu ne ometaj";
"attention" = "Pažnja";
@@ -209,6 +209,7 @@
"network_pro_terms_conditions" = "Syarat dan ketentuan";
"network_pro_paying" = "Anda membayar:";
"inapp_detail_description" = "• Pembayaran Anda akan dibebankan ke akun iTunes Anda setelah konfirmasi pembelian\n• Langganan diperpanjang secara otomatis kecuali pembaruan otomatis dinonaktifkan setidaknya 24 jam sebelum akhir periode saat ini\n• Langganan akan dikenakan biaya untuk pembaruan dalam waktu 24 jam sebelum akhir periode berjalan dan biaya pembaruan diidentifikasi\n• Langganan dapat dikelola oleh pengguna dan pembaruan otomatis dapat dinonaktifkan dengan mengakses pengaturan akun pengguna setelah pembelian.";
"inapp_lifetime_detail_description" = "• Pembayaran Anda akan dibebankan ke akun iTunes Anda setelah konfirmasi pembelian";
"inapp_purchase" = "BERLANGGANAN LAYANAN";
"official_select_country_placeholder" = "Pilih negaranya";
"inapp_lifetime_subscriptions" = "Langganan seumur hidup";
@@ -216,6 +217,7 @@
"inapp_monthly_subscriptions" = "Langganan bulanan";
"inapp_monthly_payment" = "Anda akan membayar per bulan:";
"inapp_yearly_payment" = "Anda akan membayar per tahu:";
"inapp_lifetime_payment" = "Anda akan membayar:";
"ok" = "OK";
"critical_alerts_setting" = "Peringatan kritis. Bersuara juga dalam mode jangan ganggu";
"attention" = "Perhatian";
@@ -209,6 +209,7 @@
"network_pro_terms_conditions" = "Termini e condizioni";
"network_pro_paying" = "Stai pagando:";
"inapp_detail_description" = "• Il pagamento verrà addebitato sul tuo account iTunes alla conferma dell'acquisto\n• L'abbonamento si rinnova automaticamente a meno che il rinnovo automatico non venga disattivato almeno 24 ore prima della fine del periodo corrente\n• L'abbonamento verrà addebitato per il rinnovo entro 24 ore prima della fine del periodo corrente e al costo di rinnovo indicato\n• Gli abbonamenti possono essere gestiti dall'utente e il rinnovo automatico può essere disattivato accedendo alle impostazioni dell'account dell'utente dopo l'acquisto.";
"inapp_lifetime_detail_description" = "• Il pagamento verrà addebitato sul tuo account iTunes alla conferma dell'acquisto";
"inapp_purchase" = "ISCRIVITI AL SERVIZIO";
"official_select_country_placeholder" = "Scegli la nazione";
"inapp_lifetime_subscriptions" = "Abbonamenti a vita";
@@ -216,6 +217,7 @@
"inapp_monthly_subscriptions" = "Abbonamenti mensili";
"inapp_monthly_payment" = "pagherai al mese:";
"inapp_yearly_payment" = "pagherai all'anno:";
"inapp_lifetime_payment" = "pagherai:";
"ok" = "OK";
"critical_alerts_setting" = "Allerte critiche. Produci un suono anche in modalità non disturbare";
"attention" = "Attenzione";
@@ -209,6 +209,7 @@
"network_pro_terms_conditions" = "Şartlar ve koşullar";
"network_pro_paying" = "Ödüyorsunuz:";
"inapp_detail_description" = "• Satın alma onayının ardından ödemeniz iTunes hesabınızdan tahsil edilecektir\n• Otomatik yenileme, cari dönemin bitiminden en az 24 saat önce devre dışı bırakılmadığı sürece abonelik otomatik olarak yenilenir\n• Abonelik, 24 saat içinde yenileme için ücretlendirilir cari dönemin bitiminden saatler önce ve belirlenen yenileme maliyeti\n• Satın alma işleminden sonra kullanıcının hesap ayarlarına girilerek abonelikler kullanıcı tarafından yönetilebilir ve otomatik yenileme devre dışı bırakılabilir.";
"inapp_lifetime_detail_description" = "• Satın alma onayının ardından ödemeniz iTunes hesabınızdan tahsil edilecektir";
"inapp_purchase" = "HİZMETE ABONE OL";
"official_select_country_placeholder" = "Ülkeyi seçin";
"inapp_lifetime_subscriptions" = "Ömür boyu abonelikler";
@@ -216,6 +217,7 @@
"inapp_monthly_subscriptions" = "Aylık abonelikler";
"inapp_monthly_payment" = "aylık ödeyeceksiniz:";
"inapp_yearly_payment" = "senelik ödeyeceksin:";
"inapp_lifetime_payment" = "ödeyeceksin:";
"ok" = "OK";
"critical_alerts_setting" = "Kritik uyarılar. Rahatsız etmeyin modunda da ses çıkar";
"attention" = "Dikkat";