airdrop

Airdrop: making a custom URL scheme be less ugly for recipient

自古美人都是妖i 提交于 2019-12-08 12:46:20
问题 I'm using Airdrop to send a custom URL to cause my app to open on the other device with the relevant info. It works fine, but it looks really ugly on the receiving device, because they receive a message that quotes the URL as thing being sent, for example schemename://123456 . Is there any way to either make the message look nicer, or get the receiving device to tell you which app it wants to open the information in, rather than showing the cryptic looking URL? 回答1: Make a custom object that

How to send and receive custom data with AirDrop

£可爱£侵袭症+ 提交于 2019-12-06 11:06:10
问题 I've been struggling with this for ages now as I can't find any detailed examples. In my app I have an array of custom data that I want to send to another user with the same app, via AirDrop. The first step is sending the data: @IBAction func share_Button_Click(sender: UIBarButtonItem) { let dataToShare: NSData = getMyCustomNSData() let controller = UIActivityViewController(activityItems: [dataToShare], applicationActivities: nil) controller.excludedActivityTypes =

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

ぃ、小莉子 提交于 2019-12-06 05:31:36
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

How to send and receive custom data with AirDrop

主宰稳场 提交于 2019-12-04 16:46:43
I've been struggling with this for ages now as I can't find any detailed examples. In my app I have an array of custom data that I want to send to another user with the same app, via AirDrop. The first step is sending the data: @IBAction func share_Button_Click(sender: UIBarButtonItem) { let dataToShare: NSData = getMyCustomNSData() let controller = UIActivityViewController(activityItems: [dataToShare], applicationActivities: nil) controller.excludedActivityTypes = [UIActivityTypePostToFacebook, UIActivityTypePostToTwitter, UIActivityTypePostToWeibo, UIActivityTypePrint,

Customize the AirDrop alert description in IOS

与世无争的帅哥 提交于 2019-12-03 08:00:20
问题 I have the following code to send a URL through AirDrop : NSString* selfUrlScheme = [[[[[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleURLTypes"] objectAtIndex:0] valueForKey:@"CFBundleURLSchemes"] objectAtIndex:0]; NSURL* schemeURL = [NSURL URLWithString: [NSString stringWithFormat: @"addList:%@,%@", self.list.uniqueID, selfUrlScheme]]; NSArray *objectsToShare = @[schemeURL]; controller = [[UIActivityViewController alloc] initWithActivityItems:objectsToShare

Share via AirDrop only

試著忘記壹切 提交于 2019-12-01 10:50:02
I want to bring out the share sheet with the AirDrop as the only option in my application. In iOS 7, I could simple add all share types to the excludedActivityTypes property of UIActivityViewController ( UIActivityTypeMessage , UIActivityTypeMail , ...) But now in iOS 8, with the app extensions, the users may have extra sharing providers that show up. Is there any way to show AirDrop only ? UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:@[[NSURL URLWithString:url]] applicationActivities:nil]; NSArray *excludedActivities = @

Share via AirDrop only

时间秒杀一切 提交于 2019-12-01 07:57:44
问题 I want to bring out the share sheet with the AirDrop as the only option in my application. In iOS 7, I could simple add all share types to the excludedActivityTypes property of UIActivityViewController ( UIActivityTypeMessage , UIActivityTypeMail , ...) But now in iOS 8, with the app extensions, the users may have extra sharing providers that show up. Is there any way to show AirDrop only ? UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:@[[NSURL

Default Sharing in iOS 7

这一生的挚爱 提交于 2019-11-29 20:44:46
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? Abizern 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 sjaak bakker In addition to the accepted answer, a small piece of example code - (void)shareText:(NSString *)text andImage:(UIImage *)image andUrl:(NSURL *)url { NSMutableArray *sharingItems = [NSMutableArray new]; if

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

和自甴很熟 提交于 2019-11-29 08:45:14
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 *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[self.customURLContainer]

Is there a way of getting a Mac's icon given its model number?

别等时光非礼了梦想. 提交于 2019-11-27 16:08:56
I know you can get the current machine's icon from cocoa using the following code: NSImage *machineIcon = [NSImage imageNamed:NSImageNameComputer]; But is it possible to get the icon when given just a model number? Such as MacBookPro11,3 ? The reason I need this is because I'm using MultiPeer Connectivity to browse devices on the network that I'd like to connect to. But I want to display the icons from those devices in a customized browser view. I know that OS X has pretty much every icon for all the devices in the following folder: /System/Library/CoreServices/CoreTypes.bundle/Contents