Skip to content

Conversation

MaximeSIMET
Copy link
Contributor

@MaximeSIMET MaximeSIMET commented Jan 8, 2025

closes #64

@mjurczyk
Copy link

Would it make sense to also take into consideration deprecation note from https://developer.apple.com/documentation/storekit/skstorereviewcontroller for iOS17+ ?

@MaximeSIMET
Copy link
Contributor Author

Would it make sense to also take into consideration deprecation note from https://developer.apple.com/documentation/storekit/skstorereviewcontroller for iOS17+ ?

Yes, i have taken that into account

Comment on lines 12 to 18
} else if #available(iOS 14.0, *) {
if let windowScene = UIApplication.shared.connectedScenes.first(where: { $0.activationState == .foregroundActive }) as? UIWindowScene {
SKStoreReviewController.requestReview(in: windowScene)
}
} else {
SKStoreReviewController.requestReview()
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} else if #available(iOS 14.0, *) {
if let windowScene = UIApplication.shared.connectedScenes.first(where: { $0.activationState == .foregroundActive }) as? UIWindowScene {
SKStoreReviewController.requestReview(in: windowScene)
}
} else {
SKStoreReviewController.requestReview()
}
} else {
if let windowScene = UIApplication.shared.connectedScenes.first(where: { $0.activationState == .foregroundActive }) as? UIWindowScene {
SKStoreReviewController.requestReview(in: windowScene)
}
}

The plugin only supports iOS 14+ now, so the last else can be removed.

And you can also use a single if let windowScene = UIApplication.shared.connectedScenes.first(where: { $0.activationState == .foregroundActive }) as? UIWindowScene before the if instead of duplicating it for each case since the code is the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes i agree, thank you

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you address the second part of the comment?

}
}


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the duplicated new line at the end of the file

@claptimes5

This comment was marked as abuse.

@jcesarmobile jcesarmobile changed the title update deprecated SKStoreReviewController fix(ios): update deprecated SKStoreReviewController usage May 12, 2025
@jcesarmobile jcesarmobile merged commit dccbd26 into capacitor-community:main May 12, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SKStoreReviewController deprecated

5 participants