This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // accessing the window and changing the root view controller property | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // getting access to the window object from SceneDelegate | |
| guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, | |
| let sceneDelegate = windowScene.delegate as? SceneDelegate | |
| else { | |
| return | |
| } | |
| let viewcontroller = UIViewController() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| don't forget to add in app gradle: | |
| compile 'com.squareup.retrofit2:retrofit:2.3.0' | |
| and add INTERNET permission to AndroidManifest | |
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
| ...> | |
| <uses-permission android:name="android.permission.INTERNET" /> | |
| <application... /> | |
| /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| extension Date { | |
| func toString(format: String = "yyyy-MM-dd") -> String { | |
| let formatter = DateFormatter() | |
| formatter.dateStyle = .short | |
| formatter.dateFormat = format | |
| return formatter.string(from: self) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Note: You MUST have curl 7.47+ with http/2 support compiled in | |
| curl -v \ | |
| -d '{"aps":{"alert":"<message>","badge":42}}' \ | |
| -H "apns-topic: <bundle id>" \ | |
| -H "apns-priority: 10" \ | |
| --http2 \ | |
| --cert <certificate file> \ | |
| https://api.development.push.apple.com/3/device/<device token> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // UIDeviceHardware.h | |
| // | |
| // Used to determine EXACT version of device software is running on. | |
| #import <Foundation/Foundation.h> | |
| @interface UIDeviceHardware : NSObject | |
| - (NSString *) platform; |