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
EarlGrey.select(elementWithMatcher: grey_text("Welcome")) |
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
EarlGrey.select(elementWithMatcher: grey_accessibilityID("Add")).perform(grey_tap()) |
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
EarlGrey.select(elementWithMatcher: grey_accessibilityID("Username")).perform(grey_typeText("<Text>")) |
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
Install Appium | |
1. brew install node | |
2. npm install | |
3. npm install -g appium | |
4. npm install -g appium-doctor | |
5. npm install wd | |
6. brew install libimobiledevice --HEAD | |
7. brew install ideviceinstaller | |
8. npm install -g ios-deploy | |
9. sudo gem install xcpretty |
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
// NSStringMask Mask Patern for Phone Number Format String | |
// - --- --- -- -- | |
(\d{1}) (\d{3}) (\d{3}) (\d{2}) (\d{2}) | |
// NSStringMask Mask Patern for Phone Number Format String | |
// - (---) --- -- -- | |
(\d{1}) \((\d{3})\) (\d{3}) (\d{2}) (\d{2}) |
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 UserNotifications | |
class NotificationService: UNNotificationServiceExtension { | |
var contentHandler: ((UNNotificationContent) -> Void)? | |
var bestAttemptContent: UNMutableNotificationContent? | |
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { | |
self.contentHandler = contentHandler | |
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) |
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
{ | |
"aps" : { | |
"alert" : { | |
"title" : "Test Title Message", | |
"body" : "Yunus TEK" | |
}, | |
"badge" : 1, | |
"sound": "default" | |
} | |
} |
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
{ | |
"aps" : { | |
"alert" : { | |
"title" : "Test Title Message", | |
"body" : "Yunus TEK" | |
}, | |
"badge" : 1, | |
"sound": "default", | |
"mutable-content":1 |
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
/// Bir görüntüyü indirmek ve bir bildirimde sunmak için bu işlevi kullanın | |
/// - Parametereler: | |
/// - url: Resmin url'i | |
/// - completion: Görüntüyü, sonuç olarak UNNotificationAttachment biçiminde döndür | |
private func downloadImageFrom(url: URL, with completionHandler: @escaping (UNNotificationAttachment?) -> Void) { | |
let task = URLSession.shared.downloadTask(with: url) { (downloadedUrl, response, error) in | |
// 1. Url yoksa nil gönder ve geri dön | |
guard let downloadedUrl = downloadedUrl else { | |
completionHandler(nil) | |
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
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { | |
self.contentHandler = contentHandler | |
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) | |
guard let bestAttemptContent = bestAttemptContent, // 1. bestAttemptContent nil olmadığına emin ol | |
let apsData = bestAttemptContent.userInfo["aps"] as? [String: Any], // 2. Payload dan aps'i al | |
let attachmentURLAsString = apsData["mediaUrl"] as? String, // 3. mediaUrl'i al | |
let attachmentURL = URL(string: attachmentURLAsString) else { // 4. String'i URL'e çevir | |
return | |
} |