IOS/PASSBOOK:从IOS webview的动态链接下载文件(.pkpass) [英] IOS / PASSBOOK: Download a file (.pkpass) from dynamic link from IOS webview

查看:38
本文介绍了IOS/PASSBOOK:从IOS webview的动态链接下载文件(.pkpass)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个简单的 IOS 应用程序.这是一个带有导航按钮的网页视图,允许用户导航到我的网页.

I’m developing a simple IOS app. It’s a webview with navigation buttons that allows the user to navigate into my web.

我正在使用通用设备目标在 Xcode 8.2.1(Objetive C)上编程.

I’m programming at Xcode 8.2.1 (Objetive C) with a universal device target.

在我的一个 URL 中,我显示了一个动态链接(在每个会话中都会更改)以允许用户下载 PDF 文件,以及另一个用于下载 PassBook(pkpass 文件)的动态链接.当用户选择第一个按钮时,PDF正确显示,但选择第二个按钮时,没有任何内容.

In one of my URLs I show a dynamic link (that changes at each session) to allow the user to download a PDF file, and another dynamic link to download a PassBook (pkpass file). When the user selects the first button the pdf is correctly shown, but when the second button is selected nothing happens.

我不知道是权限问题还是我必须添加一段代码来解决这个问题.我找到了一些关于使用 AFNetworking 下载的帖子,但我的链接是可变的,并且我们必须导航到该站点的所有 URL.

I don’t know if it’s due to a permission problems or if I have to add a section of code to solve this. I have found some posts about downloading with AFNetworking but my links are variables and the wevbiew must navigate to all the URLs of the site.

推荐答案

iOS webview 组件不会自动处理 .pkpass 文件.您将需要添加代码来处理然后自己.

The iOS webview components do not automatically process .pkpass files. You will need to add code to process then yourself.

这里有一些样板 Objecive-C 代码:从我的服务器下载 iOS 自定义应用程序中的 PKPass

There is some boilerplate Objecive-C code here: Downloading PKPass in an iOS custom app from my server

这篇关于IOS/PASSBOOK:从IOS webview的动态链接下载文件(.pkpass)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