iOS 7 Development - Adding Push Notification To iOS Apps

This Course will guide you through all the necessary steps required to add Push Notification to your iOS Apps
4.7 (11 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
1,231 students enrolled
$30
Take This Course
  • Lectures 17
  • Contents Video: 1 hour
  • Skill Level Intermediate Level
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 5/2014 English

Course Description

Using Push Notifications is a great way to add real-time messaging to your application. It allows you to stay in touch with your users and makes it possible for your users to communicate with each other. This course will guide you through all the necessary steps required to add this feature to your iOS Apps.

We will begin on the Apple Developer website to create an SSL Certificate associated to an App ID and a Provisioning Profile. Next we'll see how to configure a Parse App on the Parse website, and finally, we'll take a look at creating a push-enabled iOS application and sending notifications to users.

As a bonus, the course shows you how to use NSNotificationCenter to display Push Notification message in UITableViewController.

Why take this course ?

Setting up Push Notifications is often a source of frustration for developers. The process is complicated and invites problems to happen along the way.By the completion of this course, you will have developed the necessary skills required to be able to set up and implement Push Notifications in your iOS Apps.

Course Outline:

* What is Push Notification?

* Registering and Handling Notifications

* Getting to know Parse

* Creating the SSL Certificate & Provisioning Profile

* Sending Push Notifications

* NSNotificationCenter

By the completion of this computer based training course, you will be fully capable of Adding Push Notification from start to finish, including Creating App id and Provisioning Profile in the App Store.

What are the requirements?

  • A mac running at least Mountain Lion OS X 10.8.4
  • Apple Developer Account
  • iOS Device(iPhone or iPad)

What am I going to get from this course?

  • Learn About Push Notifications
  • Learn how to integrate Parse SDK into iOS
  • Learn how to setup an App on Parse.com
  • Learn how to create SSL Certificate & provisioning Profile
  • Learn about NSNotificationCenter

What is the target audience?

  • People with basic knowledge of iOS development

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Introduction.
03:21

Push notifications are way for an application that isn’t running in the foreground to let its users know it has information for them. The information could be a message,calendar event, or new data on a remote server. They can display an alert message or they can badge the application icon. They can also play a sound when the alert or badge number is shown.

When users are notified that the application has a message, event, or other data for them, they can launch the application and see the details. They can also choose to ignore the notification, in which case the application is not activated.

Token Generation and Dispersal
when a application is installed on a device. The system receives the registration request from the application, connects with APNs, and forwards the request. APNs generates a device token using information contained in the unique device certificate. The device token contains an identifier of the device. It then encrypts the device token with a token key and returns it to the device

The device returns the device token to the requesting application as an NSData object. The application must then deliver the device token to its provider in either binary or hexadecimal format. and provider use this token to deliver push notification to the users.

The Notification Payload

Each push notification includes a payload. The payload contains information about how the system should alert the user as well as any custom data you provide. The maximum size allowed for a notification payload is 256 bytes; Apple Push Notification Service refuses any notification that exceeds this limit.

For each notification, compose a JSON dictionary object

02:38

Registering, and Handling Notifications

An application must register with Apple Push Notification service for the operating systems on a device to receive remote notifications sent by the application’s provider.

our app needs to register by calling the registerForRemoteNotificationTypes: method of UIApplication,

The parameter passed to this method specifies the initial types of notifications that the application want to receive. like Alert Badge, and sound.

Handling Remote Notifications

In iOS, you can determine whether an application is launched as a result of the user tapping the action button or whether the notification was delivered to the already-running application by examining the application state. In the delegate’s implementation of theapplication:didReceiveRemoteNotification: method, get the value of theapplicationState property and evaluate it. If the value is UIApplicationStateInactive, the user tapped the action button; if the value isUIApplicationStateActive, the application was front most when it received the notification.

Starting a New Project in Xcode
Preview
01:13
Section 2: Getting to Know Parse
Signing Up as a Parse Developer
Preview
01:22
Integrate Parse Framework into Existing Project
Preview
05:47
Saving Simple Objects to Parse
03:17
Section 3: Creating the SSL Certificate & Provisioning Profile
Generating a Certificate Request
01:04
01:58

https://developer.apple.com/membercenter/index.action

Configure App Id for Development Push Notifications
01:19
Install App Id in Keychain
01:13
Creating & Installing the Provisioning Profile
01:59
Section 4: Configuring & Adding Code
Update Storyboard
02:09
Configure Parse App
01:24
05:46

#import "AppDelegate.h"

#import <Parse/Parse.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

[Parse setApplicationId:@"8M9bfH5d1pb3TEGKH54AdO6N9Wb9BQIR6uqEGRke"

clientKey:@"MxC6HnjvrwXUSjyPofjsKdU2KwzOk2gFtcUX2GIk"];

[PFAnalytics trackAppOpenedWithLaunchOptions:launchOptions];

[application registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound];

// Override point for customization after application launch.

return YES;

}

