(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>DVTConsoleDebuggerInputTextColor</key> | |
| <string>0 0 0 1</string> | |
| <key>DVTConsoleDebuggerInputTextFont</key> | |
| <string>SFMono-Bold - 11.0</string> | |
| <key>DVTConsoleDebuggerOutputTextColor</key> | |
| <string>0 0 0 1</string> |
| .monaco-shell { | |
| font-family: "Operator Mono", "Inconsolata", monospace; | |
| } | |
| /* This makes the dirty tab circle yellow */ | |
| .vs-dark | |
| .monaco-workbench | |
| > .part.editor | |
| > .content | |
| > .one-editor-silo |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| curl -i -H 'Content-type: application/json' -H 'Authorization: key=<your_server_key>' -XPOST https://fcm.googleapis.com/fcm/send -d '{ | |
| "registration_ids":["registration_ids", "of the", "target", "devices as array"], | |
| "notification": { | |
| "title":"Title of your notification", | |
| "body":"content of your notification" | |
| }, | |
| "data": { | |
| "key1" : "value1", | |
| "key2" : "value2", | |
| "key3" : 23.56565, |
| // HTTP URL : https://fcm.googleapis.com/fcm/send | |
| { | |
| "registration_ids":["XXXXXXXXXXXX:APA91XXXX7ziO-XXXXXXXXXXXXXXXXXXXXXX3B7OzLmNoAfHmZ3ju1M8gk7d-fYwXXXXXXdOHiwNhP6ThXNizSAu-Q0RkywWR8YCEiXf6a4Y803HY1t-XXXXXXXXXXX"], | |
| "notification": { | |
| "title":"Venue change for Avengers secret meet", | |
| "body":"Tap here to open location on your phone" | |
| }, | |
| "data": { | |
| "latitude" : "39.204720", | |
| "longitude" : "-96.564909", |
| func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { | |
| print("Dhruw: Dumping notification payload") | |
| if application.applicationState != .active { | |
| let value1: String? = userInfo["key1"] as? String | |
| let value2: String? = userInfo["key2"] as? String | |
| let value3: Bool? = userInfo["key3"] as? Bool | |
| // do something with the received data | |
| } | |
| } |
| // displaying only relevant content not all the functions | |
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
| // other stuff of didFinishLaunchingWithOptions inside app delegate | |
| if #available(iOS 10.0, *) { | |
| UNUserNotificationCenter.current().delegate = self | |
| let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound] | |
| UNUserNotificationCenter.current().requestAuthorization( |