Post not yet marked as solved
Post marked as unsolved with 3 replies, 162 views
Hello, I have an app that has 2 consumable in app purchase, and now I added a 3rd non-consumable purchase which removes the ads. My problem is that they rejected the build and the ad removal in app purchase as well multiple times because of this in app purchase. Sometimes the problem was that the in app purchases wasn't loaded for them, but now they problem is network errors. With the rejection they sent my screenshots. Once they got a network error saying: The request timed out. Another time they got another network error saying: The network connection was lost. For me it works perfectly every time on my iPhone and iPad.
On the main screen so when the app starts I check internet connection and then fetch in app purchases.
.task {
adatok.InternetEllenorzes()
await adatok.fetchApponbeluliVasarlasok()
}
Then in the main menu when you click on the store button I check the internet property that was set to true if there's is internet connection. If there's no internet an alert appears saying no internet. and if there was no internet when you launched the app but then you suddenly got internet after then the fetch runs again before navigate to the shop(in app purchase view). So by the time you're in the shop view the fetch must run.
Now here's the purchasing part:
purchase:
func Vasarlas(termek: Product) async {
do {
print("itt várakozás van hogy jó e vagy nem")
vasarlasFolyamatban = true // teszt
let vasarlasEredmenye = try await termek.purchase()
switch vasarlasEredmenye {
case .success(let verificationResult):
print("A vásárlás sikeresen végigment")
switch verificationResult {
case .verified(let transaction):
VasarlasAllapotEllenorzes()
await transaction.finish()
print("tényleg megvette van blokk")
switch termek.id {
case "A_tudatlansag_ara_betuVasarlas":
BetuVasarlas()
megvasaroltBetuk += 1
VasarlasSzamMentese()
print("sikeres betű vásárlás")
vasarlasFolyamatban = false
case "A_tudatlansag_ara_teljesVerzioV2":
megvettemAReklamMentesseget = true
print("sikeres reklámmentesség vásárlás")
vasarlasFolyamatban = false
reklamMutatva = false
case "A_tudatlansag_ara_UjEsely":
if aktualisJatekMod == .egyjatekos {
UjEsely()
} else {
TobbjatekosUjEsely()
}
megvasaroltUjEselyek += 1
VasarlasSzamMentese()
print("sikeres új esély vásárlás")
vasarlasFolyamatban = false
default: return
}
vasarlasFolyamatban = false
boltMutatasa = false
hibauzenet = nil
sikeresVasarlas = true
sikeresVasarlasok.append(termek)
break
case .unverified(_, let hiba):
print("A vásárlás sikeres de mivel nincs blokkk nincs megerősítve: \(hiba.localizedDescription)")
vasarlasFolyamatban = false
boltMutatasa = false
hibauzenet = nil
break
}
case .userCancelled:
hibaCim = "Vásárlás hiba"
if boltMutatasa {
hibauzenet = "A vásárlás megszakítva"
boltHibaMegjelenites = true
vasarlasFolyamatban = false
} else {
vasarlasFolyamatban = false
hibauzenet = "A vásárlás megszakítva"
boltHibaMegjelenites = true
}
break
case .pending:
print("a vásárlás folyamatban")
break
@unknown default:
vasarlasFolyamatban = false
hibauzenet = "Ismeretlen hiba történt"
boltHibaMegjelenites = true
break
}
} catch {
hibaCim = "Hálózati hiba cim"
hibauzenet = error.localizedDescription
boltHibaMegjelenites = true
vasarlasFolyamatban = false
}
}
And here's the purchase check:
func VasarlasAllapotEllenorzes() {
Task {
for await VerificationResult in Transaction.updates {
switch VerificationResult {
case .verified(let vasarlas):
print("sikeres vásárlás: \(vasarlas.signedDate)")
await vasarlas.finish()
vasarlasFolyamatban = false
case .unverified(_, _):
print("Hiba történt a vásásrlás közben)")
boltHibaMegjelenites = true
vasarlasFolyamatban = false
}
}
}
}
Anyone got any suggestion why it runs perfectly for me on 2 different device but the review team can't get it working? Is there a problem with the code or the problem is on the side? I even asked them because in the screenshots they sent, which I show here doesn't show any network icon no wifi or cellular in the notification area, so I asked them if they have a network connection but they said they did not experience any network issues during the review.