它说设备注册了通行证的推送通知,但这仅在最初安装通行证之后发生(并且它由 AppleWallet 自动发生)。
我的问题是,我怎样才能给用户初始定制通行证?例如:用户打开我的应用程序,点击“将通行证添加到钱包”按钮。它应该在特定于该用户的服务器端生成一个通行证并安装它,还是应该有一个带有通用字段的本地通行证,安装它并且钱包会自动下载最新的通行证?
我问这一切是因为在 Apple 的服务器参考(用 Ruby 编写)中,它们有:
################
# 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.
###############
所以似乎除了注册电话之外,您不应该将通行证下载到设备上?还是我读错了?