Browse Source

share completed

v0.17
yajan 2 years ago
parent
commit
3da16db26c
  1. 10
      GME Remit/Modules/InviteUser/User Interface/View/InviteUserViewController.swift

10
GME Remit/Modules/InviteUser/User Interface/View/InviteUserViewController.swift

@ -84,11 +84,19 @@ class InviteUserViewController: UIViewController {
} }
func shareCode() { func shareCode() {
// let myWebsite = NSURL(string:"https://jmeremit.page.link/?invite=MOB000003")
let referralCode = GMEDB.shared.user.string(.referralCode)
// let myWebsite = NSURL(string:"https://jmeremit.page.link/?invite=\(referralCode)")
////// let shareAll = [text , image! , myWebsite] ////// let shareAll = [text , image! , myWebsite]
// let activityViewController = UIActivityViewController(activityItems: [myWebsite], applicationActivities: nil) // let activityViewController = UIActivityViewController(activityItems: [myWebsite], applicationActivities: nil)
// activityViewController.popoverPresentationController?.sourceView = self.view // activityViewController.popoverPresentationController?.sourceView = self.view
// self.present(activityViewController, animated: true, completion: nil) // self.present(activityViewController, animated: true, completion: nil)
if let name = URL(string: "https://jmeremit.page.link/?invite=\(referralCode!)"), !name.absoluteString.isEmpty {
let objectsToShare = [name]
let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
self.present(activityVC, animated: true, completion: nil)
} else {
// show alert for not available
}
} }
} }

Loading…
Cancel
Save