Skip to content

Commit

Permalink
Added include for registering for remote notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
kroikie committed Jun 22, 2016
1 parent ecaed27 commit 73cff7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion messaging/FCM/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ - (BOOL)application:(UIApplication *)application
[application registerForRemoteNotificationTypes:allNotificationTypes];
} else {
// iOS 8 or later
// [END_EXCLUDE]
// [START register_for_notifications]
UIUserNotificationType allNotificationTypes =
(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge);
UIUserNotificationSettings *settings =
[UIUserNotificationSettings settingsForTypes:allNotificationTypes categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
[[UIApplication sharedApplication] registerForRemoteNotifications];
// [END register_for_notifications]
}

// [START configure_firebase]
Expand Down
2 changes: 2 additions & 0 deletions messaging/FCMSwift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Register for remote notifications
if #available(iOS 8.0, *) {
// [START register_for_notifications]
let settings: UIUserNotificationSettings =
UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: nil)
application.registerUserNotificationSettings(settings)
application.registerForRemoteNotifications()
// [END register_for_notifications]
} else {
// Fallback
let types: UIRemoteNotificationType = [.Alert, .Badge, .Sound]
Expand Down

0 comments on commit 73cff7d

Please sign in to comment.