Apps cannot set ringtone/message tone programmatically. That's not allowed by iOS. You might be able to save audio files so that user can access them and set them as ringtones himself.
How to add a ringtone from an application to ringtones of iphone?
Hope that helps!