1

I want to know how to change value of one NSString object in another iOS application in background ? I have already searched on google but I got answer in which he/she suggested Custom URL Scheme. But I want to change NSString object value of one iOS application into another iOS application in background (which is open by first app using using NSURL).

My problem scenario is that there are two application 'A' and 'B', 'A' contains a NSString object called 'string'. Application 'B' opened by application 'A' using Custom URL Scheme, and I performed some operations in application 'B' in which a Web service is called. When web service is called then before coming response of web service if I press home button then application 'B' goes into background but I used some code which handle response in background too. I just want to change the value of 'string' object of application 'A' when response comes in application 'B' in background.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
ajeet sharma
  • 803
  • 10
  • 37
  • You have to use Applcation B's API to get/set data inside. – Jasmin Jul 21 '14 at 06:25
  • I have to change value of 'string' variable of 'A' into application 'B' – ajeet sharma Jul 21 '14 at 06:28
  • 1
    Shared pasteboards might be another option for you if both apps are published by the same vendor. – Jonah Jul 21 '14 at 06:36
  • @Jonah I am using pasteboards, I hope this will solve my problem. Let me check whole scenario, then I will reply you soon.' – ajeet sharma Jul 21 '14 at 09:02
  • @Jonah Its working on simulator and iPod touch(iOS 5.1.1). But not working in iPhone 4 (iOS 7.0.3). And tell me one more thing Is this secure ? Because my application contains some sensitive informations. – ajeet sharma Jul 21 '14 at 10:59
  • It it unfortunate that this is not working for you on a device however I cannot comment as to why that might be without seeing your implementation. Perhaps you should look at some existing questions like http://stackoverflow.com/questions/12360895/named-uipasteboard-between-apps/12360915#12360915 for guidance. I also don't know what "secure" means to you. What is the threat model? Who are you concerned might access this data and what is the impact if they do? – Jonah Jul 21 '14 at 13:55
  • @Jonah : http://stackoverflow.com/questions/24882833/is-ios-uipasteboard-secure – ajeet sharma Jul 22 '14 at 10:29

3 Answers3

2

There's no way to access another app's data. Apple does not allowed that kind of thing. The URL Scheme will be the only answer.

Ryan
  • 4,799
  • 1
  • 29
  • 56
  • Can we launch one iOS application from another iOS application in background ? – ajeet sharma Jul 21 '14 at 06:27
  • 1
    No, that's not possible. There're several jobs which allowed in background such as location service. Launching app is not in the list. – Ryan Jul 21 '14 at 06:28
0

If u keep a database or if ur application fetch data from a webservice(not local), it might be possible. If 2 applications are fetching from a same database, depending on what data you want, you can fetch and manipulate data as well

Saheb Roy
  • 5,899
  • 3
  • 23
  • 35
0

Finally I found solution of this issue, in which I had to send one string from one iOS application to another application, and I did it successfully using NSPasteboard.

ajeet sharma
  • 803
  • 10
  • 37