This question already has an answer here:
Difficulty obtaining capability to SMS via MFMessageComposeViewController in the iPhone simulator
(1 answer)
Closed 7 years ago.
If it possible to simulate sending sms in iPhone Simulator. I am not expecting to really send sms, just to show sms sending panel.
This is my code:
if MFMessageComposeViewController.canSendText() {
let messageVC = MFMessageComposeViewController()
messageVC.messageComposeDelegate = self
messageVC.recipients = ["1111111111", "2222222222"]
messageVC.body = "hello phone"
self.presentViewController(messageVC, animated: true, completion: nil)
} else {
print("Not using messages")
It always just print "Not using messages". Can someone advice, am I doing something wrong?
Thanks!
No it is not possible to show sms sending panel in iOS simulator. You'll have to register for Apple's developer program and test that on the device.
Related
I recently found out that MFMailComposeViewController behaves buggy when entering the recipient email, it causes a loop going in the view as shown in the GIF below: Bug
My implementation of MFMailComposeViewController is pretty standard:
if MFMailComposeViewController.canSendMail() {
let mail = MFMailComposeViewController()
mail.mailComposeDelegate = self
mail.setSubject("Report an issue")
mail.setMessageBody("", isHTML: true)
present(mail, animated: true)
} else {
}
I have not been able to replicate this on iOS 14.6 but other users were able to replicate this behavior. They have iOS 14.3 and 14.4 on iPhone X. I think it has something to do with the iOS version or the specific iPhone model.
Is there any way I can use the simulator to debug MFMailComposeViewController functionality? Even removing canSendMail(), I can't seem to make it works with the simulator.
I have in my application Broadcast Upload extension. In broadcastStarted method I would like to, check does user is logged into my app. I've found how to do it in Apple WWDC presentation, but this resolve not works. Application does not streaming, but status bar showing that App still streaming. Here is my code:
override func broadcastStarted(withSetupInfo setupInfo: [String : NSObject]?) {
let condition = User.isLogged() // THIS IS FALSE
if(condition){
Uploader.startBroadcast(to: "demoChannel1")
}
else{
let userInfo = [NSLocalizedFailureReasonErrorKey: "Not Logged In"]
let error = NSError(domain: "RPBroadcastErrorDomain", code: 401, userInfo: userInfo)
finishBroadcastWithError(error)
print("User is not logged")
}
}
In console I can see message "User is not logged" but I see in status bar something like this
I have checked it in iPhone 8 Plus and iPhone 8 (iOS versions 13.4 and 13.3.1)
I will be grateful for any help
This question already has answers here:
Keyboard overlaying action sheet in iOS 13.1 on CNContactViewController
(7 answers)
Closed 3 years ago.
I just try to call function with below code
func bugVersionPressed() {
let contact = CNMutableContact()
contact.familyName = "aaaa"
contact.givenName = "aaaa"
contact.organizationName = "bbbb"
let addContactVC = CNContactViewController(forNewContact: contact)
let navController = UINavigationController(rootViewController: addContactVC)
navController.view.backgroundColor = .red
navController.modalPresentationStyle = .fullScreen
self.present(navController, animated: true, completion: nil)
}
But the apple seems havent handle keyboard dismiss problem, I CAN'T DISMISS THE KEYBOARD AND I CAN'T GO BACK TO THE HOME PAGE BY PRESS "Cancel"
PIC1 : (Before present to CNContactViewController)
PIC2 : (Bug Case, Keyboard Cannot dismiss)
PIC3 : (Wish Case, Keyboard Dismiss while Clicked "Cancel")
In case I found a AppleStore App https://apps.apple.com/cn/app/%E5%BE%AE%E5%95%86%E5%8A%A0%E7%B2%89%E5%AE%9D-%E5%85%8D%E6%B3%A8%E5%86%8C%E6%B7%BB%E5%8A%A0%E6%B4%BB%E7%B2%89-%E8%81%94%E7%B3%BB%E4%BA%BA%E5%A5%BD%E5%8F%8B%E8%87%AA%E5%8A%A8%E7%94%9F%E6%88%90/id475661774 but same problem. Please tell me what can I do. Many thanks.
The problem doesn't occur in iOS 13, but in iOS 13.1.
I think this is a problem with the CNContactViewController, not CNMutableContact.
I'm sorry, but I don't know how to avoid it because of Apple's framework.
Send a bug report to Apple.
This question already has answers here:
Dismissing alert XCUITest
(3 answers)
Closed 6 months ago.
I need to show alert on screen for any validation case and is working fine. But when working with XCTest I am not able to detect if alert is shown. How can I check UIAlertView or UIAlertController in XCTest case in Xcode. please give any suggestions
You can use addUIInterruptionMonitor to handle UIAlertController in XCTest.
let handler = addUIInterruptionMonitor(withDescription: "alert handler") { (alert: XCUIElement) -> Bool in
let ok = alert.buttons["OK"]
XCTAssertTrue(ok.exists, "OK button doesn't exist")
ok.tap()
}
using xcode swift, I am trying to send several SMS to different persons in one loop. I used a "for X in Y", I checked and it is reading all the X, but I have only the first SMS sent, the others are not sent. I did not manage to wait until the fist SMS is sent to go to the next one.
Below my code:
for recette in Recettes {
var messageVC = MFMessageComposeViewController()
messageVC.body = "Pour demain: \(recette.Sujet)";
messageVC.recipients = [recette.Number]
messageVC.messageComposeDelegate = self;
self.presentViewController(messageVC, animated: false, completion: nil)
}