1
通過使用休斯頓,我有推送通知信息,作爲附加圖片。但是,該設備不會顯示通知消息,該信息僅顯示控制檯。我允許我的設備接受推送通知。問題是什麼?收到iOS推送通知,但不會顯示在設備上。 Rails,休斯敦
resource "push" do
params do
requires :device_token, type: String
end
post do
APN = Houston::Client.development
APN.certificate = File.read(Rails.root.join('certificates', 'apns', '150927Development.pem'))
# An example of the token sent back when a device registers for notifications
token = params[:device_token]
# Create a notification that alerts a message to the user, plays a sound, and sets the badge on the app
notification = Houston::Notification.new(device: token)
notification.alert = "Hello, World!"
# Notifications can also change the badge count, have a custom sound, indicate available Newsstand content, or pass along arbitrary data.
notification.badge = 57
notification.sound = "sosumi.aiff"
notification.content_available = true
notification.custom_data = {foo: "bar"}
Rails.logger.debug
APN.push(notification)
end
end
你的問題是什麼?推送通知似乎已經使它 – tommybananas