title: how to show badge number and sound after receiving push notification via Firebase Cloud Messaging?
body: <p>I am trying to implement push notification via Firebase Cloud Messaging to my iOS app. I can set the firebase console and APN perfectly, I can get the notification that sent via Firebase console in my device.</p>
  
  <p>but, when I get the notification, it just shows the alert, no sound, no number in the badge, even though I have stated  <code>UNAuthorizationOptions = [.alert, .badge, .sound]</code> here is the code I use in the app delegate</p>
  
  <pre><code>import UIKit
  import Firebase
  import UserNotifications
  
  @UIApplicationMain
  class AppDelegate: UIResponder, UIApplicationDelegate, MessagingDelegate {
  
      var window: UIWindow?
  
  
      func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {
  
          FirebaseApp.configure()
  
  
          if #available(iOS 10.0, *) {
              // For iOS 10 display notification (sent via APNS)
              UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
  
              let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
              UNUserNotificationCenter.current().requestAuthorization(
                  options: authOptions,
                  completionHandler: {_, _ in })
          } else {
              let settings: UIUserNotificationSettings =
                  UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
              application.registerUserNotificationSettings(settings)
          }
  
          application.registerForRemoteNotifications()
  
          Messaging.messaging().delegate = self
          let token = Messaging.messaging().fcmToken
          print("FCM token: \(token ?? "")")
  
  
  
  
  
  
  
  
          return true
      }
  
  
  
      func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String){
          print("Firebase registration token: \(fcmToken)")
  
      }
  
  
  
  
  
  
  }
  </code></pre>
  
  <p>I also set <code>"FirebaseAppDelegateProxyEnabled"</code> to YES in my Info.plist. and here is my podfile </p>
  
  <pre><code># Uncomment the next line to define a global platform for your project
   platform :ios, '9.0'
  
  target 'Firebase Push Notification' do
    # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!
  
    # Pods for Firebase Push Notification
  
      pod 'Firebase/Core'
      pod 'Firebase/Messaging'
  
  end
  </code></pre>
  
  <p>so how to add the sound and the badge when I receive the notification?</p>