有沒有使用apn_on_rails來推動Newsstand通知的方法?即按這種有效載荷:我可以使用apn_on_rails推送報亭通知嗎?
{"aps": {"badge": 1,"content-available":"1"} }
目前I can see,我可以用徽章,聲音和提醒推送通知。
我敢肯定,如果事實證明它還沒有做到這一點,修改apn_on_rails本身並不難。有很多apn_on_rails的分支,我現在使用this one。
有沒有使用apn_on_rails來推動Newsstand通知的方法?即按這種有效載荷:我可以使用apn_on_rails推送報亭通知嗎?
{"aps": {"badge": 1,"content-available":"1"} }
目前I can see,我可以用徽章,聲音和提醒推送通知。
我敢肯定,如果事實證明它還沒有做到這一點,修改apn_on_rails本身並不難。有很多apn_on_rails的分支,我現在使用this one。
APN::Notification
類有一個custom_properties
屬性,用於在推送通知中包含任何通用數據。以您的有效載荷爲例,您可以這樣做:
apn = APN::Notification.new
apn.badge = 1
apn.custom_properties = {"content-available" => 1}
Grocer還支持報亭通知。 https://github.com/grocer/grocer#newsstand-notifications
notification = Grocer::NewsstandNotification.new(device_token: "...")
# Generates a JSON payload like:
# {"aps": {"content-available": 1}}