Sharing PKPass

I am sharing pkpass using UIActivityViewController. It works fine in all other options except Message app. When I select Message option the app crashes. When I debug for the reason I found following in console.

No "UIViewServicePermittedViewControllerClasses" array in View Service bundle "com.apple.mobilesms.compose"'s Info.plist. Cannot check validity of request for class "CKSMSComposeViewServiceController". This will become failure in a future build.

I am using following code to share pass

            let shareData = NSData(contentsOfFile: passUrl.path) // "passUrl" is the pkpass file url stored in document directory.

            var filesToShare = [shareData]

            let item = NSItemProvider(item: shareData, typeIdentifier: "com.apple.pkpass")

            let activityViewController = UIActivityViewController(activityItems: filesToShare, applicationActivities: nil)

//            let activityViewController = UIActivityViewController(activityItems: [passUrl], applicationActivities: nil)

            if let popoverController = activityViewController.popoverPresentationController

            {

                popoverController.sourceView = self.view

            }

            self.present(activityViewController, animated: true, completion: nil)

It also crash when I share direct passUrl in activityItems.

Sharing PKPass
 
 
Q