Giter Site home page Giter Site logo

anbalagand / remindme Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 426 KB

The UNUserNotification Sample illustrates the practical implementation, benefits, and constraints of utilizing the framework APIs for managing user notifications.

Swift 100.00%
customi ios notification-service swift swiftui uikit unusernotifications local-notifications push-notification

remindme's Introduction

UNUserNotification Framework Sample Project

Overview

From iOS 10.0 apple provide UserNotifications framework to handling local and remote notification.

Feature

  1. Permission
  2. Grouping
  3. Trigger
  4. Attachment and Sound
  5. Category and Action
  6. Service extension
  7. Content extension

Permission

iOS 10.0 introduce new UserNotification framework to handle both remote and local notification. And support badge, sound, alert type authorization as well.

iOS 12.0 apple introduce new authorization option provisional, providesAppNotificationSettings and criticalAlert

provisional: The ability to post noninterrupting notifications provisionally to the Notification Center.
providesAppNotificationSettings: An option indicating the system should display a button for in-app notification settings.
criticalAlert: The ability to play sounds for critical alerts.

Grouping

Set threadIdentifier in UNMutableNotificationContent system group the notification using this identifier.

Trigger

iOS support four type of Trigger to schedule notification

  1. UNCalendarNotificationTrigger
  2. UNTimeIntervalNotificationTrigger
  3. UNLocationNotificationTrigger
  4. UNPushNotificationTrigger

Note: Except UNPushNotificationTrigger we can use all other trigger to schedule our notification.

Attachment and Sound

From iOS 10.0 UserNotification framework support to customize notification sound and notification can show attachments.

Limitation:

  • Its support multiple notification but show first attachment only in notification alert.
  • Notification only support .aiff, .wav, or .caf sound file.

Category and Action

UserNotification support notification category. We must register our category objects using the setNotificationCategories(_:) method of UNUserNotificationCenter. Each notification category have associated action. Based on category system will show the appropriate action

Service extension

Service extension give the opportunity to modify notification content before delivery to user. We can use this opportunity to modify notification content. Remote notification payload we must include mutable-content: 1 within apns object otherwise service extension not work.

Content extension

We can customize notification appearance using UNNotificationContentExtension. We shoud adopt this protocol in the custom UIViewController subclass that we use to present our interface

Conclusion

This framework definitely do lot than what we saw here. If you want to learn more should checkout official apple documentation.

UserNotification

remindme's People

Contributors

anbalagand avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.