首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >分发Passkit通行证

分发Passkit通行证
EN

Stack Overflow用户
提问于 2017-02-19 15:32:15
回答 1查看 546关注 0票数 0

我目前正在阅读:ref/doc/uid/TP40012195-CH5-SW1

它说,设备注册推送通知的通行证,但这只发生在pass已初步安装(它自动发生由AppleWallet)。

我的问题是,我如何才能给用户最初的定制通行证?例如:用户打开我的应用程序,点击"Add Pass to Wallet“按钮。它是在服务器端生成一个特定于该用户的通行证并安装它,还是应该有一个带有通用字段的本地pass,安装它,钱包就会自动下载最新的pass?

我之所以这么问,是因为在Apple的服务器引用(用Ruby编写)中,它们有:

代码语言:javascript
复制
  ################
  # FOR DEVELOPMENT PURPOSES ONLY
  # This endpoint is to allow developers to download a pass.
  # 
  # NOTE: This endpoint is not part of the offical API and does not implement
  # authentication/authorization controls and should only be used for development.
  # Please protect your user's data.
  #

  get "/pass.pkpass" do
    redirect "/sample.pkpass"
  end

  get "/:serial_number.pkpass" do
    # Retrieve pass file
    pass_output_path = File.dirname(File.expand_path(__FILE__)) + "/data/passes/#{params[:serial_number]}.pkpass"

    # Send the pass file
    send_file(pass_output_path, :type => :pkpass)
  end

  ###
  # End of development only endpoint.
  ###############

因此,似乎您不应该下载传递到设备上,而不是在注册电话?还是我看错了?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-02-19 20:29:40

如果您的服务器已经提供了Pass包,最好的方法是使用PKPass(data:error:),其中data是在您自己的应用程序中下载的Pass文件。这样,您只将其创建集中在一个地方,从而将可能出现的错误信息降至最低。

之后,您可以使用两种方法安装设备上的传递:

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42329105

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档