Set ABPerson custom ringtone - ios

is there any way at all to modify a contact's ringtone in swift/objective-c iOS.
I've already searched for a possible solution without any luck. (PRIVATE APIs are not counted as solutions).
GRingtones is an app that is able to do what i want but no one seems to have any idea what APIs they used.

Related

What is the best way to support Apple Music and Spotify in iOS app?

I am looking to support Apple Music and Spotify in an iOS app (Swift specifically) and I was wondering what the best way to support would be?
Should I just use MusicKit and Spotify iOS SDK and then make models to support data from both?
If so, then how do I find Spotify iOS SDK instances for their structs? For example:
Apple's documentation for Albums shows all of it's instances:
https://developer.apple.com/documentation/musickit/album
But Spotify's documentation for Albums doesn't show many instances:
https://spotify.github.io/ios-sdk/html/Protocols/SPTAppRemoteAlbum.html
That depends on what your app will look like, I guess. Do you want to show Apple Music (AM) and Spotify content alongside each other? Or do you want to strictly separate them into different parts of the app?
For the former, I don’t see a way around creating common structs for albums, artists, tracks, etc. That extra step would ensure your UI always got the same kind of structured object. You’d make the SDK calls, get your AM/Spotify-provided objects, and cast them into the struct you need for your app. You’d probably want to keep track if the struct originated from a AM or a Spotify object.
As to Spotify SDK: If that’s really the only documentation available (which, apparently, it is), you’d probably want to analyze the SDK yourself. What kind of data is returned from these URIs (e.g., JSON/XML data)? What do these SPTAppRemoteAlbum objects actually contain? Can you create intermediary objects for better handling?

iOS App that controls the screen also when backgrounded

Is there any way to implement an iOS app that has access to the screen (e.g. screen recording) also when it's backgrounded? Has anyone experience with this?
Apps like TeamViewer do this, but it's not clear to me if they went through a special process with Apple (e.g. a non-open API).
P.S. I am of course assuming that the user would have to explicitly accept this (e.g. like for system extensions on macOS), the goal here is not to make a malicious app but a remote-control tool.
The only way to record the screen in the background is by using the broadcast upload extension in ReplayKit 2. This WWDC talk goes into more detail around how to use this API https://developer.apple.com/videos/play/wwdc2018/601/
Since it's not specifically designed for your use case you will have to do some things differently like locally storing the frames in your App Group instead of uploading them.

iOS : is it really impossible to get info of current track being played in third-party apps (like Spotify)?

So far, I have red many conflicting answers about this.
In this SO thread, it is said to use:
let player = MPMusicPlayerController.systemMusicPlayer()
if let mediaItem = player.nowPlayingItem {
// ...
}
However, this only works with the iOS player. If the current song is being played by Spotify for example, mediaItem will be nil.
I understand that Apple's policy doesn't allow to access any other application's data. The only thing I am able to do right now is to know if a song is playing from another player with the help of AVAudioPlayer's secondaryAudioShouldBeSilencedHint and isOtherAudioPlaying.
I want to know, however, if there is another way to access it, like using Spotify framework? (I am absolutely non familiar with it, that's just making assumptions).
Thanks for your help.
I am not sure about iOS but the current track can be read from Spotify on a Mac via AppleScript. I use this technique from Objective C. If you're interested I can post the code.
Spotify publish their API for AppleScript here https://developer.spotify.com/applescript-api/
If you're looking for a generic way of determining what is playing then I think that you will be disappointed. Each application will have a different way of retrieving this information.
So yes and no. If you want to specifically only check if Spotify is playing, then perhaps the Spotify iOS SDK provides functionality for such a thing. I really don't know about that SDK's functionality.
I would venture to guess that your actual goal is to see if any third party framework is playing; Pandora, Tidal, Apple Music, Amazon Prime Music, etc. In which case, you would need a framework for each one that provided such functionality.
Apps are sandboxed from each other for security, so yes, there is no way to tell the current track information other than if you have the framework in place and it provides that functionality.

How can i mute incoming text on ios

I know there is no way to read call/sms record in iOS
But i want to mute incoming text sounds with in my app. This setting seems in ringtone so there may be a solution
Let me know is it possible or not
I found another link but no answer
How can I mute incoming iPhone text messages programmatically?
Using public APIs, it is not possible.
The link you found is using private APIs, which aren't documented or guaranteed to work the way you'd expect. If you tried to release an App Store app that called a private API, it would be automatically rejected.

iOS - Google Analytics for one page

I have created a game for iOS and I want to be able to track when people are playing.
By this, I simply mean I want to know how often people are opening the app (and thus find out if users are returning or playing it only once).
Because of this, I don't want to have to include the entire Google Analysics SDK in my project. Does anyone know if it's possible to make a request from in an iOS app (possibly using NSURLRequest?) to call Google Analytics and make it think a web page has been visited?
Thanks in advance.

Resources