To start with:
1. See if device owner is a current Apple Music subscriber.
2. Access their playlists and play songs from them.
3. Search Apple Music and play songs.
From there I can add my new magic way of rating and playing them 😉 in my own database and interface.
I have been trying to decipher the API for item 1 and don't get very far, here is my attempt:
SKCloudServiceController *controller = [SKCloudServiceController new];
[controller requestCapabilitiesWithCompletionHandler:^(SKCloudServiceCapability capabilities, NSError * _Nullable error) {
if (error != nil) {
NSLog(@"Error getting SKCloudServiceController capabilities: %@", error);
} else if (capabilities & SKCloudServiceCapabilityMusicCatalogPlayback) {
// The user has an active subscription
NSLog(@"YES SUBSCRIBED!!!!");
} else {
// The user does *not* have an active subscription
NSLog(@"NOT SUBSCRIBED!!!!");
}
}];
Resulting in this:
Msic[1596:220976] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""
Msic[1596:220976] SSAccountStore: Failed to fetch the backing accounts. error = Error Domain=com.apple.accounts Code=9 "(null)"
Msic[1596:221058] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""
Msic[1596:221058] SSAccountStore: Failed to fetch the backing accounts. error = Error Domain=com.apple.accounts Code=9 "(null)"
Msic[1596:221058] SSAccountStore: Unable to get the local account. error = Error Domain=SSErrorDomain Code=100 "Cannot connect to iTunes Store" UserInfo={NSLocalizedDescription=Cannot connect to iTunes Store}
Msic[1596:220976] Error getting SKCloudServiceController capabilities: Error Domain=SKErrorDomain Code=6 "The requesting app does not have the necessary permissions" UserInfo={NSLocalizedDescription=The requesting app does not have the necessary permissions}
(lldb)
Thanks
PS: Sorry this reply took so long to appear but it was taking more than a day to get moderated because the target output of xcode uses dates in the format YYYY-MM-DD which forces moderation ??????
I just got rid of dates and time to get it through unmoderated 🙂🙂🙂