简体   繁体   English

为 iOS 应用程序定义 SSL 自定义 URL 方案

[英]Defining an SSL Custom URL Scheme for an iOS App

I need a callback URL that meets WooCommerce's REST API authentication endpoint URL and iOS Custom URL Scheme.我需要一个满足 WooCommerce 的 REST API 身份验证端点 URL 和 iOS 自定义 URL 方案的回调 URL。 According to the documentation the callback URL for WooCommerce has to be in this format: https://app.com/callback-endpoint but the URL Scheme to return a user to an iOS app is written in this format: AppNameURL://.根据文档,WooCommerce 的回调 URL 必须采用以下格式: https://app.com/callback-endpoint但将用户返回到 iOS 应用程序的 URL 方案是以这种格式编写的:AppNameURL://。 Doing so gives the Error: The callback_url needs to be over SSL. WooCommerce will return 4 parameters key_id, user_id, consumer_key, consumer_secret and key_permissions.这样做会出现错误:回调 url 需要超过 SSL。WooCommerce 将返回 4 个参数 key_id、user_id、consumer_key、consumer_secret 和 key_permissions。

Is there a way to write a callback URL to send the information to the app or do I need to write a PHP function to capture the data then redirect to the app returning the captured data?有没有办法编写回调 URL 将信息发送到应用程序,或者我是否需要编写一个 PHP function 来捕获数据然后重定向到返回捕获数据的应用程序?

You shouldn't use a custom URL scheme for this anymore.您不应再为此使用自定义 URL 方案。 Use a Universal Link , and it will handle the use case you're describing.使用Universal Link ,它将处理您描述的用例。 Universal Links have been available since iOS 9.通用链接自 iOS 9 起可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM