ios - How to handle loc-key in remote Push Notification payload
问题描述
I've implemented handling of remote push notifications in didReceiveRemoteNotification
method in AppDelegate.swift and it works except for payloads of following format.
{
"aps" : {
"alert" : {
"loc-key" : "GAME_PLAY_REQUEST_FORMAT",
"loc-args" : [ "Jenna", "This is Message"]
},
"sound" : "chime.aiff"
},
"acme" : "foo"
}
I want to format and show the content of loc-args on the notification alert. I want to extract "Jenna" and "This is Message" from loc-args and display on alert as below in body and title of alert:
New Message from Jenna
This is message
I've been reading tuts but I can't figure out what exactly I've to do to get it done. I want to keep it simple. Any help? Tx
解决方案
Solution was Localizable.strings
推荐阅读
- postgis - PostGIS Raster 计算 DEM 的最小、最大高度值和斜率
- excel - 在 excel VBA 中激活 selenium bot 窗口
- angular - 未隐藏子元素时如何设置组件的主机样式?
- oracle-sqldeveloper - 选择带有变量的列名
- ios - 运行视频一段时间后,应用程序进入后台模式
- node.js - 在反应中更改名称属性实际上会停止从下拉列表中选择值
- ansible - 在 Ansible 中执行操作后如何更改变量?
- sql - 以逗号分隔的字符串显示所有父母直到最上面
- amazon-web-services - 无法使用控制台创建 AWS 密钥对
- c# - 当我可以确认我的集合确实有值时,为什么我的列表框不能显示绑定值?