Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

273
Views
How to know if user shared my app or not?

My app is all about getting points and winning money, and what I need to do is let the user share my app then give him some points.

The problem is that I don't know how to detect if the user truly shared the app or not

I'm using the following code:

func shareTapped(){
    let text = "example"
    let url = URL(string: "example.com")
    let image = UIImage(named: "example_image")
    let shareViewController = UIActivityViewController(activityItems: [text, image!, url!] ,applicationActivities: nil)
    self.present(shareViewController, animated: true, completion: {() in
        print("done")
    })
}

The sharing method is working perfectly, but I was wondering if there is any delegate we can call in this situation.

Thanks.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

So there is 2 scenarios where user can cancel share.

One is when UIActivityViewController present then there is a cancel button on UIActivityViewController from where user can cancel it and yes you can detect it with method

shareViewController.completionWithItemsHandler = { activity, completed, items, error in

}

In above method completed will be false if user canceled from UIActivityViewController cancel button. and it will return true if user share successfully but here comes second case with it.

So for second case suppose user want to share via watsapp and click on watsapp icon from UIActivityViewController and watsapp user list appear.

But there is a cancel button on that screen from where user can cancel sharing but still you will get completed flag true so there is no way you can detect if user click on cancel button from watsapp user list.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!