-(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{

NSLog(@"%@",deviceToken);

PFInstallation *currentInstallation =[PFInstallation currentInstallation];

[currentInstallation setDeviceTokenFromData:deviceToken];

[currentInstallation saveInBackground];

}

-(void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error{

NSLog(@"%@",error);

}

-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{

NSLog(@"%@",userInfo);

}

Section 5: Sending Push Notification
Sending Push Notification from Parse website
01:42
Section 6: NSNotificationCenter
What is NSNotificationCenter?
01:04
08:03

Post Notification

[[NSNotificationCenterdefaultCenter]postNotificationName:@"PushNotificationMessage"object:niluserInfo:userInfo

];

Add Observer

[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(remoteNotifications:) name:@"PushNotificationMessage"object:nil];

MainTableViewController.m

#import "MainTableViewController.h"

@interfaceMainTableViewController ()

@property(nonatomic,strong)NSMutableArray *tableData;

@end

@implementation MainTableViewController

-(NSMutableArray *)tableData{

if (!_tableData) {

_tableData =[[NSMutableArrayalloc]init];

}

return_tableData;

}

- (id)initWithStyle:(UITableViewStyle)style

{

self = [super initWithStyle:style];

if (self) {

// Custom initialization

}

returnself;

}

- (void)viewDidLoad

{

[superviewDidLoad];

// Uncomment the following line to preserve selection between presentations.

// self.clearsSelectionOnViewWillAppear = NO;

// Uncomment the following line to display an Edit button in the navigation bar for this view controller.

// self.navigationItem.rightBarButtonItem = self.editButtonItem;

[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(remoteNotifications:) name:@"PushNotificationMessage"object:nil];

}

-(void)remoteNotifications:(NSNotification *)notifications{

NSString *msg =[[notifications.userInfovalueForKey:@"aps"]valueForKey:@"alert"];

[self.tableData addObject:msg];

[self.tableViewreloadData];

}

- (void)didReceiveMemoryWarning

{

[superdidReceiveMemoryWarning];

// Dispose of any resources that can be recreated.

}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

{

// Return the number of sections.

return 1;

}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{

// Return the number of rows in the section.

returnself.tableData.count;

}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{

static NSString *cellIdentifier =@"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];

// Configure the cell...

cell.textLabel.text=[self.tableDataobjectAtIndex:indexPath.row];

return cell;

}

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Pankaj Chhikara, iOS Developer,Oracle Certified Java Programmer

Hi, my name is Pankaj. I did my Bachelor and Master degree in Computer Engineering and I am a Oracle Certified Java Programmer. I am working as an iOS and Android Developer from last 4 years and worked on plenty of Apps which used some of the features like - User Location,Google Api, Maps ,In-app Purchase,Google ads, iAds,Custom User Interface,Facebook Sdk, Twitter Sdk, Parse Sdk,XML and JSON Parsing,Core Data,Sqlite,Animation,Phone Gap and other Frameworks as well.

Apart from that, I've worked on Web Development and Desktop Development Projects like. REAL ESTATE MANAGEMENT SYSTEM,SCHOOL MANAGEMENT SYSTEM,HORSE RACE BETTING and some other Freelance projects as well.

In my free time i like Travelling and playing Basketball.

Hope you enjoy my courses and please feel free to leave any comments or feedback.

Ready to start learning?
Take This Course