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
| function pullJSON() { | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| var sheets = ss.getSheets(); | |
| var sheet = ss.getActiveSheet(); | |
| var url="http://br-acampa-abu.herokuapp.com/compras/api/"; // Paste your JSON URL here | |
| var response = UrlFetchApp.fetch(url); // get feed | |
| var dataAll = JSON.parse(response.getContentText()); // |
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 UIKit | |
| extension UIImageView { | |
| public func imageFromServerURL(urlString: String, completion: @escaping (String?, Error?) -> Void) { | |
| self.image = nil | |
| print(urlString) | |
| let urlStringNew = urlString.replacingOccurrences(of: " ", with: "%20") | |
| URLSession.shared.dataTask(with: NSURL(string: urlStringNew)! as URL, completionHandler: { (data, response, error) -> Void in | |
| if error != nil { |
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
| @UIApplicationMain | |
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| var window: UIWindow? | |
| func application(_ application: UIApplication, didFinishLaunchingWithOptions | |
| launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
| //=====================ADD ESSAS LINHAS==================== |
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
| //Quando a notificacao é respondida | |
| func userNotificationCenter(_ center: UNUserNotificationCenter, | |
| didReceive response: UNNotificationResponse, | |
| withCompletionHandler completionHandler: | |
| @escaping () -> Void) { | |
| //--------------------------Linhas Adicionadas---------------------------- | |
| //Chamando identificador de ações | |
| let identificador = response.actionIdentifier |
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
| func enviarNotificacao(_ titulo:String, _ subtitulo:String, _ mensagem:String, | |
| _ identificador:String, _ tempo:TimeInterval) { | |
| //Essa instancia de classe é necessária para criar o corpo da notificação | |
| let contexto = UNMutableNotificationContent() | |
| //Criando corpo da notificação | |
| contexto.title = titulo | |
| contexto.subtitle = subtitulo | |
| contexto.body = mensagem |
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
| func enviarNotificacao(_ titulo:String, _ subtitulo:String, _ mensagem:String, | |
| _ identificador:String, _ tempo:TimeInterval) { | |
| //Essa instancia de classe é necessária para criar o corpo da notificação | |
| let contexto = UNMutableNotificationContent() | |
| //Criando corpo da notificação | |
| contexto.title = titulo | |
| contexto.subtitle = subtitulo | |
| contexto.body = mensagem |
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 UIKit | |
| import UserNotifications | |
| class ViewController: UIViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| } | |
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
| extension AppDelegate: UNUserNotificationCenterDelegate { | |
| func enviarNotificacao(_ titulo:String, _ subtitulo:String, _ mensagem:String, | |
| _ identificador:String, _ tempo:TimeInterval) { | |
| //Essa instancia de classe é necessária para criar o corpo da notificação | |
| let contexto = UNMutableNotificationContent() | |
| //Criando corpo da notificação | |
| contexto.title = titulo |
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 UIKit | |
| class ViewController: UIViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| //call | |
| guard let confettiImageView = UIImageView.fromGif(frame: view.frame, resourceName: "cat") else { return } |
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 UIKit | |
| //Importamos a framework | |
| import UserNotifications | |
| @UIApplicationMain | |
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| var window: UIWindow? |