This file contains 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
docker run -p 4545:9999 gcr.io/android-battery-historian/stable:3.0 --port 9999 |
This file contains 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
let image = UIImage(assetIdentifier: .ImageIconOne)! |
This file contains 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
let imageNameOne = "icon_image_1" | |
let image1 = UIImage(named: imageNameOne)! | |
//UIImage accepts any string | |
let image2 = UIImage(named: NSFileHandleNotificationFileHandleItem)! |
This file contains 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
let image1 = UIImage(named: "icon_image_1")! | |
let image2 = UIImage(named: "icon_image_2")! | |
let image3 = UIImage(named: "icon_image_3")! |
This file contains 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 UIKit | |
enum AssetIdentifier: String { | |
case ImageIconOne = "icon_image_1" | |
case ImageIconTwo = "icon_image_2" | |
case ImageIconThree = "icon_image_3" | |
} | |
extension UIImage { |
This file contains 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 | |
class SessionManager { | |
public static let sharedInstance = SessionManager() | |
let dataManager: StoreDataManager | |
private init() { | |
self.dataManager = StoreDataManager() | |
} |
This file contains 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
let content = UNMutableNotificationContent() | |
content.title = NSString.localizedUserNotificationString(forKey: "Hello!", arguments: nil) | |
content.body = NSString.localizedUserNotificationString(forKey: "Hello_message_body", arguments: nil) | |
content.sound = UNNotificationSound.default() | |
// Deliver the notification in five seconds. | |
let trigger = UNTimeIntervalNotificationTrigger.init(timeInterval: 5, repeats: false) | |
let request = UNNotificationRequest.init(identifier: "notification_sample_2", content: content, trigger: trigger) | |
// Schedule the notification. |
This file contains 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
UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init]; | |
content.title = [NSString localizedUserNotificationStringForKey:@"Hello!" | |
arguments:nil]; | |
content.body = [NSString localizedUserNotificationStringForKey:@"Hello_message_body" | |
arguments:nil]; | |
content.sound = [UNNotificationSound defaultSound]; | |
UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:5 |
This file contains 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
let center = UNUserNotificationCenter.currentNotificationCenter() | |
center.requestAuthorizationWithOptions([.Alert, .Sound]) { (granted, error) in | |
// Enable or disable features based on authorization. | |
} |
This file contains 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
UNUserNotificationCenter* center = [UNUserNotificationCenter currentNotificationCenter]; | |
[center requestAuthorizationWithOptions:(UNAuthorizationOptionAlert + UNAuthorizationOptionSound) | |
completionHandler:^(BOOL granted, NSError * _Nullable error) { | |
// Enable or disable features based on authorization. | |
}]; |
NewerOlder