You can obtain the source and example programs at https://github.com/audiogum/iossdk.
Initialise the SDK with client key and secret
-initWithClientId:(NSString *)clientid clientSecret:(NSString *)clientSecret deviceId:(NSString *)deviceId
-initWithClientId:(NSString *)clientid clientSecret:(NSString *)clientSecret deviceId:(NSString *)deviceId configuration:(AGMConfiguration)configuration
clientId
client key issued by AudiogumclientSecret
client secret issued by AudiogumdeviceId
unique device identifierconfiguration
configuration options to be used in this instance (optional)Initialise the SDK with AccessToken
-initWithAccessToken:(AGMAccessToken *)accessToken deviceId:(NSString *)deviceId
-initWithAccessToken:(AGMAccessToken *)accessToken deviceId:(NSString *)deviceId configuration:(AGMConfiguration *)configuration
accessToken
access token issued by Audiogum APIdeviceId
unique device identifierconfiguration
optional configuration specifying SDK optionsIP address lookup based upon client IP address. This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com
Requires signin scope.
-(FBLPromise<AGMIpLookup *> *) getIpMap
Gets country-specific configuration including both service configuration such as which content services are supported, and custom configuration settings for the client.
Requires signin scope.
-(FBLPromise<AGMAppConfig *> *) getAppConfig
Allows upload of arbitrary user config key/value pairs to store settings.
Requires write_userprofile scope.
-(FBLPromise<AGMUserConfig *> *) updateUserConfig:(AGMUserConfig *)userConfig
userConfig
oem-specific user configAdd or update user config by key
Requires write_userprofile scope.
-(FBLPromise<AGMUserConfig *> *) updateUserConfigByKey:(NSString *)key withConfig:(AGMUserConfig *)value
key
config keyvalue
config valueDelete user config by key
Requires write_userprofile scope.
-(FBLPromise<NSNull *> *) deleteUserConfigByKey:(NSString *)key
key
key to deleteGets previously stored key/value pairs.
Requires read_userprofile scope.
-(FBLPromise<AGMUserConfig *> *) getUserConfig
Get user config by key
Requires read_userprofile scope.
-(FBLPromise<AGMUserConfig *> *) getUserConfigByKey:(NSString *)key
key
config keyAllows upload of a Base64 encoded JPG or PNG image with maximum size 800px x 800px. Once in place, an imageuri property will be added to the user account.
Requires write_userprofile scope.
-(FBLPromise<AGMUserImage *> *) updateUserImage:(AGMUserImage *)image
image
image to addDelete user image
Requires write_userprofile scope.
-(FBLPromise<NSNull *> *) deleteUserImage
Add or update user profile image
Requires write_userprofile scope.
-(FBLPromise<AGMUserImage *> *) updateUserProfileImageById:(NSString *)profileId WithImage:(AGMUserImage *)image
image
image to addprofileId
User Profile IDRemove user profile image
Requires write_userprofile scope.
-(FBLPromise<NSNull *> *) deleteUserProfileImageById:(NSString *)profileId
profileId
User Profile IDNative client user email reset - sends a password reset email
-(FBLPromise<NSNull *> *) public func resetUserPasswordForEmail:(NSString *)email
email
email addressLogin a user and set their token
-(FBLPromise<NSNull *> *) loginUserWithEmail:(NSString *)email withPassword:(NSString *)password withScope:(NSString *)scope
-(FBLPromise<NSNull *> *) loginUserWithEmail:(NSString *)email withPassword:(NSString *)password
email
email addresspassword
passwordscope
scopeLogin an external (shadow account) user and set their token
-(FBLPromise<NSNull *> *) loginExternalUserWithId:(NSString *)externalUserId withCountryCode:(NSString *)countryCode withScope:(NSString *)scope
-(FBLPromise<NSNull *> *) loginExternalUserWithId:(NSString *)externalUserId withCountryCode:(NSString *)countryCode
-(FBLPromise<NSNull *> *) loginExternalUserWithId:(NSString *)externalUserId
externalUserId
external user idcountryCode
country codescope
scopeLogin a mobile user and set their token
-(FBLPromise<NSNull *> *) loginMobileUser:(NSString *)mobileNumber withCode:(NSString *)code withScope:(NSString *)scope
-(FBLPromise<NSNull *> *) loginMobileUser:(NSString *)mobileNumber withCode:(NSString *)code
mobileNumber
mobile numbercode
verification codescope
scopeLogs the user out of the API, clearing any cached data present.
logoutUser
Check if a user is logged in
-(BOOL) isUserLoggedIn
Get the url for the login page
-(FBLPromise<AGMURL *> *) getLoginUrlForScope:(NSString *)scope forService:(NSString *)service withState:(NSString *)state
scope
scopeservice
service to login tostate
stateRegiser a new user. Assumes password been confirmed on client
-(FBLPromise<AGMAccessToken *> *) createUserWithFirstName:(NSString *)firstName withLastName:(NSString *)lastName withEmail:(NSString *)email withPassword:(NSString *)password
firstName
first namelastName
last nameemail
email addresspassword
passwordGet user account details by userid Gets the full account details.
Requires read_userprofile scope.
-(FBLPromise<AGMUserInfo *> *) getUser
If currentpassword or newpassword are passed both are required otherwise any non-password field can be submitted optionally. If email is included for update, this will not be updated immediately but a verification email will be sent. Once the verification link is clicked, the email will update.
Requires write_userprofile scope.
-(FBLPromise<AGMUserInfo *> *) updateUserWithUserInfo:(AGMUserInfo *)userinfo
userInfo
user infoGet user profiles
Requires read_userprofile scope.
-(FBLPromise<AGMUserProfiles *> *) getUserProfiles
Add or updates user profile
Requires write_userprofile scope.
-(FBLPromise<AGMUserProfile *> *) updateUserProfile:(AGMUserProfile *)userProfile
userProfile
User ProfileUpdate user profile details
Requires write_userprofile scope.
-(FBLPromise<AGMUserProfile *> *) updateUserProfileById:(AGMUserProfile *)userProfile withProfile:(NSString *)profileId
userProfile
User ProfileprofileId
User Profile IDGet user profile details
Requires read_userprofile scope.
-(FBLPromise<AGMUserProfile *> *) getUserProfileById:(NSString *)profileId
profileId
User Profile IDDelete a user profile
Requires write_userprofile scope.
-(FBLPromise<NSNull *> *) deleteUserProfileById:(NSString *)profileId
profileId
User Profile IDNative client verification - verifies a user's mobile number
-(FBLPromise<NSNull *> *) verifyUserMobile:(NSString *)mobileNumbre withCode:(NSString *)code
mobileNumber
mobile numbercode
verification codeNative client verification - sends a verification email
-(FBLPromise<NSNull *> *) verifyUserEmail:(NSString *)email
email
email addressCheck if an account exists Check if an account exists by email address
-(FBLPromise<NSNull *> *) checkUserExistsByEmail: (NSString *)email withValidation:(BOOL)validate
-(FBLPromise<NSNull *> *) checkUserExistsByEmail: (NSString *)email
email
The Email address to look upvalidate
Flag to enable email address validationGet help and support content Requires signin scope.
-(FBLPromise<AGMSupportDocumentation *> *) getSupportDocumentationForLanguage:(NSString *)language
language
Language code to look for; falls back to enSends support email
Requires signin scope.
-(FBLPromise<NSNull *> *) sendSupportEmail:(NSString *)supportEmail
supportEmail
email to send-(FBLPromise<LinkedServiceList *> *) getUserServices
Gets a list of services the user has linked to their account.
Requires read_userprofile scope.
-(FBLPromise<LinkedService *> *) getUserService:(NSString *)serviceId
Gets details of a specific content service linked to the user's account, if available.
Requires read_userprofile scope.
serviceId
id of the service to fetch details ofGets an authorize URI to start a OAuth2 flow with the content service.
Requires write_userprofile scope.
-(FBLPromise<AGMUserServiceAuthorizeDetails *> *) startServiceAuthorization:
serviceId
id of the content service.Obtain or refresh a service access token
Requires write_userprofile scope.
-(FBLPromise<AGMUserServiceCredentials *> *) obtainServiceTokenForService: code:
serviceId
id of the content service.code
optional OAuth2 authorization code from the service.Remove a service access token
Requires write_userprofile scope.
-(FBLPromise<NSNull *> *) removeServiceTokenForService:
serviceId
id of the content service.Browse content services. Returns a list of items of type category; which can be explored with the ultimate goal of drilling down to items of types such as internetradio, audiobook or playlist. To explore a category, pass it's ref to this API in the parent parameter. Some services will return nested items within the category meaning no is required to explore further.
Requires search scope.
-(FBLPromise<AGMSearchResultsGroup *> *) browseService:(NSString *)service forParent:(NSString *)parent withStart:(NSNumber *)startindex andItemsPerPage:(NSNumber *)itemsperpage andChildren:(NSNumber *)children
-(FBLPromise<AGMSearchResultsGroup *> *) browseService:(NSString *)service forParent:(NSString *)parent withStart:(NSNumber *)startindex andItemsPerPage:(NSNumber *)itemsperpage
-(FBLPromise<AGMSearchResultsGroup *> *) browseService:(NSString *)service forParent:(NSString *)parent withStart:(NSNumber *)startindex
-(FBLPromise<AGMSearchResultsGroup *> *) browseService:(NSString *)service forParent:(NSString *)parent
-(FBLPromise<AGMSearchResultsGroup *> *) browseService:(NSString *)service withChildren:(NSNumber *)children
-(FBLPromise<AGMSearchResultsGroup *> *) browseService:(NSString *)service
service
The content serviceparent
Optional parent group for drill downstartindex
Optional paging - the offset that items should start at - defaults to 0itemsperpage
Optional paging - the number of items to return in each bucket - defaults to 20Get an artist by id Get an artist by id. Returns artisttype, biogs, dateofbirth, dateofdeath, gender, genres, images, links, name, origin, originname, popularity, related, similar, services, tags, territory, yearsactive.
Requires search scope.
-(FBLPromise<AGMArtist *> *) getArtistById:
artistId
Artist idGets an artist's albums or songs from a service based on our id
Requires search scope.
-(FBLPromise<AGMTrackListing *> *) getArtistSongsForId:(NSString *)artistId inService:(NSString *)service withItemsPerPage:(NSNumber *)itemsperpage andStartIndex:(NSNumber *)startindex
-(FBLPromise<AGMTrackListing *> *) getArtistSongsForId:(NSString *)artistId inService:(NSString *)service withItemsPerPage:(NSNumber *)itemsperpage
-(FBLPromise<AGMTrackListing *> *) getArtistSongsForId:(NSString *)artistId inService:(NSString *)service
artistId
Audiogum artist idservice
The content servicestartindex
paging - the offset that items should start at - defaults to 0itemsperpage
paging - the number of items to return - defaults to 50Gets an artist's albums or songs from a service based on the service ref
Requires search scope.
-(FBLPromise<AGMTrackListing *> *) getArtistSongsForRef:(NSString *)artistId inService:(NSString *)service withItemsPerPage:(NSNumber *)itemsperpage andStartIndex:(NSNumber *)startindex
ref
Service ref for the artistservice
The content servicestartindex
paging - the offset that items should start at - defaults to 0itemsperpage
paging - the number of items to return - defaults to 50Gets an artist's albums from a service based on our id
Requires search scope.
-(FBLPromise<AGMPlaylistListing *> *) getArtistAlbumsForId:(NSString *)artistId inService:(NSString *)service withItemsPerPage:(NSNumber *)itemsperpage andStartIndex:(NSNumber)startindex
-(FBLPromise<AGMPlaylistListing *> *) getArtistAlbumsForId:(NSString *)artistId inService:(NSString *)service withItemsPerPage:(NSNumber *)itemsperpage
-(FBLPromise<AGMPlaylistListing *> *) getArtistAlbumsForId:(NSString *)artistId inService:(NSString *)service
artistId
Audiogum artist idservice
The content servicestartindex
paging - the offset that items should start at - defaults to 0itemsperpage
paging - the number of items to return - defaults to 50Gets an artist's albums from a service based on the service ref
Requires search scope.
-(FBLPromise<AGMPlaylistListing *> *) getArtistAlbumsForRef:(NSString *)ref inService:(NSString *)service withItemsPerPage:(NSNumber *)itemsperpage andStartIndex:(NSNumber)startindex
ref
The service refservice
The content servicestartindex
paging - the offset that items should start at - defaults to 0itemsperpage
paging - the number of items to return - defaults to 50Gets an artist's items of a specific type from a service based on the service ref
Requires search scope.
-(FBLPromise<AGMSearchResultsGroup *> *) getArtistItemsForRef:(NSString *)ref inService:(NSString *)service ofType:(NSString *)itemtype withItemsPerPage:(NSNumber *)itemsperpage andStartIndex:(NSNumber *)startindex
ref
The service refservice
The content serviceitemtype
The type of item to fetch. See AppConfig.Service.drilldowntypes
in getAppConfig
response for valid types for each service.startindex
paging - the offset that items should start at - defaults to 0itemsperpage
paging - the number of items to return - defaults to 50Search across content services. Returns search results in various buckets
Requires search scope.
-(FBLPromise<AGMSearchResultsGroup *> *) search:(NSString *)term withItemsPerPage:(NSNumber *)itemsperpage forTypes:(NSArray<NSString *> *)type inServices:(NSArray<NSString *> *)service
-(FBLPromise<AGMSearchResultsGroup *> *) search:(NSString *)term withItemsPerPage:(NSNumber *)itemsperpage forTypes:(NSArray<NSString *> *)type
-(FBLPromise<AGMSearchResultsGroup *> *) search:(NSString *)term withItemsPerPage:(NSNumber *)itemsperpage
-(FBLPromise<AGMSearchResultsGroup *> *) search:(NSString *)term
term
Content queryitemsperpage
Number of items in each bucket - default 3type
Optional filter parameter that limits types searched to those that are in this comma delimited listservice
Optional filter parameter that limits the services searched to those that are in this list (assuming they are allowed for the user)Get tracks for an album
Requires search scope.
-(FBLPromise<AGMTrackListing *> *) getAlbumTracksForRef:(NSString *)ref inService:(NSString *)service withItemsPerPage:(NSNumber *)itemsperpage andStartIndex:(NSNumber *)startindex
-(FBLPromise<AGMTrackListing *> *) getAlbumTracksForRef:(NSString *)ref inService:(NSString *)service withItemsPerPage:(NSNumber *)itemsperpage
-(FBLPromise<AGMTrackListing *> *) getAlbumTracksForRef:(NSString *)ref inService:(NSString *)service
service
The content serviceref
Service reference of parentstartindex
Optional paging - the offset that items should start at - defaults to 0itemsperpage
Optional paging - the number of items to return - defaults to 50Gets songs of a parent item - e.g. songs for an album, playlist. See https://www.audiogum.com/developers/docs/contentaggregation#drill_down.
Requires search scope.
-(FBLPromise<AGMTrackListing *> *) getSongsByParentForType:(NSString *)type withRef:(NSString *)ref inService:(NSString *)service withItemsPerPage:(NSNumber *)itemsperpage andStartIndex:(NSNumber *)startindex
-(FBLPromise<AGMTrackListing *> *) getSongsByParentForType:(NSString *)type withRef:(NSString *)ref inService:(NSString *)service withItemsPerPage:(NSNumber *)itemsperpage
-(FBLPromise<AGMTrackListing *> *) getSongsByParentForType:(NSString *)type withRef:(NSString *)ref inService:(NSString *)service
type
The resource typeservice
The content serviceref
The content service resource referencestartindex
Optional paging - the offset that items should start at - defaults to 0itemsperpage
Optional paging - the number of items to return - defaults to 50Gets a song by service reference.
Requires search scope.
-(FBLPromise<AGMTrack *> *) getServiceSongForRef:(NSString *)ref inService:(NSString *)service withItemsPerPage:(NSNumber *) itemsperpage andStartIndex:(NSNumber *)startindex
-(FBLPromise<AGMTrack *> *) getServiceSongForRef:(NSString *)ref inService:(NSString *)service withItemsPerPage:(NSNumber *) itemsperpage
-(FBLPromise<AGMTrack *> *) getServiceSongForRef:(NSString *)ref inService:(NSString *)service
ref
The content service resource referenceservice
The content servicestartindex
Optional paging - the offset that items should start at - defaults to 0itemsperpage
Optional paging - the number of items to return - defaults to 50Gets a playlist or album by service reference.
Requires search scope.
-(FBLPromise<AGMPlaylist *> *) getServicePlaylistForType:(NSString *)type andRef:(NSString *)ref inService:(NSString *)service withItemsPerPage:(NSNumber *) itemsperpage andStartIndex:(NSNumber *)startindex
-(FBLPromise<AGMPlaylist *> *) getServicePlaylistForType:(NSString *)type andRef:(NSString *)ref inService:(NSString *)service withItemsPerPage:(NSNumber *) itemsperpage
-(FBLPromise<AGMPlaylist *> *) getServicePlaylistForType:(NSString *)type andRef:(NSString *)ref inService:(NSString *)service
type
The resource type ("playlist" or "album")ref
The content service resource referenceservice
The content servicestartindex
Optional paging - the offset that items should start at - defaults to 0itemsperpage
Optional paging - the number of items to return - defaults to 50Get tracks for a playlist
Requires search scope.
-(FBLPromise<AGMTrackListing *> *) getPlaylistTracksForRef:(NSString *)ref inService:(NSString *)service withItemsPerPage:(NSNumber *)itemsperpage andStartIndex:(NSNumber *)startindex
-(FBLPromise<AGMTrackListing *> *) getPlaylistTracksForRef:(NSString *)ref inService:(NSString *)service withItemsPerPage:(NSNumber *)itemsperpage
-(FBLPromise<AGMTrackListing *> *) getPlaylistTracksForRef:(NSString *)ref inService:(NSString *)service
service
The content serviceref
Service reference of parentstartindex
Optional paging - the offset that items should start at - defaults to 0itemsperpage
Optional paging - the number of items to return - defaults to 50Search artists
Requires search scope.
-(FBLPromise<AGMSearchResultsGroup *> *) searchArtist:(NSString *)term withItemsPerPage:(NSNumber *)itemsperpage inService:(NSString *)service
-(FBLPromise<AGMSearchResultsGroup *> *) searchArtist:(NSString *)term withItemsPerPage:(NSNumber *)itemsperpage
-(FBLPromise<AGMSearchResultsGroup *> *) searchArtist:(NSString *)term
term
Query to search foritemsperpage
Number of items in each bucket - default 20startindex
Page start position - default 0service
Service to searchSearch artists
Requires search scope.
-(FBLPromise<AGMSearchResultsGroup *> *) searchArtistByIds:(NSString *)ids withItemsPerPage:(NSNumber *)itemsperpage inService:(NSString *)service
-(FBLPromise<AGMSearchResultsGroup *> *) searchArtistByIds:(NSString *)ids withItemsPerPage:(NSNumber *)itemsperpage
-(FBLPromise<AGMSearchResultsGroup *> *) searchArtistByIds:(NSString *)ids
id
IDs to obtain details foritemsperpage
Number of items in each bucket - default 20service
Service to searchSingle bucket results for paging Drill down into detailed results for paging through a bucket.
Requires search scope.
-(FBLPromise<AGMSearchResultsGroup *> *) searchBytType:(NSString *)type inService:(NSString *)service withTerm:(NSString *)term withItemsPerPage:(NSNumber *)itemsperpage andStartIndex:(NSNumber *)startindex
-(FBLPromise<AGMSearchResultsGroup *> *) searchBytType:(NSString *)type inService:(NSString *)service withTerm:(NSString *)term withItemsPerPage:(NSNumber *)itemsperpage
-(FBLPromise<AGMSearchResultsGroup *> *) searchBytType:(NSString *)type inService:(NSString *)service withTerm:(NSString *)term
-(FBLPromise<AGMSearchResultsGroup *> *) searchBytType:(NSString *)type inService:(NSString *)service
type
The bucket typeservice
The content serviceterm
Content queryitemsperpage
Number of items in each bucket - default 20startindex
Page start position - default 0Get a list of genres. Includes popularity in the current country and localized name.
Requires search scope.
-(FBLPromise<AGMGenres *> *) getGenresWithItemsPerPage:(NSNumber *)itemsperpage andStartIndex:(NSNumber *)startindex
-(FBLPromise<AGMGenres *> *) getGenresWithItemsPerPage:(NSNumber *)itemsperpage
-(FBLPromise<AGMGenres *> *) getGenres
startindex
Paging - the offset that items should start atitemsperpage
Paging - the number of items to returnGet the top artists (by popularity) for a selection of given genres
Requires search scope.
-(FBLPromise<AGMTopArtistsByGenre *> *) getTopArtistsForGenre:(NSString *)genre withItemsPerPage:(NSNumber *)itemsperpage andStartIndex:(NSNumber *)itemsperpage withFields:(NSString *)fields
-(FBLPromise<AGMTopArtistsByGenre *> *) getTopArtistsForGenre:(NSString *)genre withItemsPerPage:(NSNumber *)itemsperpage andStartIndex:(NSNumber *)itemsperpage
-(FBLPromise<AGMTopArtistsByGenre *> *) getTopArtistsForGenre:(NSString *)genre withItemsPerPage:(NSNumber *)itemsperpage
-(FBLPromise<AGMTopArtistsByGenre *> *) getTopArtistsForGenre:(NSString *)genre
genre
The genres to get topartists forstartindex
Paging - the offset that items should start atitemsperpage
Paging - the number of items to returnfields
The fields to returnThe most popular artists across a range of genres, merged together.
Requires search scope.
-(FBLPromise<AGMTopArtists *> *) getTopArtistsWithItemsPerPage:(NSNumber *)itemsperpage withFields:(NSString *)fields
-(FBLPromise<AGMTopArtists *> *) getTopArtistsWithItemsPerPage:(NSNumber *)itemsperpage
-(FBLPromise<AGMTopArtists *> *) getTopArtists
itemsperpage
Paging - the number of items to returnfields
The fields to returnRequest to create a playable and associate it with a device, based on specified parameters. This will update an existing playable if it exists for the same user with the same parameters. For examples, see https://www.audiogum.com/partners/docs/playback.html.
Requires write_playlists scope.
-(FBLPromise<AGMPlayable *> *) createPlayable:(AGMCreatePlayableRequest *)playableRequest
playableRequest
Information required to create a user playableGet information for a playable for playback based on its id. Depending on the type of playable, this gives a list of items or a streamurl for playback, plus data for service authentication where necessary. For examples, see https://www.audiogum.com/partners/docs/playback.html
Requires read_playlists scope.
-(FBLPromise<AGMPlayableTracks *> *) getPlayableTracks:(NSString *)playableId withStart:(NSNumber *)startindex andItemsPerPage:(NSNumber *)itemsperpage andStreamUrls:(NSNumber *)streamUrls
playableId
id of playablestartindex
the offset that items should start at - defaults to 0itemsperpage
Optional paging - the number of items to return - defaults to 50streamUrls
Optionally omit stream urls (false). Default (true) indicates include where applicableDeletes a specific playable based on its id
Requires write_playlists scope.
-(FBLPromise<NSNull *> *) deletePlayable:(NSString *)playableId
playableId
id of playableGet the basic details of a specific playable based on its id (note: this is not for playback purposes)
Requires write_playlists scope.
-(FBLPromise<AGMPlayable *> *) getUserPlayable:(NSString *)playableId
playableId
id of playableGet the details including items of a specific playable based on its id (note: this is not for playback purposes)
Requires read_playlists scope.
-(FBLPromise<AGMPlayableTracks *> *) getUserPlayableItems:(NSString *)playableId
-(FBLPromise<AGMPlayableTracks *> *) getUserPlayableItemsWithPlayableId:(NSString * _Nonnull)playableId itemsPerPage:(NSInteger)itemsPerPage startIndex:(NSInteger)startIndex
playableId
id of playablestartindex
the offset that items should start at - defaults to 0itemsperpage
optional paging - the number of items to return - defaults to 50Refresh streaming urls on behalf of the user for specific items from a service, for the case of time-limited content
Requires write_playlists scope.
-(FBLPromise<AGMTrackListing *> *) refreshStreamUrls:(NSString *)playableId forService:(NSString *)service withTrackIds:([NSString] *)trackIds
playableId
id of playableservice
servicetrackIds
track ids to refresh-(FBLPromise<NSNull *> *) authenticateForVoice
Authenticates the user, creating a 'speech' scoped token and a token valid for use in the remote control websockets API. If not called separately, this will be done the first time the openVoiceSession() function is used.
Call this method early in your flow if you know you will need voice capabilities, as opening the first voice session without first calling this method can be slow and lead to a poor user experience.
See https://www.audiogum.com/developers/docs/naturallanguageunderstanding.html for more details.
Starts a voice session. This allows the client to talk to the Audiogum Voice service which are APIs for controlling devices through voice commands. This method must be called before any data is sent to the voice service through sendVoiceMessage(message: String!)
or sendVoiceMessage(message: String!)
.
See https://www.audiogum.com/developers/docs/naturallanguageunderstanding.html for more details.
-(FBLPromise<NSNull *> *) openVoiceSessionWithProperties:(AGMVoiceProperties *)voiceProperties andDelegate:(AGMVoiceDelegate *)delegate
voiceProperties
The voiceproperties message must be sent by the device on the Remote Control WebSocket to initiate a voice interaction.delegate
An object that will respond to messages sent back from the voice service. It may also be sent again during the interaction as necessary to update nowplaying data if the player state changes.Sends a voice terminator
sendVoiceTerminatorWithError:(NSError *)error
error
errorSend a string message to the voice service.
See https://www.audiogum.com/developers/docs/naturallanguageunderstanding.html for more details.
sendVoiceStringMessage:(NSString *)message withError:(NSError *)error
message
Message to be sent to voice serviceerror
errorSend a message as data to the voice service.
See https://www.audiogum.com/developers/docs/naturallanguageunderstanding.html for more details.
sendVoiceDataMessage:(NSData *)message withError:(NSError *)error
message
Data to be sent to voice serviceerror
errorCloses the active voice session, if any is currently connected.
See https://www.audiogum.com/developers/docs/naturallanguageunderstanding for more details.
-(void) closeVoiceSessionWithError:(NSError *)error throws
-(FBLPromise<AGMRespond *> *) generateResponseAudio:(NSString *)phraseKey withLanguageCode:(NSString *)languageCode
Generates an audio response for the specified phrase in the language desired.
Requires speech scope
phraseKey
the key of the phrase to generate audio for.languageCode
the language to use when generating. If not specified, the user's language will be used.-(FBLPromise<AGMSpeechSuggestionResponse *> *) getSpeechSuggestions
-(FBLPromise<AGMSpeechSuggestionResponse *> *) getSpeechSuggestionsForNowPlaying:(AGMSpeechNowPlaying *)nowPlaying
Retrieves examples of speech requests that the user can make to the Audiogum service.
Requires speech scope
nowPlaying
optionally supply the current playing information for more personalised speech examples.-(FBLPromise<AGMTextToActionRequest *> *) makeSpeechRequestWithActionText:(AGMTextToActionResponse *)request
Convert the text of an instruction into the action that should be performed.
Requires speech scope
request
information about the request to be made.Get remotecontrol details of connected remote control device
See https://www.audiogum.com/developers/docs/remotecontrol.html for more details.
-(FBLPromise<AGMRemoteControlSupportedActionsDetails *> *) getRemoteControlDetailsForToken:(NSString *)remoteControlToken
remoteControlToken
Remote control tokenSend a command to a remote control device
See https://www.audiogum.com/developers/docs/remotecontrol.html for more details.
-(FBLPromise<NSNull *> *) sendRemoteControlCommand:(AGMRemoteControlCommand *)command
command
Remote control commandFBLPromise of NSNull
Get player state from a connected remote control device
See https://www.audiogum.com/developers/docs/remotecontrol.html for more details.
-(FBLPromise<AGMDevicePlayerDetails *> *) getRemoteControlDevicePlayerDetailsForToken:(NSString *)remoteControlToken
remoteControlToken
Remote control tokenGet device state from a connected remote control device
See https://www.audiogum.com/developers/docs/remotecontrol.html for more details.
-(FBLPromise<AGMRemoteControlDeviceDetails *> *) getRemoteControlDeviceDetailsForToken:(NSString *)remoteControlToken
remoteControlToken
Remote control tokenGet preset state from a connected remote control device
See https://www.audiogum.com/developers/docs/remotecontrol.html for more details.
-(FBLPromise<AGMRemoteControlDevicePresetDetails *> *)getRemoteControlDevicePresetDetailsForToken:(NSString *)remoteControlToken
remoteControlToken
Remote control token- (FBLPromise<AGMUserProfile *> *)getTasteProfile
Gets the taste profile.
- (FBLPromise<NSNull *> *)addToTasteProfile:(AGMTasteProfile *)itemsToAdd
Add items to the taste profile
itemsToAdd
Items to add to the taste profile- (FBLPromise<NSNull *> *)addToTasteProfileByName:(AGMTasteProfile *)itemsToAdd
Add items to the taste profile by name
itemsToAdd
Items to add to the taste profile by name- (FBLPromise<AGMTasteMatch *> *)checkArtistTasteStateByName:<#(NSString * _Nonnull)#>
Check artist taste state by name
name
The name to check- (FBLPromise<NSNull *> *)addArtistsToTasteProfile:([AGMArtist] *)artists
Add artists to the taste profile
artists
Artists to add to the taste profile- (FBLPromise<NSNull *> *)addAInternetRadiosToTasteProfile:([AGMInternetRadio] *)internetRadios
Add Internet Radio Stations to the taste profile
internetRadios
Internet Radio Stations to add to the taste profile- (FBLPromise<NSNull *> *)addPlaylistsToTasteProfile:([AGMPlaylist] *)playlists
Add Playlists to the taste profile
playlists
Playlists to add to the taste profile- (FBLPromise<NSNull *> *)addAlbumToTasteProfile:([AGMPlaylist] *)albums
Add Albums to the taste profile
albums
Albums to add to the taste profile- (FBLPromise<NSNull *> *)addSongsToTasteProfile:([AGMSong] *)songs
Add Songs to the taste profile
songs
Songs to add to the taste profile- (FBLPromise<NSNull *> *)addArtistsToTasteProfile:([AGMArtist] *)artists withInternetRadios:([AGMInternetRadio] *)internetradios withPlaylists:([AGMPlaylist] *)playlists withAlbums:([AGMPlaylist] *)albums withSongs:([Track] *)songs
Add Likes to the taste profile
artists
Artists to add to the taste profileinternetRadios
Internet Radio Stations to add to the taste profileplaylists
Playlists to add to the taste profilealbums
Albums to add to the taste profilesongs
Songs to add to the taste profile- (FBLPromise<NSNull *> *)deleteFromTasteProfile:(AGMTasteProfile *)itemsToDelete
Removes multiple items from the taste profile
itemsToDelete
Items to delete from the taste profile- (FBLPromise<NSNull *> *)deleteArtistsFromTasteProfile:([AGMArtist] *)artists
Delete artists from the taste profile
artists
Artists to delete from the taste profile- (FBLPromise<NSNull *> *)deleteAInternetRadiosFromTasteProfile:([AGMInternetRadio] *)internetRadios
Delete Internet Radio Stations from the taste profile
internetRadios
Internet Radio Stations to delete from the taste profile- (FBLPromise<NSNull *> *)deletePlaylistsFromTasteProfile:([AGMPlaylist] *)playlists
Delete Playlists from the taste profile
playlists
Playlists to delete from the taste profile- (FBLPromise<NSNull *> *)deleteAlbumFromTasteProfile:([AGMPlaylist] *)albums
Delete Albums from the taste profile
albums
Albums to delete from the taste profile- (FBLPromise<NSNull *> *)deleteSongsFromTasteProfile:([AGMSong] *)songs
Delete Songs from the taste profile
songs
Songs to delete from the taste profile- (FBLPromise<NSNull *> *)deleteArtistsFromTasteProfile:([AGMArtist] *)artists withInternetRadios:([AGMInternetRadio] *)internetradios withPlaylists:([AGMPlaylist] *)playlists withAlbums:([AGMPlaylist] *)albums withSongs:([Track] *)songs
Delete Likes from the taste profile
artists
Artists to delete from the taste profileinternetRadios
Internet Radio Stations to delete from the taste profileplaylists
Playlists to delete from the taste profilealbums
Albums to delete from the taste profilesongs
Songs to delete from the taste profile- (FBLPromise<AGMTagsProfile *> *)getTasteGenreTags
- (FBLPromise<AGMTagsProfile *> *)getTasteGenreTagsWithTagsPerItem:(NSInteger)tagsPerItem
Gets the top genre tags matching user's profile
tagsPerItem
optionally limit the tag values used per item to the specified number of most important values-(FBLPromise<NSNull *> *)sendAnalyticsWithEvents:(NSArray<AGMEvent *> *)events
-(FBLPromise<NSNull *> *)sendAnalyticsWithEvents:(NSArray<AGMEvent *> *)events withValidation:(BOOL)validateOnly
Sends analytics events, recording user or client actions or behaviour.
Requires write_events scope.
See https://www.audiogum.com/developers/docs/analytics.html for more details.
events
the collection of events to send.validateOnly
if true, the events will validated but not recorded. Defaults to false.-(FBLPromise<NSNull *> *)uploadLogWithDeviceId:(NSString *)deviceId logType:(NSString *)logType content:(NSString *)content
Upload a log or crash dump file.
Requires write_device scope.
deviceId
The id of the device the log relates to.logType
The type of log to be sent.content
The content to be logged.- (FBLPromise<AGMAppRelease *> *) getAppReleaseForRegion:(NSString *)region onPlatform:(NSString *)platform inAppStore:(NSString *)appstore withVersion:(NSString *)version
withLanguage:(NSString *)language withAltApp:(NSString *)altapp withPlatformVersion:(NSString *)platformveresion withDeviceManufacturer:(NSString *)deviceManufacturer withDeviceName(NSString *)devicename
Fetches details of any available app update.
region
Region to check for (required)platform
Operating system (required)appstore
App Store to check (required)version
Current version installed (required)language
Get releasenotes in this languagealtapp
Codename of alternative app. Omit this for releases of the default app.platformversion
Optional operating system versiondevicemanufacturer
Optional device manufacturerdevicename
Optional device name- (FBLPromise<NSNull *> *)registerDevice
Registers the device making the SDK calls with the Audiogum API. This is required to ensure your analytics data is as accurate as possible.
- (FBLPromise<AGMDeviceList *> *)getUserDevices
- (FBLPromise<AGMDeviceList *> *)getUserDevicesOfType: (NSArray<NSString *> *)ofType
Lists the devices this user has been associated with.
ofType
An optional array of device types to fetch.- (FBLPromise<AGMDeviceList *> *)getUserOwnedDevices
Lists the devices currently owned by the current user. Note that the full device info is not shown here.
- (FBLPromise<NSNull *> *)registerUserOwnedDeviceWithId: (NSString *)deviceid
Creates an ownership relationship betweenn the specified device and the current user. If the device already has a different owner, this request will fail with 409 response code.
deviceid
the id of the device being marked as owned.