2017-09-20 4 views
2

メッセージアプリケーションとテキストとURLを共有する必要があります。速攻を使用してMasseageアプリでURLとテキストを共有する方法3

if (MFMessageComposeViewController.canSendText()) { 
     let controller = MFMessageComposeViewController() 

     //controller.subject = "http://www.appzoy.com" 

     //controller.attachments?.append(["url" : URL(string : "http://www.appzoy.com")!]) 

     //controller.addAttachmentURL(URL(string : "http://www.appzoy.com")!, withAlternateFilename: "") 

     controller.body = "Hey I just gave an Awesome Assessment on UAssess App you can also try it. I scored \(String(describing: myScore!)) , Try to beat my score" 

     controller.messageComposeDelegate = self 
     self.present(controller, animated: true, completion: nil) 
    } 

    else { 

     Helper.sharedInstance.Print("No Message Composer Present" as AnyObject) 
    }. 

私はまた、URLを渡ししようとしていますが、それは、App 誰でもメッセージアプリケーションでURLリンクやテキストを共有する方法を知っているメッセージにはないだろう。コードの下

+0

SMSは、右のようなテキストやURLを送りたいですか? – ivarun

+0

はい@ivarun私はテキストとURLをSMSとして送信したいと思います。 – kishor0011

答えて

1

試してみてください。これはあなたを助ける

let controller = MFMessageComposeViewController() 

    if (MFMessageComposeViewController.canSendText()) { 

     let urlToShare = "http://www.appzoy.com" 

     controller.body = "Hey I just gave an Awesome Assessment on UAssess App you can also try it. I scored , Try to beat my score \(urlToShare)" 

     controller.messageComposeDelegate = self 
     self.present(controller, animated: true, completion: nil) 
    } 

enter image description here ホープ:)

+0

私もこれをしました。問題はURLリンクが来ていないことです。 – kishor0011

+0

@ kishor0011please check screenshot – ivarun

+0

OKもう一度お試しください。 – kishor0011

関連する問題