Step 01: I can run my app (APP NAME : TextDetectAPP)
Step 02: User press Home button
Step 03:User open the Skype or any third party app (APP NAME : TextDetectAPPMove to Background state )
Spep04: User copy text (I need to get copy text from Skype or or any third party app )
Note :
UIpasteboard is working fine only user developed apps in iOS swift
Shall we have access rights to read text messages from Skype , whats up or any thirds parts apps in iOS swift?
Thanks in Advance
If I understand your question right, you want to get texts that were copied in other apps (Skype, FB etc.). You can do this using the
UIPasteboardclass. Usually texts are copied to the general pasteboard and you can access it without any problems (I've tried with Skype and Message (iOS) applications, it is working). When you open your app back, you can get the copied text from third party apps like this in theapplicationDidBecomeActivedelegate method:You can also use
UIPasteboardChangednotification to listen to changes in pasteboard, however you cannot receive change notifications from other apps. Also your app may not be in background state all the time executing code (unless you enable some specific background modes like Audio, Airplay etc.). So there is no way for you to get the copied texts when you are in background. You either need to use the method above, (or) if your app supports background execution, you can have anNSTimerfire every n seconds that gets the pasteboard content.