Gracenote API - No track link data - ios

Currently, in my AppDelegate, I have an instance variable declared for GNConfig that is set up with all properties I would like to receive.
This instance of GNconfig is used by any class that makes a gracenote request.
The requests I am using are recognition from an audio stream, recognition by local file and a text search which populates an array. The array is then used for track lookups by id for the corresponding array item.
I am able to get all the content I need, except for track and album link data (always returns null).
I have tried plenty of different suggestions and guides with no luck.
Could somebody please help me out? This data is essential to my app and my app is pretty much complete except for this big obstacle.
Thanks in advance.
** edit **
This is in my appDelegate:
_gnConfig = [GNConfig init:#"XXXXXXX-XXXXXXXXXXXXXXXXXXXXXXX"];
[_gnConfig setProperty:#"content.coverArt" value:#"1"];
[_gnConfig setProperty:#"content.coverArt.sizePreference" value:#"LARGE"];
[_gnConfig setProperty:#"content.allowFullResponse" value:#"1"];
I have this in one of my class methods:
NSURL *filePath = [item valueForProperty:MPMediaItemPropertyAssetURL];
[GNOperations recognizeMIDFileFromFile:self config:[[AppDelegate sharedDelegate] gnConfig] fileUrl:filePath];
In the delegate method I have:
gracenoteResponseItem = [result bestResponse];
NSLog("%#", [gracenoteResponseItem trackLinkData]);

Some tracks may not have link data available.
Also if you are doing a local lookup then you will have to set this config option:
[publicProperties setObject:#“1"forKey:#"content.allowfullresponse"];

Unless you have explicitly had your client ID entitled for Link IDs (aka 'external' or '3rd party' IDs), you won't get any in your responses.
By default, Gracenote Open Developer client IDs aren't entitled for any external IDs. You need to coordinate with Gracenote to entitle your client ID to start receiving the desired IDs.

Related

Multiple user Video Call using WebRTC SDK Directly

Hi I am working on a Video Call Solution by using WebRTC directly. I have achieved 1-1 video call using firebase as Signaling service and using default google ICE Servers.
Core Req: Multiple users with in a Room using WebRTC at least 4 users using the default ice/stun servers available. I'm using pod 'GoogleWebRTC'
Issue comes when multiple users joins the same room ID.
So, I am maintaining Peerconnection reference as this
var peerConnection: RTCPeerConnection! = nil
When a new user i.e., remote user joins I set its description as below
self.peerConnection.setRemoteDescription(offer, completionHandler: {(error: Error?) in
if error == nil {
LOG("setRemoteDescription(offer) succsess")
self.makeAnswer() // Create Answer if setRemoteDescription succeeds
} else {
LOG("setRemoteDescription(offer) ERROR: " + error.debugDescription)
}
})
What I feel ? Issue is when third user joins again I set the remote Description with above mentioned code which makes my previous video stops to render sometimes or most of the times.
I looked for solutions and found need to maintain multiple peer connection references, but how? Any help with my requirement will be appreciated.
Just give me clue or sample code will be really great.
In case of multiple user call you should have multiple peerconnections, because it's isn't possible to set different sdps to one pc.
So you can use something like this
var peerConnectionMap = [String: RTCPeerConnection]()
Where String here is some constant user id.
When new user is joined to the room, then you create new pc and store it in this dictionary. Then you exchange with sdps as usual.
Don't forget that you should reuse local audio-video track created when first peerconnection is created.

Create Pin PDKResponseObject response not consistent with documentation

We are creating a pin in a specific Board by using the method
createPinWithImageđź”—onBaord:description:progress:withSuccess:andFailure:
We read in the documentation (here: https://developers.pinterest.com/docs/api/overview/ and here: https://github.com/pinterest/ios-pdk/blob/master/Pod/Classes/PDKClient.h#L417) that this method should return a PDKResponseObject *responseObject with the ID, URL, clickthrough URL and description of the created Pin.
We have been creative enough to try to access the ID of the Pin and its URL using any possible key (#"id", #"identifier", #"url", #"NSUrl") but the values returned are always nil. In fact the PDKResponseObject returns only 2 keys: Board ID and Pin Description.
What should we do to access the ID or, at the very least, the URL of the newly created Pin?
Does anybody have the same issue?
Despite multiple attempts and after having tried to discuss this issue with the Pinterest development Team, this still remains.
Testing a solution becomes also extremely difficult considering the new limitation Pinterest has imposed on not approved apps (which include all apps under development by definition).
For now, I only found a way around by calling a new request to get all pins in a specific board and get the first in the resulting array (which is the last posted):
//Create pin in Pinterest
[[PDKClient sharedInstance]createPinWithImage:image link:urlToShare
onBoard:reference description:message progress:nil
withSuccess:^(PDKResponseObject *responseObjectCreation) {
//Previous block does not return pin id so a new call is required
[[PDKClient sharedInstance]getBoardPins:reference fields:[NSSet
setWithArray:#[#"link"]] withSuccess:^(PDKResponseObject
*responseObject) {
//Get id of last pin
NSArray *pinIDs = [[NSArray arrayWithArray:[responseObject
pins]]valueForKey:#"identifier"];
NSString *postId = [pinIDs objectAtIndex:0];
}];
}];
By the way, the right key for the pin ID is "identifier" and not "id" or "ID" as said in the API documentation. Just found out by trying multiple times and checking the Pinterest Example app in GitHub.
Hope this helps other people who are fighting the same problem.

How can I get the list of all the files uploaded in my built.io application?

I have made an iOS application using built.io. There are several files uploaded in the application. However, i am unable to get the list of all the files uploaded in the app. Could anyone please help?
This can be done via BuiltFile class instance method fetchAllOnSuccess:onError:
It returns all files uploaded in your built application only if the requesting user has permission for it.
Built* builtfileObj = [Built file];
[builtfileObj fetchAllOnSuccess:^(NSArray *allFiles) {
// allFiles contains array of BuiltFiles
} onError:^(NSError *error) {
// there was an error in creating the object
// error.userinfo contains more details regarding the same
}];
To fetch all the uploads, the iOS SDK provides an instance method in the BuiltFile class. It returns an array of all the uploads.
Here's the link to the official documentation
http://static.built.io/downloads/sdk-docs/ios-docs/Classes/BuiltFile.html#//api/name/fetchAllOnSuccess:onError:
I dont know if its available in the iOS SDK but you can use the REST API to fetch it
Headers :
"application_uid: uid"
"application_api_key: api_key"
URL: GET : https://manage.built.io/v1/uploads?skip=0&limit=50&include_count=true
Params : skip and limit for pagination and include_count is for getting the total count.
The above url will fetch all types of files
But if you want only images or videos then you can use the below urls
https://manage.built.io/v1/uploads/images
https://manage.built.io/v1/uploads/videos
I hope i was helpful to you!!
Note : without the headers the API wont work

Saving an iCloud Drive security scoped URL on iOS (UIDocumentPickerViewController)

I'm trying to save the security scoped URL returned from iCloud document picker (UIDocumentPickerViewController)
The documentation states:
If the URL is not a ubiquitous URL, save a bookmark to the file using
the
bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error:
method and passing in the NSURLBookmarkCreationWithSecurityScope
option. Calling this method creates a bookmark containing a
security-scoped URL that you can use to open the file without further
user intervention.
However, the compiler says that NSURLBookmarkCreationWithSecurityScope is not supported on iOS.
Anyone know what's going on here....?
After further digging, it turns out option NSURLBookmarkCreationWithSecurityScope is NOT needed at all when creating bookmark data in IOS. It's an option for OS X. You can just pass nil for the option field. I think Apple's document is confusing at the best.
However, you do need to call startAccessingSecurityScopedResource before creating the bookmark and make sure the call returns 1 (success) before proceed. Otherwise, bookmark creation will fail. Here is the sample code:
if ([url startAccessingSecurityScopedResource]==1) {
NSError *error;
NSData *bookmark = [url bookmarkDataWithOptions:nil
includingResourceValuesForKeys:nil
relativeToURL:nil
error:&error];
if (error) {
//handle error condition
} else {
// save your bookmark
}
}
[url stopAccessingSecurityScopedResource];
Again Apple's document is confusion at the best! It took me a lot of time to find out this. Hope this helps.
I ran into the same issue today, and indeed the compiler says NSURLBookmarkCreationWithSecurityScope is not available on iOS.
But to my surprise, if I use the raw constant instead (NSURLBookmarkCreationWithSecurityScope maps to ( 1 << 11 ), the method seems to work. It returns a valid bookmark data object, and when I call [[NSURL URLByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:stale], a valid security-scoped NSURL is returned and I can access the files and directories. Also, I tested these with iCloud Drive. And the documentation only says this should work for third-party document providers.
I am not sure how reliable this approach is, because it seems that Apple engineers didn't have time to finish up this feature, so disabled it in the last minute. Or it could be simply a bug in the header file. If anyone finds out more about this, please comment.

Google+ API in iOS, GPPShare recipient setting

I am trying to integrate GooglePlus inside an iOS app of mine.
The app sends a simple message. I have a few questions about the setting of the recipient(s).
Here is the kind of code I am using:
[GPPShare sharedInstance].delegate = self;
id<GPPNativeShareBuilder> shareBuilder = [[GPPShare sharedInstance] nativeShareDialog];
[shareBuilder setPrefillText:#"Hello world! How is everything?"];
[shareBuilder setPreselectedPeopleIDs:#"112233445566778899000"]; // Question point!!
if (![shareBuilder open]) {
NSLog(#"Status: Error (shareBuilder cannot open).");
}
When the line with the comment "Question point!!" is present, I can set one(or a few) individual(s) as recipient(s) of the message.
When it is not present the set of recipients defaults to "Friends".
Here are my two questions:
Is it possible to set one of my circles (or a community) as recipient? Not only "Friends".
When using the "setPreselectedPeopleIDs:" method, one needs the ID of the recipient. How do we find this ID? There are documents and videos on the net showing how to find one's own ID, but since people usually send messages to other peole rather than to themselves, it would also be useful to know how to get other's IDs.
Doesn't seem like you can share with a specific circle.
You can use this method to get all of the visible people in the user's circles using this method
queryForPeopleListWithUserId:collection:
which is outlined here:
https://developers.google.com/+/mobile/ios/people
Explanation of the parameters from the header:
// List all of the people in the specified collection.
// Required:
// userId: Get the collection of people for the person identified. Use "me" to
// indicate the authenticated user.
// collection: The collection of people to list.
// kGTLPlusCollectionVisible: The list of people who this user has added to
// one or more circles, limited to the circles visible to the requesting
// application.
And another question that goes into this a little bit:
How to Fetch Google Plus circles in IOS Sdk
It does not seem to me like you can discern who is in what circle, unfortunately.

Resources