我使用8个密钥设置我的通知,这是我将在其他设备中收到此通知所需的信息。问题是文档说它只能设置3个密钥。我可以从消息中提取这些密钥中的一些信息,但我不认为这是最好的方法,例如因为此消息可以使用8种不同的语言。如何通过推送通知发送此信息?
答案 0 :(得分:1)
准备好通知时,请查看CKNotificationInfo。在本课程中,您将找到以下属性:
您必须使用本地化字符串文件的键设置上面的属性。
//In your .strings file...
"NOTICATION_BODY" = "¡Hola mundo!";
"NOTIFCATION_ACTION" = "Cerrar";
"NOTICATION_BODY" = "Hello world!";
"NOTIFCATION_ACTION" = "Close";
// In your CKNotificationInfo object...
notificationInfo.alertLocalizationKey = "NOTICATION_BODY"
notificationInfo.alertActionLocalizationKey= "NOTIFCATION_ACTION"