Posts

Post not yet marked as solved
2 Replies
341 Views
I am using outlook in iOS application. From my app I am sending email after giving Subject, email Body & Attachment. Till iOS14 everything was fine. But from iOS15 we are getting Completed bool as NO all the time even if after sending the email. Below is my codebase: Preparing outlook email data while opening Activity controller. NSArray *items = [NSArray arrayWithObjects:str_Receipent, str_EmailSubject, sFileName, str_EmailBody,fileURL,nil];     PMIiSMSPopoverPresentationController *popOverMail;     UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil];     popOverMail = [[PMIiSMSPopoverPresentationController alloc] initWithContentViewController:activityVC];     popOverMail.delegate = self;     popOverMail.popoverContentSize = CGSizeMake(300, 344);           [popOverMail presentModalPopoverFromRect:CGRectMake(700,45,1, 1) object:self inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; Completion handler block [activityVC setCompletionWithItemsHandler:      ^(NSString *activityType, BOOL completed, NSArray *returnedItems, NSError *activityError) {       if (completed) {         NSLog(@"mail sent");         [popOverMail dismissPopoverAnimated:YES];       }       else if((!completed)){         NSLog(@"Fail To Mail send");       }     }]; Here always we are getting NO in Completed Bool even after send email successfully or cancelling the outlook email window. That’s why we are not able to decide for the next action. Please let me know if I am missing anything or did anything wrong and need to improve. Thanks for your help in advance.
Posted
by Rahul9663.
Last updated
.
Post not yet marked as solved
1 Replies
979 Views
I want to use AES-GCM encryption of a plaintext with 'key' only. The 'key' will be received from backend (.net), in webservice response. The same key will be used later in backend as well to decrypt the encrypted value. I have used extension as follwoing To generate string to Symetric key extension SymmetricKey { init(string keyString: String, size: SymmetricKeySize = .bits256) throws { guard var keyData = keyString.data(using: .utf8) else { print("Could not create base64 encoded Data from String.") throw CryptoKitError.incorrectParameterSize } let keySizeBytes = size.bitCount / 8 keyData = keyData.subdata(in: 0..<keySizeBytes) guard keyData.count >= keySizeBytes else { throw CryptoKitError.incorrectKeySize } self.init(data: keyData) } } Encryption & Decryption code snipet: func aesgcmEncryptDecrypt() { let str : String = "FwhXRYJ$xLf?^Kh6_&YfTJ%RuG+EqcTY" var key : SymmetricKey = SymmetricKey(size: .bits256) do{ key = try SymmetricKey(string: str) }catch{ } let plain = "HOW ARE YOU?" let nonce = try! AES.GCM.Nonce(data: Data(base64Encoded: "fv1nixTVoYpSvpdA")!) let tag = Data(base64Encoded: "e1eIgoB4+lA/j3KDHhY4BQ==")! // Encrypt let sealedBox = try! AES.GCM.seal(plain.data(using: .utf8)!, using: key, nonce: nonce, authenticating: tag) // Decrypt let sealedBoxRestored = try! AES.GCM.SealedBox(combined: sealedBox.combined!) let decrypted = try! AES.GCM.open(sealedBoxRestored, using: key, authenticating: tag) Swift.print("Combined:\n(sealedBox.combined!.base64EncodedString())\n") Swift.print("Cipher:\n(sealedBox.ciphertext.base64EncodedString())\n") Swift.print("Nonce:\n(nonce.withUnsafeBytes { Data(Array($0)).base64EncodedString() })\n") Swift.print("Tag:\n(tag.base64EncodedString())\n") Swift.print("Decrypted:\n(String(data: decrypted, encoding: .utf8)!)\n") } Our(generated from this code & .Net code) encrypted text is not matching. Anyone can help me, what I am doing wrong, detailing will be more helpful. Basically I was looking for saloution in Objective-C but I did not get any supported library for Objective-C. Using the AesGcm class
Posted
by Rahul9663.
Last updated
.
Post not yet marked as solved
1 Replies
842 Views
Attachment folder got deleted after completion of XCUITest from Derive path in xcode version 11 GM seed.is there any solution for this latest xcode to save the attachment in derive path?
Posted
by Rahul9663.
Last updated
.