Store and manage files between two applications? - iphone

It is possible to store some application files and share it with another application?
Can application A remove files created in such shared space by application B?

In general, no. There are a few things you can consider.
All apps can read/write/share photos via the user's photos library.
Some apps have been known to share data via the address book. That is, they put data in a special address card which can be read by multiple apps.
If the apps have matching App ID bundle seeds, they can access the same keychain entries. I'm not sure how much data can be stored in the keychain, but it is possible to share data this way.
Apps can pass data to each other via a launch URL. That is, one app can ask iOS to open a URL that launches the next app, and that URL can have parameters that pass data.

No, each application has its own sandbox. Only way to communicate is to use custom URLs to call the other application or have a 'middle man' (eg a computer).

As an alternative to RupertP's answer, the only real work-around is to use a globally-accessible server. A lot of iOS devs use MobileMe's iDisk (not free) or DropBox (free for a limited account).

Related

Different data sources for iPhone app in the App Store

I'm going to release an app in the UK and US App Stores. I would like to have two different data sources according to the store my application is downloaded from. Basically I would like my app to connect to my US servers when downloaded from the US store and to the UK servers when downloaded from the british one.
I was thinking of including the origin URL in the as localised string but I don't think this is a stable solution.
Any idea?
thanks a lot
Claus
I'm not sure, but I don't think the app has knowledge from where it was downloaded from.
You could create two apps, one for UK and one for US, and make the apps only available in their respective local App Stores.
However, depending on the amount of apps you would have to produce (if you intend to distribute your app in more than 2 countries in the future), it might be easier to just ask the user which data source to use on startup, or let him define one in the settings etc.
Or use the iPhone's current language or even location to select the data source.

Application users account registration and login, best way to handle?

First of all, i'm new to Objective-C, so please be patient with me.
I want to add to my application users account management, users can register/log-in into a personal account that will synchronized with database on the internet. I dont have a clue how to do that. I know how to work with sqlite3. I was thinking maybe to create an sqlite3 database on the device. is it possible to store images into sqlite3 database? is it the best and efficient way to manage users on application?
what does sign in with Facebook or Twitter do? is it possible to add them both and another option for someone who doesn't have Facebook or Twitter?
What is the best way to handle account registration and login on iPhone?
Thanks alot!
I want to add to my application users account management, users can register/log-in into a personal account that will synchronized with database on the internet.
AFNetworking or ASIHTTPRequest can help you with this. create a web service api, maybe in php + mysql or any web scripting language you prefer, from the device you can POST your data like username and password and do the logic in your web service.
I was thinking maybe to create an sqlite3 database on the device. is it possible to store images into sqlite3 database?
what is your plan here? why would you create a database on the device? do you want to manage the users locally? if yes, that would be easier and more efficient because you dont need internet connection to create a request to server. and yes its possible to store images in sqlite by storing the image as blob
what does sign in with Facebook or Twitter do? is it possible to add them both and another option for someone who doesn't have Facebook or Twitter?
Yes its possible. you can have three log in options. facebook, twitter, and your custom log in option. if you want to integrate facebook and twitter on your app. there are many tutorial and docs you can find there.
I suggest: this for facebook and download the sample app
What is the best way to handle account registration and login on iPhone?
it depends on your app requirement, if you dont need to store your user data in a database on a cloud server, the best way is to create a local database on device.
This is a broad question - so the answer is going to be very general, little of which has to do with Objective-C, iOS, or Mac specifically.
It sounds like you are creating an application on a mobile device that needs to synchronize data with a database for which the mobile app is a client. One way of managing this is to start with table of users and credentials on your server, e.g. in MySQL. Then you need to write the API on the server side, e.g. in PHP, Rails, Python, etc. Then you will write the web service code on the device that interacts with the server's API.
If you are new to developing on iOS, then I would suggest running through some tutorials on consuming web services, first. That is, I would learn how to connect to pre-existing web services first. You might want to check out the AFNetworking library for Mac and iOS. It has some demo applications. But if you want to stick with the native URL loading system on iOS, there are numerous tutorials available. (Here's one)
I should mention another option is to use Amazon Web Services SimpleDB. There is an iOS SDK. It allows you to execute queries directly against the db without writing the server-side code.
You mentioned sqlite3. This will allow you to manage data on the device; but you state that you want to sync data with some resource on the internet. You can store images in sqlite3; but you can save yourself a lot of hassle by looking into Core Data as an alternative.

printing application for iPhone

I am in the process of developing a printing application for iPhone. Printing happens through
a dedicated remote server, I just need to send the to be printed documents to this server.
I am facing problems in accessing the documents spread across various apps. I have registered for a good number of file-types. With this approach, only apps which have implemented document interaction will show my app in their "open-in" option (ex safari, mail). But what about rest of the files in apps which do not implement the document interaction controller ? (like photos in the default photos app, documents in iBooks etc)
This limitation seriously hinders the purpose of my app.
What is the best way to let every body (I mean every app having printable documents in the device) know that my app is capable of handling print requests ? How to I hook into their action sheets etc ?
Thats simply not possible, you can't hook into other apps from within your sandbox and you can't get out of it unless you don't want to be in the App Store. All you can do is to write the creators of these Apps a nice mail and encourage them to use the UIDocumentInteractionController, in case of Apple the address would be bugreport.apple.com

share data between two separated applications in iPhone

I'm developing two separated applications but there is a plist file for one of those app contains data that I need it on the other one.
is there is any way to get data? in case yes please show me some sample code? what about the NSUserDefault could it be useful?
NSUserDefault will not work. You need to create a custom URL scheme for your app and then you will be able to pass some data to your another app.
follow these url's you will find what you want.
http://www.tutoplanet.com/android-tutorials/ios-sdk-working-with-url-schemes/
http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
NSUserDefaults will not help you at all. Your applications are each sandboxed separately and have access to very little other than their own data.
You can, however, open a file from one app in another. You can see more about that here.
Other Resources
Apple Approved iPhone Inter-process Communication
2-way app integration on the iPhone: How it works

iPhone: Need suggestion for SYNC contact

i want to create a application which sync my iPhone contacts to my server and vice-versa.
i read a article on google Get Google Sync on your phone . i want to this type of feature which directly update the contact without user interaction (however one time setting is desired).
any body have idea how the google sync work .
Please advice me that how can i achieve this task. any suggestion and link is greatly appreciated
I think it's important to separate the two overlapping approaches in your question.
Firstly, Google Sync is essentially a way to use Microsoft Exchange protocols and to setup a Mail / Contact / Calendar profile on an iPhone. The iPhone OS supports this feature, not an iPhone App in the App Store. Google Sync leverages this fundamental capability of the phone by exposing the data (mail, contacts, calendars) via these known protocols. If you want to expose data in this way to your users, setup a Microsoft Exchange server and ask questions on serverfault.
Secondly, there are iPhone apps. iPhone apps sold in the app store are not currently allowed to run in the background. This means you can't emulate functionality like iTunes or Mail where your music plays while you are browsing the web, or mail checking is done while you are playing a game of Mini Squadron. If you want this backgrounding capability, file a bug/enhancement with Apple.. However, you can interact with iPhone contacts (Address Book) via the API.. You can also of course "re-invent the wheel" and expose the data however you like via the internet, and consume that data from a custom iPhone App with the one caveat that users would need to actively launch your application to get to this data and it would not be integrated with the built-in iPhone Calendar, Address Book or Mail applications. Some good examples of that are some of the music community apps that have messaging systems built into them. Presumably that is all being done with web services.
EDIT: It is also worth mentioning that should you go the "iPhone App" route, you should at least consider if push notifications are right for you, and if so how you will handle it.
Have you seen the API-Docs?
http://developer.apple.com/iphone/library/documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/100-Introduction/Introduction.html
Next there is an application I use called Funambol - it is a sync4j Server/Client. They have an open source application to sync contacts on the iPhone. Source is somewhere in their repository, informations here: http://forge.ow2.org/scm/?group_id=96
As slf told you your application must run in foreground. This may limit you.
Good luck & best regards,
Florian
The 3.0 SDK will allow your application to read contact data on the phone.
Web services will allow you to publish that data to your server, and receive updates.
You may also want to use coredata to store a hash of all contact data so you can tell what is new / updated and just send that data to your server.