Various fixes

This commit is contained in:
Ilya Laktyushin
2022-06-11 14:38:44 +04:00
parent a4c6e96b66
commit eaf6a69cfb
5 changed files with 41 additions and 18 deletions

View File

@@ -763,6 +763,21 @@ func openExternalUrlImpl(context: AccountContext, urlContext: OpenURLContext, ur
}
} else if parsedUrl.host == "premium_offer" {
handleResolvedUrl(.premiumOffer(reference: nil))
} else if parsedUrl.host == "restore_purchases" {
context.inAppPurchaseManager?.restorePurchases(completion: { result in
let text: String
switch result {
case .succeed:
text = presentationData.strings.Premium_Restore_Success
case .failed:
text = presentationData.strings.Premium_Restore_ErrorUnknown
}
context.sharedContext.presentGlobalController(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: nil, text: text, actions: [
TextAlertAction(type: .genericAction, title: presentationData.strings.Common_OK, action: {
}),
], parseMarkdown: true), nil)
})
}
}