Notifications no iOS 10
Pedro van Rooij Costa
O que são Notifications?
O que são Notifications?
• Remotas
• Locais
Porque falar sobre isso?
• Mudanças em todas as APIs de notifications
• Junção de remote e local notifications em um
objeto só -> UNNotification
• UIKit —> UserNotifications
• iOS 10+, watchOS 3+ e tvOS 10+
Tópicos
• Local notifications
• Remote notifications
• User Notification Center
• Delegate e in-app Notifications ( )
• Extensions ( )
Local notifications
Local Notifications
Triggers
Time Interval
Local Notifications
Triggers
Location
Local Notifications
Triggers
Calendar
Local Notifications
Criando uma notificação
• categoryIdentifier: Identificador a ser usado para adicionar actions
associadas
• requestIdentifier: Identificador único da sua notificação, caso use o
mesmo identifier para uma nova notificação há substituição
Local Notifications
Criando uma notificação
Remote notifications
Remote notifications
User Notification Center
User Notification Center
• UNUserNotificationCenter
• Singleton responsável por cuidar das
notificações
• Não há mais a necessidade de usar o app
delegate para tratamento de sucesso ou erro
User Notification Center
• Obter configurações atuais das notificações
User Notification Center
• Obter autorização para uso de notificações
User Notification Center
Definindo categorias de notificações aceitas
• identifier: identificador único
• title: Título
• options: authenticationRequired (somente
disponível quando device destravado),
destructive (coloração especial), foreground
(quando a ação precisa ativar o app)
User Notification Center
Definindo categorias de notificações aceitas
• identifier: identificador único
• actions: Ações associadas com a categoria (limite de
4)
• minimalActions: Quando espaço é limitado ações
mínimas a serem suportadas (limite de 2)
• intentIdentifiers: Strings associadas a Intents usadas
pelo sistema
• options: Custom Dismiss Action ou Allow CarPlay
User Notification Center
Definindo categorias de notificações aceitas
User Notification Center
Adicionando uma local notification
User Notification Center
Ver local notifications pendentes
User Notification Center
remover local notifications pendentes
User Notification Center
remover todas local notifications pendentes
User Notification Center
ver notifications visíveis
User Notification Center
remover notificações visíveis
User Notification Center
remover todas notificações visíveis
Delegate e in-app
Notifications
Delegate e in-app
Notifications
Extensions
Notification Service
Extension
Notification Service
Extension
Notification Service
Extension
• Descriptografar conteúdo
• 30 segundos
• Adicionar anexos
• Apenas ignorar
Notification Content
Extension
Notification Content
Extension
Notification Content
Extension
Notification Content
Extension
Agradecimentos
Agradecimentos
• We are hiring!
• Acesse: arctouch.com/brjobs
• Envie seu currículo para:
work@arctouch.com
Pedro van Rooij Costa
twitter: @pedrovanrooij
pedrovanrooij@gmail.com
https://www.linkedin.com/in/pedrovanrooij
Obrigado
Perguntas?

Cocoaheads - Notifications