-H "Authorization: Bearer X" \
-X POST "https://X.pushnotifications.pusher.com/ ... /publishes" \
-d '{"interests":["hello"], "apns":{"aps":{"alert":{"title": "
< /code>
Тогда в приложении делегат у меня есть < /p>
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
if let notification = launchOptions?[.remoteNotification] as? [AnyHashable: Any] {
if let discountCode = notification["discountCode"] as? String {
UserDefaults.standard.set(discountCode, forKey: "pendingDiscountCode")
}
}
}
< /code>
К сожалению, это не работает. Когда я отправляю уведомление Push, приложение не может получить код скидки из метаданных скручивания. Что я делаю не так?
Подробнее здесь: https://stackoverflow.com/questions/797 ... to-ios-app
Мобильная версия