airdrop

Default Sharing in iOS 7

你离开我真会死。 提交于 2020-01-20 12:54:28
问题 I have seen this format (Image shown below) of share option in most of the iOS applications that support iOS 7. Is there a default code/framework available to implement this share option as it is shown in the image below? 回答1: What you are looking for is the UIActivityViewController . Since you asked a general question I can't do more than give you a link to the documentation 回答2: In addition to the accepted answer, a small piece of example code - (void)shareText:(NSString *)text andImage:

Default Sharing in iOS 7

左心房为你撑大大i 提交于 2020-01-20 12:52:21
问题 I have seen this format (Image shown below) of share option in most of the iOS applications that support iOS 7. Is there a default code/framework available to implement this share option as it is shown in the image below? 回答1: What you are looking for is the UIActivityViewController . Since you asked a general question I can't do more than give you a link to the documentation 回答2: In addition to the accepted answer, a small piece of example code - (void)shareText:(NSString *)text andImage:

Send NSArray Via AirDrop

醉酒当歌 提交于 2020-01-17 03:20:30
问题 I have an NSMutableArray self.certificates This array is made up of saved strings and core data. I want to send this through AirDrop. I have checked out serialization and and im trying to send it with the folowing - (void)send{ NSData *jsonData2 = [NSJSONSerialization dataWithJSONObject:self.certificates options:NSJSONWritingPrettyPrinted error:nil]; NSString *jsonString = [[NSString alloc] initWithData:jsonData2 encoding:NSUTF8StringEncoding]; NSLog(@"Electrical Certificates List:\n%@",

restrict airdrop feature for specific app only ios7

本秂侑毒 提交于 2019-12-25 02:26:51
问题 I am creating one application using airdrop feature, I want to pass one message(NSString) from one device to other device. I had completed that part, but I want restrict this feature for my application only. Currently what happen, when I am sending NSString via airdrop (let say Device A) in near by device, the other Device B can receive this string even if my application is not installed in it. My requirement is to share one message from one device to other device only and this thing happen

UIActivityViewController Airdrop - Check the status when 'sent' or 'declined'

一个人想着一个人 提交于 2019-12-22 12:19:13
问题 Is it possible to check if the recipient 'declined' or 'accepted' the share? I want to NSLog 'sent' if sent and NSLog 'declined' if declined by the user. 来源: https://stackoverflow.com/questions/23495399/uiactivityviewcontroller-airdrop-check-the-status-when-sent-or-declined

Creating custom UTI for use with airdrop, iOS

[亡魂溺海] 提交于 2019-12-22 09:46:25
问题 I am using this code in my info.plist: <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeName</key> <string>AirDrop Profile File Type</string> <key>LSHandlerRank</key> <string>Default</string> <key>LSItemContentTypes</key> <array> <string>com.apple.customProfileUTI.customprofile</string> </array> </dict> </array> to declare a custom file type, going by the answer here, and have looked at the linked sample code, but couldn't follow it very well. I have a structure that I am

UIActivityViewController completionHandler how to check if activity send or not successfully?

耗尽温柔 提交于 2019-12-18 05:18:22
问题 I want to send one string via airdrop, I want to call one function when the String is received on other device successfully. I had implemented it through UIActivityViewController and I check it via completionHandler. Here is my scenario : Device A ->send a string To Device B If Device B receive have two option -> Accept or Decline I want to call one function on Device A when Device B will receive or Decline that message. Below is my implementation: UIActivityViewController

Using UIActivityViewController to specify file type

夙愿已清 提交于 2019-12-13 23:10:03
问题 Following up from this question, how would I go about using UIActivityViewController to specify the file type of a file I am sharing over airdrop? 回答1: Worked it out: let myFileManager = FileManager.default var activityArray = [NSURL]() activityArray.removeAll() for (i, data) in dataToShare.enumerated() { let docsurl = try! myFileManager.url(for:.documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false) let myurl = docsurl.appendingPathComponent("shareData\(i).gymProf") var

Share a video from asset library with AirDrop fails

允我心安 提交于 2019-12-10 22:29:37
问题 Using AirDrop, I would like to share a video from the asset library. In regards to AirDrop, the documentation says: When using this service, you can provide NSString, NSAttributedString, UIImage, ALAsset, and NSURL objects as data for the activity items. You may also specify NSURL objects whose contents use the assets-library scheme. You may also provide NSArray or NSDictionary objects that contain the listed data types. What I'm seeing thought is that if the data of the activity item is an

UIDocumentInteractionController prevent Airdrop in the 'Open in' sheet

社会主义新天地 提交于 2019-12-08 16:09:53
问题 In my app, I'm allowing users to share photos via Instagram, which requires the use of UIDocumentInteractionController. Airdrop is automatically detected if the phone supports it. How do I remove it from this ‘Open in’ action sheet? Even if I begin the sharing process with a UIActivityViewController and call setExcludedActivityTypes:, eventually I must use a UIDocumentInteractionController, and when I do, Airdrop appears again. Here is the code when the share button gets tapped: NSURL