Code Monkey home page Code Monkey logo

mindinventory / mi-customnotification Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 3.0 9.21 MB

Push notifications allow developers to reach users, even when users aren't actively using an app! With the latest update of iOS Apple provide very useful extensions which are user-friendly. In this tutorial, I am going to share the configuration, set up of Notification with the media attachments like.

Home Page: https://www.mindinventory.com/iphone-application-development.php

License: MIT License

Swift 96.50% Ruby 3.50%
swift notifications richnotifications custom notification-service ios iosnotifications extension

mi-customnotification's Introduction

MI-Notification

Push notifications allow developers to reach users, even when users aren't actively using an app! With the latest update of iOS Apple provide very useful extensions which are user-friendly. In this tutorial, I am going to share the configuration, set up of Notification with the media attachments like. Read more from MEDIUM

  • Image
  • Audio
  • Video

IMG_9422 2 IMG_9422 IMG_9423 3

Installation

Install the below pod to your project.

pod 'Firebase/Core'
pod 'Firebase/Messaging

SetUp

Set up the firebase account and Developer account with require AppID, certificate, Provisioning profiles, and Googleserivce file.

Project SetUp

Drag and Drop the file UIApplication+CustomNotification or add the floder MIAppDelegateExtension from the project folder and add to your project.

Modify the AppDelagate

import Firebase

Call FirebaseApp.configure() and NotificationConfiguration(application) in didFinishLaunchingWithOptions Method

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
   FirebaseApp.configure()
   NotificationConfiguration(application)
   return true
}

Set Up NotificationServiceExtension

Add Notification Service extension as per the below screenshot and set up the Notification Service extension inside project

IMG_9416

Notification Service Project SetUp

Drag and Drop the file MIService or add the floder MINotificationServiceExtension from the Notification Service project folder and add to your project.

Modify the NotificationService

Inherit NotificationService from the MIService and wrtie down the following method only

override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
  super.didReceive(request, withContentHandler: contentHandler)
}

NOTE

Please verify the UNNotificationCategory Identifier in UIApplication+CustomNotification file and inside MIService file it should be the same like you set in your notification payload.

Please take care of the bundle id of Notification Service project it should be compulsory prefix with the main project bundle ID. See the demo project's both bundle id main project and Notification Service project BundleId

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MI-Notificaion is MIT-licensed.

mi-customnotification's People

Contributors

ashishpatelmi avatar riddhi-mi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mi-customnotification's Issues

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.