Whatsapp link on products?

后端 未结 4 1036
离开以前
离开以前 2021-02-13 18:41

For the iPhone Apps, is it possible to have a Whatsapp link on products? Once link it would send a message to my mobile number through whatsapp. Please advice.

相关标签:
4条回答
  • 2021-02-13 19:07

    You do it either of the method as tafh suggested which is custom method or as an iOS app developer I would suggest you to go with document interaction controller, initialize a UIDocumentInteractionController. These both with help you manage interactions. Check the link below for more information.

      (UIDocumentInteractionController *) setupControllerWithURL: (NSURL) fileURL
            usingDelegate: (id <UIDocumentInteractionControllerDelegate>) interactionDelegate {
    
        UIDocumentInteractionController *interactionController =
            [UIDocumentInteractionController interactionControllerWithURL: fileURL];
        interactionController.delegate = interactionDelegate;
    
        return interactionController;
    }
    

    Here

    0 讨论(0)
  • 2021-02-13 19:10

    I'm not sure exactly what you mean but perhaps this is what you're looking for: http://www.whatsapp.com/faq/en/iphone/23559013

    NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%2C%20World!"];
    if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
    [[UIApplication sharedApplication] openURL: whatsappURL];
    }
    
    0 讨论(0)
  • 2021-02-13 19:10

    you should look at below link

    http://handleopenurl.com/scheme/833

    it will give you all open url scheme option for all apps and you can register your app as well.

    0 讨论(0)
  • 2021-02-13 19:31
    notification = @"Your Daily Inspiration by the ";
    notification = [notification stringByAppendingString:@"\n"];    
    notification = [notification stringByAppendingString:textview.text];
    NSString *whats=notification;
    NSString *baseURL = [NSString stringWithFormat:@"whatsapp://send?text=%@",whats];
    NSURL *url = [NSURL URLWithString:[baseURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
    
    if ([[UIApplication sharedApplication] canOpenURL: url]) {
        [[UIApplication sharedApplication] openURL: url];
    }
    else
    {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Sorry"
                                                            message:@"You can't send a thought on Whatsapp"
                                                           delegate:self
                                                  cancelButtonTitle:@"OK"
                                                  otherButtonTitles:nil];
        [alertView show];
    
    }
    

    used this code i m sending following string on whatsapp

    0 讨论(0)
提交回复
热议问题