我目前正在讀:https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/PassKit_PG/Updating.html#//apple_ref/doc/uid/TP40012195-CH5-SW1分發Passkit通行證
它說,推送通知通行證設備寄存器,但經過通已初步安裝這只是發生(它由AppleWallet自動發生)。
我的問題是,我怎麼能給用戶最初的定製通行證? 例如:用戶打開我的應用程序,點擊「添加傳遞到電子錢包」按鈕。它是否應該在特定於該用戶的服務器端生成通行證並安裝該通行證,或者是否應該具有通用字段的本地通行證,安裝該通行證並且錢包會自動下載最新通行證?
我問這一切,因爲在蘋果的服務器引用(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.
###############
所以它好像你不應該下載傳遞到比登記的其他設備呼叫?還是我讀錯了?