40
Notifications no iOS 10 Pedro van Rooij Costa

Cocoaheads - Notifications

Embed Size (px)

Citation preview

Notifications no iOS 10Pedro 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 NotificationsTriggers

Time Interval

Local NotificationsTriggersLocation

Local NotificationsTriggersCalendar

Local NotificationsCriando 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 NotificationsCriando 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 CenterDefinindo 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 CenterDefinindo 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 CenterDefinindo categorias de notificações aceitas

User Notification CenterAdicionando uma local notification

User Notification CenterVer local notifications pendentes

User Notification Centerremover local notifications pendentes

User Notification Centerremover todas local notifications pendentes

User Notification Centerver notifications visíveis

User Notification Centerremover notificações visíveis

User Notification Centerremover 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: [email protected]

Pedro van Rooij Costatwitter: @pedrovanrooij

[email protected]://www.linkedin.com/in/pedrovanrooij

Obrigado

Perguntas?