Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. //Configure first service firebase
  2. let filePath1 = Bundle.main.path(forResource: "GoogleService-Info", ofType: "plist")
  3. guard let fileopts1 = FirebaseOptions(contentsOfFile: filePath1!)
  4. else { assert(false, "Couldn't load config file") }
  5. FirebaseApp.configure(name: "first", options: fileopts1)
  6.  
  7. //Configure second service firebase
  8. let filePath = Bundle.main.path(forResource: "GoogleService-Cuarto", ofType: "plist")
  9. guard let fileopts = FirebaseOptions(contentsOfFile: filePath!)
  10. else { assert(false, "Couldn't load config file") }
  11. FirebaseApp.configure(options: fileopts)
  12.  
  13. Messaging.messaging().delegate = self
  14.  
  15. if #available(iOS 10.0, *) {
  16. // For iOS 10 display notification (sent via APNS)
  17. UNUserNotificationCenter.current().delegate = self
  18.  
  19. let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
  20. UNUserNotificationCenter.current().requestAuthorization(
  21. options: authOptions,
  22. completionHandler: {_, _ in })
  23. } else {
  24. let settings: UIUserNotificationSettings =
  25. UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
  26. application.registerUserNotificationSettings(settings)
  27. }
  28.  
  29. application.registerForRemoteNotifications()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement