setting the default applications for a file type in iphone - iphone

Hai all,
In my iphone application i want to open a my custom application(available in the iphone) when the user tapes on a particular type file sent by email or MMS ,
for example, if i sent an music file (via email or MMS) with a custom extension (for eg: .muc) i want to open my application (lets say myMusicPlayer) to play that file,
is there any way to do that in iphone ?
thanks in advance

There is currently no way to do this exactly. The only way to open an application is using a URL scheme assigned to your app via the Info.plist file but you wouldn't be able to send the local file system location of your file to it.

Related

How to get cutom sound file to play in Apple Push Notification Service?

I want to play a custom sound file to notify the user. I use java apns as the third party library and I have developed a connector to connect java apns in order to send notifications to devices. I only have the file path of the sound file which is saved in a local drive of the server. To build the payload it requires a string input for the sound attribute. Can somebody help me to solve this problem?
The sound attribute is only intended for supplying a file name of a sound file which is already part of your application installed on the device. You can't send a file from your server in the notification.

Upload files from http to iphone

I want to be able in my app to upload files from my computer(windows,mac...) to the iPhone,so i an looking for a source code in objective-c that open server on iPhone,
but my question is, how i implement an upload from my computer to the device?
Edit
I want to upload the file from a computer that is on the same Network like the device,
something like :
the user will open browser and select a file and it will be upload to the device.
i found CocoaHTTPServer but i really didn't understand how to upload a file to the iPhone with this.
you probably want to upload the file to FTP-server, that shouldn't be a problem.
set up a webservice or json on your server to know what changed, or should be downloaded (depends heavily on your business logic of your app) - it could also be a static textfile
now the problem is how the app knows that there is are new files.
option 1: poll server if user presses a button or on every app start, etc.
option 2: send push notification to your iPhone app, if there are new file.
polling the server would be very easy to implement, compared to sending push notification.
EDIT:
alright i read your edited post. hosting a local webserver on an iphone sounds still weird to me.
another possible solution, that could work for you - if you only want to transfer only a few and rather small files:
enable Document Interaction in your app.
this would allow the user to send the file by mail to your iphone and open the document with your app with the "open in..." dialog .

How can I send my app data from one iPhone to another

I built an app which I can add images and texts, what I would like to do is to pack a data from this app (which I can do that by serializing an object to a file) and send it non-synchronically to another app in another IPhone and open it there (without using the mail nor the internet).
for example if I had MMS on IPhone I could do that by sending the file as MMS and set my app to open files with specific post-fix I choose.
Please help, Thanks.
What do you mean by "without using the internet"? You could use NSNetServices to establish connections between devices, and send whatever you want between them. This relies on the TCP/IP protocol though, but does not use HTTP. So if you mean "without going via HTTP", this should be an alternative:
http://developer.apple.com/library/ios/#documentation/Networking/Conceptual/NSNetServiceProgGuide/Articles/ResolvingServices.html#//apple_ref/doc/uid/20001078-SW1
you use an url scheme for small data, or the new UIDocumentInteractionController

iPhone Push Notification - How to use default sound

I have implemented whole push notification service for my application using easyapns.
I have implemented the server part using php and using the default php classes provided by easyapns.
Now, from server (php file), i am passing sound file name like :
$apns->addMessageSound('bingbong.aiff');
And I am including this 'bingbong.aiff' file in iPhone's Resource folder.
But Now I have a query that is it possible to play a default in-built sound of iPhone device instead of specify it externally ?
Thanks in advance....
Normally $apns->addMessageSound('default'); should do the trick.

Can an iPhone App create and send + receive and read a CSV file as an ATTACHMENT?

I'd like to introduce a feature in my iPhone App that allows the following:
1) creating and sending by email a CSV file from within my iPhone App.
2) importing into my iPhone App a CSV file created with 3rd party software and sent to me by email.
These are the questions:
1a) Is it possible to actually create a CSV file from within the App and send it as an attachment? I know I can send an email containing all the strings required, but I want to be able to send the actual file.
1b) Once created, can this file be stored into the memory allocated to my iPhone App?
2) What procedure should I follow to import a CSV file into my App? I do not want to read the CSV file from a URL.
Can all this be done with the iPhone or not??
Thanks!
1a) Yes, you can use the addAttachmentData:mimeType:fileName: method on an instance of the MFMailComposeViewController class to do that.
1b) Yes, you can write the NSString containing the CSV data to a file using the writeToFile:atomically:encoding:error: method.
2) Yes, in iOS 4 you can subscribe your app to certain file types, go here for more detailed information.